diff options
Diffstat (limited to 'ajde/testsrc')
8 files changed, 93 insertions, 93 deletions
diff --git a/ajde/testsrc/org/aspectj/ajde/AsmDeclarationsTest.java b/ajde/testsrc/org/aspectj/ajde/AsmDeclarationsTest.java index e637a29e8..d5902854b 100644 --- a/ajde/testsrc/org/aspectj/ajde/AsmDeclarationsTest.java +++ b/ajde/testsrc/org/aspectj/ajde/AsmDeclarationsTest.java @@ -10,11 +10,11 @@ package org.aspectj.ajde; -import java.util.Iterator; +//import java.util.Iterator; -import org.aspectj.ajdt.internal.core.builder.AsmElementFormatter; +//import org.aspectj.ajdt.internal.core.builder.AsmElementFormatter; import org.aspectj.asm.*; -import org.aspectj.asm.IProgramElement.Kind; +//import org.aspectj.asm.IProgramElement.Kind; // TODO: add tests for java kinds, expand coverage @@ -22,7 +22,7 @@ public class AsmDeclarationsTest extends AjdeTestCase { private IHierarchy model = null; private static final String CONFIG_FILE_PATH = "../examples/coverage/coverage.lst"; - private static final int DEC_MESSAGE_LENGTH = AsmElementFormatter.MAX_MESSAGE_LENGTH; +// private static final int DEC_MESSAGE_LENGTH = AsmElementFormatter.MAX_MESSAGE_LENGTH; public AsmDeclarationsTest(String name) { super(name); diff --git a/ajde/testsrc/org/aspectj/ajde/AsmRelationshipsTest.java b/ajde/testsrc/org/aspectj/ajde/AsmRelationshipsTest.java index f4b41a846..3f16c6264 100644 --- a/ajde/testsrc/org/aspectj/ajde/AsmRelationshipsTest.java +++ b/ajde/testsrc/org/aspectj/ajde/AsmRelationshipsTest.java @@ -120,9 +120,9 @@ public class AsmRelationshipsTest extends AjdeTestCase { IProgramElement clazz = AsmManager.getDefault().getHierarchy().findElementForType(null, toType); assertNotNull(clazz); - String set = to; +// String set = to; IRelationship rel2 = manager.getRelationshipMap().get(clazz, IRelationship.Kind.DECLARE_INTER_TYPE, backRelName); - String handle2 = (String)rel2.getTargets().get(0); +// String handle2 = (String)rel2.getTargets().get(0); for (Iterator it = rel2.getTargets().iterator(); it.hasNext(); ) { String currHandle = (String)it.next(); if (manager.getHierarchy().findElementForHandle(currHandle).toLabelString().equals(from)) return; diff --git a/ajde/testsrc/org/aspectj/ajde/BuildConfigurationTests.java b/ajde/testsrc/org/aspectj/ajde/BuildConfigurationTests.java index f08fe199b..1223b865d 100644 --- a/ajde/testsrc/org/aspectj/ajde/BuildConfigurationTests.java +++ b/ajde/testsrc/org/aspectj/ajde/BuildConfigurationTests.java @@ -349,7 +349,7 @@ public class BuildConfigurationTests extends AjdeTestCase { buildOptions.setNoImportError( true ); buildConfig = compilerAdapter.genBuildConfig( configFile ); assertTrue(configFile + " failed", null != buildConfig); - Map options = buildConfig.getJavaOptions(); +// Map options = buildConfig.getJavaOptions(); // String noImport = (String) options.get( CompilerOptions.OPTION_ReportInvalidImport ); // assertEquals( "no import", CompilerOptions.WARNING, noImport ); // buildOptions.setNoImportError( false ); @@ -508,7 +508,7 @@ public class BuildConfigurationTests extends AjdeTestCase { }; try { - String s = null; +// String s = null; Ajde.init( null, null, diff --git a/ajde/testsrc/org/aspectj/ajde/CompilerMessagesTest.java b/ajde/testsrc/org/aspectj/ajde/CompilerMessagesTest.java index 836a2eaae..6181efa18 100644 --- a/ajde/testsrc/org/aspectj/ajde/CompilerMessagesTest.java +++ b/ajde/testsrc/org/aspectj/ajde/CompilerMessagesTest.java @@ -15,7 +15,7 @@ package org.aspectj.ajde; import java.io.IOException; import java.util.List; -import org.aspectj.bridge.*; +//import org.aspectj.bridge.*; import org.aspectj.bridge.IMessage; /** diff --git a/ajde/testsrc/org/aspectj/ajde/InpathTestcase.java b/ajde/testsrc/org/aspectj/ajde/InpathTestcase.java index 9ec9f2cf2..36d4b2a09 100644 --- a/ajde/testsrc/org/aspectj/ajde/InpathTestcase.java +++ b/ajde/testsrc/org/aspectj/ajde/InpathTestcase.java @@ -344,7 +344,7 @@ public class InpathTestcase extends AjdeTestCase { String outdirName, Set expectedOutdirContents) { - byte[] inManifest = null; +// byte[] inManifest = null; File binBase = openFile(outdirName); String[] toResources = FileUtil.listFiles(binBase); @@ -364,13 +364,13 @@ public class InpathTestcase extends AjdeTestCase { /** * @param resources */ - private void dumpResources(HashSet resources) { - System.err.println("Dump: " + resources.size() + " resources"); - for (Iterator iter = resources.iterator(); iter.hasNext();) { - Object element = (Object) iter.next(); - System.err.println(" Resource: " + element); - } - } +// private void dumpResources(HashSet resources) { +// System.err.println("Dump: " + resources.size() + " resources"); +// for (Iterator iter = resources.iterator(); iter.hasNext();) { +// Object element = (Object) iter.next(); +// System.err.println(" Resource: " + element); +// } +// } private void listSourceResources(String indirName, Set resources) { File srcBase = openFile(indirName); @@ -387,46 +387,46 @@ public class InpathTestcase extends AjdeTestCase { } } - private byte[] listDirResources(File directory, Set resources) { - return listDirResources( - directory.getAbsolutePath(), - directory, - resources); - } - - private byte[] listDirResources( - String prefix, - File directory, - Set resources) { - byte[] manifest = null; - - File[] resourceFiles = directory.listFiles(new FileFilter() { - public boolean accept(File arg0) { - boolean accept = - !arg0.getName().endsWith(".class") && !arg0.isDirectory(); - return accept; - } - }); - for (int i = 0; i < resourceFiles.length; i++) { - File f = resourceFiles[i]; - String name = f.getAbsolutePath(); - if (f.getAbsolutePath().startsWith(prefix)) - name = name.substring(prefix.length()); - name = name.replace('\\', '/'); - - resources.add(resourceFiles[i]); - } - File[] subdirs = directory.listFiles(new FileFilter() { - public boolean accept(File arg0) { - return arg0.isDirectory(); - } - }); - for (int i = 0; i < subdirs.length; i++) { - listDirResources(prefix, subdirs[i], resources); - } - - return manifest; - } +// private byte[] listDirResources(File directory, Set resources) { +// return listDirResources( +// directory.getAbsolutePath(), +// directory, +// resources); +// } + +// private byte[] listDirResources( +// String prefix, +// File directory, +// Set resources) { +// byte[] manifest = null; +// +// File[] resourceFiles = directory.listFiles(new FileFilter() { +// public boolean accept(File arg0) { +// boolean accept = +// !arg0.getName().endsWith(".class") && !arg0.isDirectory(); +// return accept; +// } +// }); +// for (int i = 0; i < resourceFiles.length; i++) { +// File f = resourceFiles[i]; +// String name = f.getAbsolutePath(); +// if (f.getAbsolutePath().startsWith(prefix)) +// name = name.substring(prefix.length()); +// name = name.replace('\\', '/'); +// +// resources.add(resourceFiles[i]); +// } +// File[] subdirs = directory.listFiles(new FileFilter() { +// public boolean accept(File arg0) { +// return arg0.isDirectory(); +// } +// }); +// for (int i = 0; i < subdirs.length; i++) { +// listDirResources(prefix, subdirs[i], resources); +// } +// +// return manifest; +// } public static final FileFilter aspectjResourceFileFilter = new FileFilter() { diff --git a/ajde/testsrc/org/aspectj/ajde/TestBuildListener.java b/ajde/testsrc/org/aspectj/ajde/TestBuildListener.java index c53feed45..64fc6228e 100644 --- a/ajde/testsrc/org/aspectj/ajde/TestBuildListener.java +++ b/ajde/testsrc/org/aspectj/ajde/TestBuildListener.java @@ -26,7 +26,7 @@ public class TestBuildListener implements BuildListener { public void compileStarted(String buildConfigFile) { } public void compileFinished(String buildConfigFile, int buildTime, boolean succeeded, boolean warnings) { - int timeInSeconds = buildTime/1000; +// int timeInSeconds = buildTime/1000; buildSucceeded = succeeded; buildFinished = true; } diff --git a/ajde/testsrc/org/aspectj/ajde/internal/LstBuildConfigManagerTest.java b/ajde/testsrc/org/aspectj/ajde/internal/LstBuildConfigManagerTest.java index 3d1a04cf3..8e67517d8 100644 --- a/ajde/testsrc/org/aspectj/ajde/internal/LstBuildConfigManagerTest.java +++ b/ajde/testsrc/org/aspectj/ajde/internal/LstBuildConfigManagerTest.java @@ -21,14 +21,14 @@ import junit.framework.TestSuite; import org.aspectj.ajde.*; import org.aspectj.ajde.NullIdeTaskListManager.SourceLineTask; import org.aspectj.ajde.ui.BuildConfigModel; -import org.aspectj.ajde.ui.internal.AjcBuildOptions; -import org.aspectj.bridge.Message; +//import org.aspectj.ajde.ui.internal.AjcBuildOptions; +//import org.aspectj.bridge.Message; public class LstBuildConfigManagerTest extends AjdeTestCase { - private AjcBuildOptions buildOptions = null; +// private AjcBuildOptions buildOptions = null; private BuildConfigManager buildConfigManager = new LstBuildConfigManager(); - private LstBuildConfigFileUpdater fileUpdater = new LstBuildConfigFileUpdater(); +// private LstBuildConfigFileUpdater fileUpdater = new LstBuildConfigFileUpdater(); public LstBuildConfigManagerTest(String name) { super(name); @@ -76,35 +76,35 @@ public class LstBuildConfigManagerTest extends AjdeTestCase { public void testFileRelativePathSameDir() throws IOException { File file = openFile("file-relPath-sameDir.lst"); - BuildConfigModel model = buildConfigManager.buildModel(file.getCanonicalPath()); + buildConfigManager.buildModel(file.getCanonicalPath()); assertTrue("single file", true); } - private void verifyFile(String configFile, String fileContents) { - StringTokenizer st = new StringTokenizer(fileContents, ";"); - BuildConfigModel model1 = buildConfigManager.buildModel(configFile); - File testFile = new File(configFile + "-test.lst"); - model1.setSourceFile(testFile.getPath()); - buildConfigManager.writeModel(model1); - List newList = fileUpdater.readConfigFile(testFile.getPath()); - testFile.delete(); - - assertTrue("contents: " + newList, verifyLists(st, newList)); - } - - private boolean verifyLists(StringTokenizer st, List list) { - Iterator it = list.iterator(); - while (st.hasMoreElements()) { - String s1 = (String)st.nextElement(); - String s2 = (String)it.next(); - if (!s1.equals(s2)) return false; - } - if (it.hasNext()) { - return false; - } else { - return true; - } - } +// private void verifyFile(String configFile, String fileContents) { +// StringTokenizer st = new StringTokenizer(fileContents, ";"); +// BuildConfigModel model1 = buildConfigManager.buildModel(configFile); +// File testFile = new File(configFile + "-test.lst"); +// model1.setSourceFile(testFile.getPath()); +// buildConfigManager.writeModel(model1); +// List newList = fileUpdater.readConfigFile(testFile.getPath()); +// testFile.delete(); +// +// assertTrue("contents: " + newList, verifyLists(st, newList)); +// } +// +// private boolean verifyLists(StringTokenizer st, List list) { +// Iterator it = list.iterator(); +// while (st.hasMoreElements()) { +// String s1 = (String)st.nextElement(); +// String s2 = (String)it.next(); +// if (!s1.equals(s2)) return false; +// } +// if (it.hasNext()) { +// return false; +// } else { +// return true; +// } +// } protected void setUp() throws Exception { super.setUp("LstBuildConfigManagerTest"); @@ -114,9 +114,9 @@ public class LstBuildConfigManagerTest extends AjdeTestCase { super.tearDown(); } - private static final String WILDCARDS_FILE = "C:/Dev/aspectj/tests/ajde/examples/figures-coverage/test-config.lst"; - private static final String BAD_PATHS_FILE = "C:/Dev/aspectj/tests/ajde/examples/figures-coverage/test-error.lst"; - private static final String INCLUDES_FILE = "C:/Dev/aspectj/tests/ajde/examples/spacewar/spacewar/demo.lst"; +// private static final String WILDCARDS_FILE = "C:/Dev/aspectj/tests/ajde/examples/figures-coverage/test-config.lst"; +// private static final String BAD_PATHS_FILE = "C:/Dev/aspectj/tests/ajde/examples/figures-coverage/test-error.lst"; +// private static final String INCLUDES_FILE = "C:/Dev/aspectj/tests/ajde/examples/spacewar/spacewar/demo.lst"; private static final String WILDCARDS_FILE_CONTENTS; private static final String BAD_PATHS_FILE_CONTENTS; diff --git a/ajde/testsrc/org/aspectj/ajde/ui/StructureSearchManagerTest.java b/ajde/testsrc/org/aspectj/ajde/ui/StructureSearchManagerTest.java index 70763dfd5..417a14b7f 100644 --- a/ajde/testsrc/org/aspectj/ajde/ui/StructureSearchManagerTest.java +++ b/ajde/testsrc/org/aspectj/ajde/ui/StructureSearchManagerTest.java @@ -43,7 +43,7 @@ public class StructureSearchManagerTest extends AjdeTestCase { } public void testFindPatternMatch() { - List matches = Ajde.getDefault().getStructureSearchManager().findMatches( + Ajde.getDefault().getStructureSearchManager().findMatches( "Point", null ); @@ -51,7 +51,7 @@ public class StructureSearchManagerTest extends AjdeTestCase { } public void testFindPatternAndKindMatch() { - List matches = Ajde.getDefault().getStructureSearchManager().findMatches( + Ajde.getDefault().getStructureSearchManager().findMatches( "Point", IProgramElement.Kind.CONSTRUCTOR ); |