1 | void testParseErrorInIncluded() {↵ | | 1 | void testParseErrorInIncluding() {↵
|
2 | try {↵ | | 2 | try {↵
|
3 | configureProject("src/etc/testcases/core/include/included_file_parse_error/build.xml");↵ | | 3 | configureProject("src/etc/testcases/core/include/including_file_parse_error/build.xml");↵
|
4 | fail("should have caused a parser exception");↵ | | 4 | fail("should have caused a parser exception");↵
|
5 | } catch (BuildException e) {↵ | | 5 | } catch (BuildException e) {↵
|
6 | assertTrue(e.getLocation().toString()↵ | | 6 | assertTrue(e.getLocation().toString()↵
|
7 | + " should refer to included_file.xml",↵ | | 7 | + " should refer to build.xml",↵
|
8 | e.getLocation().toString()↵ | | 8 | e.getLocation().toString()↵
|
9 | .indexOf("included_file.xml:") > -1);↵ | | 9 | .indexOf("build.xml:") > -1);↵
|
10 | }↵ | | 10 | }↵
|
11 | }↵ | | 11 | }↵
|
|
12 | public void testTaskErrorInIncluded() {↵ | | 12 | public void testTaskErrorInIncluding() {↵
|
13 | configureProject("src/etc/testcases/core/include/included_file_task_error/build.xml");↵ | | 13 | configureProject("src/etc/testcases/core/include/including_file_task_error/build.xml");↵
|
14 | try {↵ | | 14 | try {↵
|
15 | executeTarget("test");↵ | | 15 | executeTarget("test");↵
|
16 | fail("should have cause a build failure");↵ | | 16 | fail("should have cause a build failure");↵
|
17 | } catch (BuildException e) {↵ | | 17 | } catch (BuildException e) {↵
|
18 | assertTrue(e.getMessage()↵ | | 18 | assertTrue(e.getMessage()↵
|
19 | + " should start with \'Warning: Could not find",↵ | | 19 | + " should start with \'Warning: Could not find",↵
|
20 | e.getMessage().startsWith("Warning: Could not find file "));↵ | | 20 | e.getMessage().startsWith("Warning: Could not find file "));↵
|
21 | assertTrue(e.getLocation().toString()↵ | | 21 | assertTrue(e.getLocation().toString()↵
|
22 | + " should end with included_file.xml:2: ",↵ | | 22 | + " should end with build.xml:14: ",↵
|
23 | e.getLocation().toString().endsWith("included_file.xml:2: "));↵ | | 23 | e.getLocation().toString().endsWith("build.xml:14: "));↵
|
24 | }↵ | | 24 | }↵
|
25 | | | 25 |
|