From a635a5de4c4b729cc33701f1d82c5c018c2259de Mon Sep 17 00:00:00 2001 From: acolyer Date: Tue, 8 Jun 2004 15:18:12 +0000 Subject: [PATCH] update tests for new options processing --- .../aspectj/ajde/BuildConfigurationTests.java | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/ajde/testsrc/org/aspectj/ajde/BuildConfigurationTests.java b/ajde/testsrc/org/aspectj/ajde/BuildConfigurationTests.java index 1223b865d..61e96f396 100644 --- a/ajde/testsrc/org/aspectj/ajde/BuildConfigurationTests.java +++ b/ajde/testsrc/org/aspectj/ajde/BuildConfigurationTests.java @@ -62,19 +62,19 @@ public class BuildConfigurationTests extends AjdeTestCase { // The tests... public void testCharacterEncoding() { - buildOptions.setCharacterEncoding( "12345" ); + buildOptions.setCharacterEncoding( "UTF-8" ); buildConfig = compilerAdapter.genBuildConfig( configFile ); assertTrue(configFile + " failed", null != buildConfig); - Map options = buildConfig.getJavaOptions(); + Map options = buildConfig.getOptions().getMap(); String encoding = (String) options.get( CompilerOptions.OPTION_Encoding ); - assertEquals( "character encoding", "12345", encoding ); + assertEquals( "character encoding", "UTF-8", encoding ); } public void testComplianceLevel() { buildOptions.setComplianceLevel( BuildOptionsAdapter.VERSION_14 ); buildConfig = compilerAdapter.genBuildConfig( configFile ); assertTrue(configFile + " failed", null != buildConfig); - Map options = buildConfig.getJavaOptions(); + Map options = buildConfig.getOptions().getMap(); String compliance = (String) options.get(CompilerOptions.OPTION_Compliance); String sourceLevel = (String) options.get(CompilerOptions.OPTION_Source); assertEquals( "compliance level", CompilerOptions.VERSION_1_4, compliance); @@ -86,7 +86,7 @@ public class BuildConfigurationTests extends AjdeTestCase { buildOptions.setSourceCompatibilityLevel( BuildOptionsAdapter.VERSION_14); buildConfig = compilerAdapter.genBuildConfig( configFile ); assertTrue(configFile + " failed", null != buildConfig); - Map options = buildConfig.getJavaOptions(); + Map options = buildConfig.getOptions().getMap(); String compliance = (String) options.get(CompilerOptions.OPTION_Compliance); String sourceLevel = (String) options.get(CompilerOptions.OPTION_Source); assertEquals( "compliance level", CompilerOptions.VERSION_1_3, compliance); @@ -99,7 +99,7 @@ public class BuildConfigurationTests extends AjdeTestCase { buildOptions.setSourceCompatibilityLevel( BuildOptionsAdapter.VERSION_13); buildConfig = compilerAdapter.genBuildConfig( configFile ); assertTrue(configFile + " failed", null != buildConfig); - Map options = buildConfig.getJavaOptions(); + Map options = buildConfig.getOptions().getMap(); String compliance = (String) options.get(CompilerOptions.OPTION_Compliance); String sourceLevel = (String) options.get(CompilerOptions.OPTION_Source); assertEquals( "compliance level", CompilerOptions.VERSION_1_4, compliance); @@ -111,7 +111,7 @@ public class BuildConfigurationTests extends AjdeTestCase { buildOptions.setWarnings( null ); buildConfig = compilerAdapter.genBuildConfig( configFile ); assertTrue(configFile + " failed", null != buildConfig); - Map options = buildConfig.getJavaOptions(); + Map options = buildConfig.getOptions().getMap(); // this should leave us with the default warnings assertOptionEquals( "report overriding package default", @@ -149,7 +149,7 @@ public class BuildConfigurationTests extends AjdeTestCase { assertOptionEquals( "report assert identifer", options, CompilerOptions.OPTION_ReportAssertIdentifier, - CompilerOptions.IGNORE); + CompilerOptions.WARNING); } // public void testEmptyWarnings() { @@ -213,7 +213,7 @@ public class BuildConfigurationTests extends AjdeTestCase { buildOptions.setWarnings( warnings ); buildConfig = compilerAdapter.genBuildConfig( configFile ); assertTrue(configFile + " failed", null != buildConfig); - Map options = buildConfig.getJavaOptions(); + Map options = buildConfig.getOptions().getMap(); // this should leave us with all the user specifiable warnings // turned on @@ -259,7 +259,7 @@ public class BuildConfigurationTests extends AjdeTestCase { buildOptions.setDebugLevel( null ); buildConfig = compilerAdapter.genBuildConfig( configFile ); assertTrue(configFile + " failed", null != buildConfig); - Map options = buildConfig.getJavaOptions(); + Map options = buildConfig.getOptions().getMap(); // this should leave us with the default debug settings assertOptionEquals( "debug source", @@ -280,9 +280,9 @@ public class BuildConfigurationTests extends AjdeTestCase { buildOptions.setDebugLevel( new HashSet() ); buildConfig = compilerAdapter.genBuildConfig( configFile ); assertTrue(configFile + " failed", null != buildConfig); - Map options = buildConfig.getJavaOptions(); + Map options = buildConfig.getOptions().getMap(); - // this should leave us with the debug on + // this should leave us with the default debug assertOptionEquals( "debug source", options, CompilerOptions.OPTION_SourceFileAttribute, @@ -303,7 +303,7 @@ public class BuildConfigurationTests extends AjdeTestCase { buildOptions.setDebugLevel( debugOpts ); buildConfig = compilerAdapter.genBuildConfig( configFile ); assertTrue(configFile + " failed", null != buildConfig); - Map options = buildConfig.getJavaOptions(); + Map options = buildConfig.getOptions().getMap(); // this should leave us with all debug on assertOptionEquals( "debug source", @@ -328,7 +328,7 @@ public class BuildConfigurationTests extends AjdeTestCase { buildOptions.setDebugLevel( debugOpts ); buildConfig = compilerAdapter.genBuildConfig( configFile ); assertTrue(configFile + " failed", null != buildConfig); - Map options = buildConfig.getJavaOptions(); + Map options = buildConfig.getOptions().getMap(); // this should leave us with all debug on assertOptionEquals( "debug source", @@ -359,7 +359,7 @@ public class BuildConfigurationTests extends AjdeTestCase { buildOptions.setPreserveAllLocals( true ); buildConfig = compilerAdapter.genBuildConfig( configFile ); assertTrue(configFile + " failed", null != buildConfig); - Map options = buildConfig.getJavaOptions(); + Map options = buildConfig.getOptions().getMap(); String preserve = (String) options.get( CompilerOptions.OPTION_PreserveUnusedLocal ); assertEquals( "preserve unused", CompilerOptions.PRESERVE, preserve ); } -- 2.39.5