|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.sonar.test.TestUtils
public final class TestUtils
Utilities for unit tests
Method Summary | |
---|---|
static void |
assertSimilarXml(String expectedXml,
String xml)
|
static File |
getResource(Class baseClass,
String path)
Search for a resource in the classpath. |
static File |
getResource(String path)
Search for a test resource in the classpath. |
static String |
getResourceContent(String path)
|
static File |
getTestTempDir(Class baseClass,
String testName)
Shortcut for getTestTempDir(baseClass, testName, true) : cleans the unit test directory |
static File |
getTestTempDir(Class baseClass,
String testName,
boolean clean)
Create a temporary directory for unit tests. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static File getResource(String path)
path
- the starting slash is optional
public static String getResourceContent(String path)
public static File getResource(Class baseClass, String path)
public static File getTestTempDir(Class baseClass, String testName)
public static File getTestTempDir(Class baseClass, String testName, boolean clean)
baseClass
- the unit test classtestName
- the test nameclean
- remove all the sub-directories and files ?public static void assertSimilarXml(String expectedXml, String xml)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |