Skip to content

Commit 9e16c33

Browse files
committed
Simplified unit tests. Surefire/failsafe correctly sets the current working directory by default, so that we don't need to check the basedir system property. Ensure that we use the default everywhere.
1 parent 0466c15 commit 9e16c33

File tree

24 files changed

+49
-43
lines changed

24 files changed

+49
-43
lines changed

axis-ant/src/test/java/org/apache/axis/tools/ant/wsdl/CustomGeneratorFactoryTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
public class CustomGeneratorFactoryTest extends TestCase {
2828
public void test() throws Exception {
29-
File file = new File(System.getProperty("basedir", "."), "target/work/com/example/stockquote_wsdl/StockQuoteServiceLocator.java");
29+
File file = new File("target/work/com/example/stockquote_wsdl/StockQuoteServiceLocator.java");
3030
assertTrue(FileUtils.readFileToString(file).contains("My header comment"));
3131
}
3232
}

axis-ant/src/test/java/test/wsdl/clash/VerifyFilesTestCase.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ protected Set mayExist() {
6666
* The directory containing the files that should exist.
6767
*/
6868
protected String rootDir() {
69-
return System.getProperty("basedir", ".") + File.separator +
70-
"target" + File.separator + "work" + File.separator +
69+
return "target" + File.separator + "work" + File.separator +
7170
"test" + File.separator + "wsdl" + File.separator +
7271
"clash";
7372
} // rootDir

axis-ant/src/test/java/test/wsdl/extra/ExtraClassesTestCase.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ protected Set mayExist() {
5959
* The directory containing the files that should exist.
6060
*/
6161
protected String rootDir() {
62-
return System.getProperty("basedir", ".") + File.separator +
63-
"target" + File.separator + "work" + File.separator +
62+
return "target" + File.separator + "work" + File.separator +
6463
"test" + File.separator + "wsdl" + File.separator +
6564
"extra";
6665
} // rootDir

axis-ant/src/test/java/test/wsdl/filegen/AllOptionTestCase.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ protected Set shouldExist() {
4848
* The directory containing the files that should exist.
4949
*/
5050
protected String rootDir() {
51-
return System.getProperty("basedir", ".") + File.separator +
52-
"target" + File.separator + "work" + File.separator +
51+
return "target" + File.separator + "work" + File.separator +
5352
"test" + File.separator + "wsdl" + File.separator +
5453
"filegenAll";
5554
} // rootDir

axis-ant/src/test/java/test/wsdl/filegen/FileGenTestCase.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ protected Set mayExist() {
6262
* The directory containing the files that should exist.
6363
*/
6464
protected String rootDir() {
65-
return System.getProperty("basedir", ".") + File.separator +
66-
"target" + File.separator + "work" + File.separator +
65+
return "target" + File.separator + "work" + File.separator +
6766
"test" + File.separator + "wsdl" + File.separator +
6867
"filegen";
6968
}

axis-ant/src/test/java/test/wsdl/groups/GroupsTestCase.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ protected Set shouldNotExist() {
5656
* The directory containing the files that should exist.
5757
*/
5858
protected String rootDir() {
59-
return System.getProperty("basedir", ".") + File.separator +
60-
"target" + File.separator + "work" + File.separator +
59+
return "target" + File.separator + "work" + File.separator +
6160
"test" + File.separator + "wsdl" + File.separator +
6261
"groups";
6362
}

axis-ant/src/test/java/test/wsdl/header/VerifyFilesTestCase.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ protected Set shouldExist() {
5858
* The directory containing the files that should exist.
5959
*/
6060
protected String rootDir() {
61-
return System.getProperty("basedir", ".") + File.separator +
62-
"target" + File.separator + "work" + File.separator +
61+
return "target" + File.separator + "work" + File.separator +
6362
"test" + File.separator + "wsdl" + File.separator +
6463
"header";
6564
} // rootDir

axis-ant/src/test/java/test/wsdl/literal/SalesRankNPrice_ServiceTestCase.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ public class SalesRankNPrice_ServiceTestCase extends junit.framework.TestCase {
5454
};
5555

5656
public void testFileGen() throws IOException {
57-
String rootDir = System.getProperty("basedir", ".") + File.separator +
58-
"target" + File.separator + "work" + File.separator +
57+
String rootDir = "target" + File.separator + "work" + File.separator +
5958
"test" + File.separator + "wsdl" + File.separator + "literal";
6059
// open up the output directory and check what files exist.
6160
File outputDir = new File(rootDir);

axis-ant/src/test/java/test/wsdl/multibinding/VerifyFilesTestCase.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ protected Set shouldExist() {
5858
* The directory containing the files that should exist.
5959
*/
6060
protected String rootDir() {
61-
return System.getProperty("basedir", ".") + File.separator +
62-
"target" + File.separator + "work" + File.separator +
61+
return "target" + File.separator + "work" + File.separator +
6362
"test" + File.separator + "wsdl" + File.separator +
6463
"multibinding";
6564
} // rootDir

axis-ant/src/test/java/test/wsdl/schemaImport/SchemaImportTestCase.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ public SchemaImportTestCase(String name) {
4242
}
4343

4444
public void testSchemaImport() {
45-
String path = System.getProperty("basedir", ".") + File.separator +
46-
"target" + File.separator + "work" + File.separator +
45+
String path = "target" + File.separator + "work" + File.separator +
4746
"test" + File.separator + "wsdl" + File.separator +
4847
"schemaImport" + File.separator + "foo.wsdl";
4948
Document doc = null;

0 commit comments

Comments
 (0)