summaryrefslogtreecommitdiffstats
path: root/ajde
diff options
context:
space:
mode:
authorwisberg <wisberg>2003-04-30 02:40:17 +0000
committerwisberg <wisberg>2003-04-30 02:40:17 +0000
commitb0b9b68419808ef90dc6b31d051e6d859f3651c1 (patch)
treed68ed904651ac711032399f20651076d7829b997 /ajde
parente13844f01833186f4c0967d282664e744c4a2a33 (diff)
downloadaspectj-b0b9b68419808ef90dc6b31d051e6d859f3651c1.tar.gz
aspectj-b0b9b68419808ef90dc6b31d051e6d859f3651c1.zip
mainly changed setup to avoid reading any existing user properties, which was causing build configuration tests to fail now that all options are significant
Diffstat (limited to 'ajde')
-rw-r--r--ajde/testsrc/org/aspectj/ajde/BuildConfigurationTests.java58
1 files changed, 30 insertions, 28 deletions
diff --git a/ajde/testsrc/org/aspectj/ajde/BuildConfigurationTests.java b/ajde/testsrc/org/aspectj/ajde/BuildConfigurationTests.java
index 4c00ebf2a..c797b0489 100644
--- a/ajde/testsrc/org/aspectj/ajde/BuildConfigurationTests.java
+++ b/ajde/testsrc/org/aspectj/ajde/BuildConfigurationTests.java
@@ -23,6 +23,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
+import junit.framework.AssertionFailedError;
import junit.framework.TestSuite;
/**
@@ -432,7 +433,7 @@ public class BuildConfigurationTests extends AjdeTestCase {
public void testAspectPath() {
Set aspects = new HashSet();
projectProperties.setAspectPath( aspects );
- buildConfig = compilerAdapter.genBuildConfig( configFile );
+ buildConfig = compilerAdapter.genBuildConfig( configFile );
List aPath = buildConfig.getAspectpath();
assertTrue( "no aspect path", aPath.isEmpty() );
@@ -440,7 +441,7 @@ public class BuildConfigurationTests extends AjdeTestCase {
aspects.add( f );
buildConfig = compilerAdapter.genBuildConfig( configFile );
List aPath2 = buildConfig.getAspectpath();
- assertTrue( "one jar in path", aPath2.size() == 1 );
+ assertEquals("aspectpath", 1, aPath2.size());
assertTrue( "1 aspectpath", aPath2.contains(f) );
@@ -457,43 +458,44 @@ public class BuildConfigurationTests extends AjdeTestCase {
String outJar = "mybuild.jar";
projectProperties.setOutJar( outJar );
buildConfig = compilerAdapter.genBuildConfig( configFile );
- assertEquals( "out jar", outJar, buildConfig.getOutputJar().toString() );
+ assertNotNull("output jar", buildConfig.getOutputJar());
+ assertEquals( "out jar", outJar, buildConfig.getOutputJar().toString() );
}
protected void setUp() throws Exception {
- preferencesAdapter = new UserPreferencesStore();
+ preferencesAdapter = new UserPreferencesStore(false);
buildOptions = new AjcBuildOptions(preferencesAdapter);
compilerAdapter = new CompilerAdapter();
projectProperties = new NullIdeProperties( "" );
- init();
+
+ try {
+ String s = null;
+ Ajde.init(
+ null,
+ null,
+ null,
+ projectProperties,
+ buildOptions,
+ null,
+ null,
+ null);
+
+ //Ajde.getDefault().enableLogging( System.out );
+ } catch (Throwable t) {
+ AssertionFailedError e = new AssertionFailedError();
+ e.initCause(t);
+ throw e;
+ }
}
- protected void tearDown() throws Exception {
+ protected void tearDown() throws Exception {
super.tearDown();
- buildOptions.setCharacterEncoding("");
+ preferencesAdapter = null;
+ buildOptions = null;
+ compilerAdapter = null;
+ projectProperties = null;
}
- public void init() {
- try {
- Ajde.init(
- null,
- null,
- null,
- projectProperties,
- buildOptions,
- null,
- null,
- null);
-
- //Ajde.getDefault().enableLogging( System.out );
- } catch (Throwable t) {
- t.printStackTrace();
- Ajde.getDefault().getErrorHandler().handleError(
- "Ajde failed to initialize.",
- t);
- }
- }
-
private void assertOptionEquals( String reason, Map options, String optionName, String value) {
String mapValue = (String) options.get(optionName);
assertEquals( reason, value, mapValue );