aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-testing-harness/src/main/java
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/main/java
parent2ce25079bcbcffec9e7647c56d3fc151e7469aad (diff)
downloadsonarqube-78768f07309629c4ade43ba5124cb5e076438add.tar.gz
sonarqube-78768f07309629c4ade43ba5124cb5e076438add.zip
Remove XMLUnit from sonar-testing-harness
Diffstat (limited to 'sonar-testing-harness/src/main/java')
-rw-r--r--sonar-testing-harness/src/main/java/org/sonar/test/TestUtils.java52
1 files changed, 0 insertions, 52 deletions
diff --git a/sonar-testing-harness/src/main/java/org/sonar/test/TestUtils.java b/sonar-testing-harness/src/main/java/org/sonar/test/TestUtils.java
index 3b4d68448ca..eedcee75337 100644
--- a/sonar-testing-harness/src/main/java/org/sonar/test/TestUtils.java
+++ b/sonar-testing-harness/src/main/java/org/sonar/test/TestUtils.java
@@ -19,22 +19,16 @@
*/
package org.sonar.test;
-import com.google.common.base.Throwables;
import org.apache.commons.io.Charsets;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.CharUtils;
import org.apache.commons.lang.StringUtils;
-import org.custommonkey.xmlunit.Diff;
-import org.custommonkey.xmlunit.XMLUnit;
import org.sonar.api.utils.SonarException;
import java.io.File;
import java.io.IOException;
import java.net.URL;
-import static org.junit.Assert.assertTrue;
-
/**
* Utilities for unit tests
*
@@ -90,50 +84,4 @@ public final class TestUtils {
resourcePath += path;
return getResource(resourcePath);
}
-
- /**
- * Shortcut for getTestTempDir(baseClass, testName, true) : cleans the unit test directory
- */
- public static File getTestTempDir(Class baseClass, String testName) {
- return getTestTempDir(baseClass, testName, true);
- }
-
- /**
- * Create a temporary directory for unit tests.
- *
- * @param baseClass the unit test class
- * @param testName the test name
- * @param clean remove all the sub-directories and files ?
- */
- public static File getTestTempDir(Class baseClass, String testName, boolean clean) {
- File dir = new File("target/test-tmp/" + baseClass.getCanonicalName() + "/" + testName);
- if (clean && dir.exists()) {
- try {
- FileUtils.deleteDirectory(dir);
- } catch (IOException e) {
- throw new SonarException("Can not delete the directory " + dir, e);
- }
- }
- try {
- FileUtils.forceMkdir(dir);
- } catch (IOException e) {
- throw new SonarException("Can not create the directory " + dir, e);
- }
- return dir;
- }
-
- public static void assertSimilarXml(String expectedXml, String xml) {
- Diff diff = isSimilarXml(expectedXml, xml);
- String message = "Diff: " + diff.toString() + CharUtils.LF + "XML: " + xml;
- assertTrue(message, diff.similar());
- }
-
- static Diff isSimilarXml(String expectedXml, String xml) {
- XMLUnit.setIgnoreWhitespace(true);
- try {
- return XMLUnit.compareXML(xml, expectedXml);
- } catch (Exception e) {
- throw Throwables.propagate(e);
- }
- }
}