aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-testing-harness/src/test
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2014-04-23 15:17:18 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2014-04-23 15:17:48 +0200
commit78768f07309629c4ade43ba5124cb5e076438add (patch)
tree4532a9c6a8b2d34f023b3a825b8989ef2d5a5386 /sonar-testing-harness/src/test
parent2ce25079bcbcffec9e7647c56d3fc151e7469aad (diff)
downloadsonarqube-78768f07309629c4ade43ba5124cb5e076438add.tar.gz
sonarqube-78768f07309629c4ade43ba5124cb5e076438add.zip
Remove XMLUnit from sonar-testing-harness
Diffstat (limited to 'sonar-testing-harness/src/test')
-rw-r--r--sonar-testing-harness/src/test/java/org/sonar/test/TestUtilsTest.java45
1 files changed, 3 insertions, 42 deletions
diff --git a/sonar-testing-harness/src/test/java/org/sonar/test/TestUtilsTest.java b/sonar-testing-harness/src/test/java/org/sonar/test/TestUtilsTest.java
index 0f44c7443f7..54a0d903357 100644
--- a/sonar-testing-harness/src/test/java/org/sonar/test/TestUtilsTest.java
+++ b/sonar-testing-harness/src/test/java/org/sonar/test/TestUtilsTest.java
@@ -19,16 +19,12 @@
*/
package org.sonar.test;
-import static org.fest.assertions.Assertions.assertThat;
-import static org.sonar.test.TestUtils.assertSimilarXml;
-import static org.sonar.test.TestUtils.getResource;
-import static org.sonar.test.TestUtils.getTestTempDir;
-import static org.sonar.test.TestUtils.isSimilarXml;
+import org.junit.Test;
import java.io.File;
-import org.apache.commons.io.FileUtils;
-import org.junit.Test;
+import static org.fest.assertions.Assertions.assertThat;
+import static org.sonar.test.TestUtils.getResource;
public class TestUtilsTest {
@@ -49,39 +45,4 @@ public class TestUtilsTest {
File file = getResource("org/sonar/test/TestUtilsTest/unknown.txt");
assertThat(file).isNull();
}
-
- @Test
- public void testTempDir() throws Exception {
- File dir = getTestTempDir(getClass(), "testTempDir");
- assertThat(dir).exists().isDirectory();
- assertThat(dir.listFiles()).isEmpty();
-
- FileUtils.writeStringToFile(new File(dir, "bar.txt"), "some text");
- assertThat(dir.listFiles()).hasSize(1);
-
- // the directory is cleaned
- dir = getTestTempDir(getClass(), "testTempDir");
- assertThat(dir).exists().isDirectory();
- assertThat(dir.listFiles()).isEmpty();
- }
-
- @Test
- public void testAssertSimilarXml() throws Exception {
- assertSimilarXml("<foo></foo>", "<foo />");
-
- // order of attributes
- assertSimilarXml("<foo><bar id='1' key='one' /></foo>", "<foo><bar key='one' id='1' /></foo>");
-
- // whitespaces are ignored
- assertSimilarXml("<foo> <bar /> </foo>", "<foo><bar/></foo>");
-
- // attribute values are checked
- assertThat(isSimilarXml("<foo id='1' />", "<foo id='2'/>").similar()).isFalse();
-
- // different xml
- assertThat(isSimilarXml("<foo id='1' />", "<foo id='2'/>").similar()).isFalse();
-
- // order of nodes is important
- assertThat(isSimilarXml("<foo><bar id='1' /><bar id='2' /></foo>", "<foo><bar id='2' /><bar id='1' /></foo>").similar()).isFalse();
- }
}