Lines 115-120
Link Here
|
115 |
String FILE_PATH = "@" + TEST_DIR + "configWithClasspathExtdirsBootCPArgs.lst"; |
115 |
String FILE_PATH = "@" + TEST_DIR + "configWithClasspathExtdirsBootCPArgs.lst"; |
116 |
AjBuildConfig config = genBuildConfig(new String[] { FILE_PATH }, messageWriter); |
116 |
AjBuildConfig config = genBuildConfig(new String[] { FILE_PATH }, messageWriter); |
117 |
List classpath = config.getFullClasspath(); |
117 |
List classpath = config.getFullClasspath(); |
|
|
118 |
// note that empty or corrupt jars are NOT included in the classpath |
118 |
// should have three entries, resolved relative to location of .lst file |
119 |
// should have three entries, resolved relative to location of .lst file |
119 |
assertEquals("Three entries in classpath",3,classpath.size()); |
120 |
assertEquals("Three entries in classpath",3,classpath.size()); |
120 |
Iterator cpIter = classpath.iterator(); |
121 |
Iterator cpIter = classpath.iterator(); |
Lines 507-512
Link Here
|
507 |
assertEquals("Wrong outxml","custom/aop.xml",config.getOutxmlName()); |
508 |
assertEquals("Wrong outxml","custom/aop.xml",config.getOutxmlName()); |
508 |
assertTrue("Following option currupted",config.getShowWeavingInformation()); |
509 |
assertTrue("Following option currupted",config.getShowWeavingInformation()); |
509 |
} |
510 |
} |
|
|
511 |
|
512 |
public void testNonstandardInjars() { |
513 |
AjBuildConfig config = setupNonstandardPath("-injars"); |
514 |
assertEquals("bad path: " + config.getInJars(), 3, config.getInJars().size()); |
515 |
} |
516 |
|
517 |
public void testNonstandardInpath() { |
518 |
AjBuildConfig config = setupNonstandardPath("-inpath"); |
519 |
assertEquals("bad path: " + config.getInpath(), 3, config.getInpath().size()); |
520 |
} |
521 |
|
522 |
public void testNonstandardAspectpath() { |
523 |
AjBuildConfig config = setupNonstandardPath("-aspectpath"); |
524 |
assertEquals("bad path: " + config.getAspectpath(), 3, config.getAspectpath().size()); |
525 |
} |
526 |
|
527 |
public void testNonstandardClasspath() throws IOException { |
528 |
AjBuildConfig config = setupNonstandardPath("-classpath"); |
529 |
checkPathSubset(config.getClasspath()); |
530 |
} |
531 |
|
532 |
public void testNonstandardBootpath() throws IOException { |
533 |
AjBuildConfig config = setupNonstandardPath("-bootclasspath"); |
534 |
checkPathSubset(config.getBootclasspath()); |
535 |
} |
536 |
|
537 |
private void checkPathSubset(List path) throws IOException { |
538 |
String files[] = { "aspectjJar.file", "jarChild", "parent.zip" }; |
539 |
for (int i = 0; i < files.length; i++) { |
540 |
File file = new File(NONSTANDARD_JAR_DIR+files[i]); |
541 |
assertTrue("bad path: " + path, path.contains(file.getCanonicalPath())); |
542 |
} |
543 |
} |
544 |
|
545 |
public void testNonstandardOutjar() { |
546 |
final String OUT_JAR = NONSTANDARD_JAR_DIR + File.pathSeparator + "outputFile"; |
547 |
|
548 |
AjBuildConfig config = genBuildConfig(new String[] { |
549 |
"-outjar", OUT_JAR }, |
550 |
messageWriter); |
551 |
|
552 |
File newJar = new File(OUT_JAR); |
553 |
assertEquals( |
554 |
getCanonicalPath(newJar),config.getOutputJar().getAbsolutePath()); |
555 |
|
556 |
newJar.delete(); |
557 |
} |
558 |
|
559 |
public void testNonstandardOutputDirectorySetting() throws InvalidInputException { |
560 |
String filePath = AjdtAjcTests.TESTDATA_PATH + File.separator + "ajc.jar" + File.separator; |
561 |
File testDir = new File(filePath); |
562 |
AjBuildConfig config = genBuildConfig(new String[] { "-d", filePath }, messageWriter); |
563 |
|
564 |
assertEquals(testDir.getAbsolutePath(), config.getOutputDir().getAbsolutePath()); |
565 |
} |
566 |
|
567 |
private static final String NONSTANDARD_JAR_DIR = AjdtAjcTests.TESTDATA_PATH + "/OutjarTest/folder.jar/"; |
568 |
|
569 |
private AjBuildConfig setupNonstandardPath(String pathType) { |
570 |
String NONSTANDARD_PATH_ENTRY = NONSTANDARD_JAR_DIR+"aspectjJar.file" + File.pathSeparator + NONSTANDARD_JAR_DIR+"aspectJar.file" + File.pathSeparator + NONSTANDARD_JAR_DIR+"jarChild" + File.pathSeparator + NONSTANDARD_JAR_DIR+"parent.zip"; |
571 |
|
572 |
return genBuildConfig(new String[] { |
573 |
pathType, NONSTANDARD_PATH_ENTRY }, |
574 |
messageWriter); |
575 |
} |
510 |
|
576 |
|
511 |
protected void setUp() throws Exception { |
577 |
protected void setUp() throws Exception { |
512 |
super.setUp(); |
578 |
super.setUp(); |