diff options
author | aclement <aclement> | 2007-01-11 11:29:46 +0000 |
---|---|---|
committer | aclement <aclement> | 2007-01-11 11:29:46 +0000 |
commit | 18d0d458a36ef2760495723b0dd90c285b8f03fe (patch) | |
tree | 30e32de811a5e7a3b1d42381386214fc61585853 /testing/testsrc | |
parent | 0396229c372cb2f0354fd40b2b0563b2f7f657f7 (diff) | |
download | aspectj-18d0d458a36ef2760495723b0dd90c285b8f03fe.tar.gz aspectj-18d0d458a36ef2760495723b0dd90c285b8f03fe.zip |
patches from 148190 #22
Diffstat (limited to 'testing/testsrc')
-rw-r--r-- | testing/testsrc/org/aspectj/testing/util/StructureModelUtilTest.java | 77 | ||||
-rw-r--r-- | testing/testsrc/org/aspectj/testing/util/UtilTests.java | 1 |
2 files changed, 78 insertions, 0 deletions
diff --git a/testing/testsrc/org/aspectj/testing/util/StructureModelUtilTest.java b/testing/testsrc/org/aspectj/testing/util/StructureModelUtilTest.java new file mode 100644 index 000000000..a4491aab7 --- /dev/null +++ b/testing/testsrc/org/aspectj/testing/util/StructureModelUtilTest.java @@ -0,0 +1,77 @@ +/* ******************************************************************* + * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC). + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Xerox/PARC initial implementation + * ******************************************************************/ + + +package org.aspectj.testing.util; + +import java.util.*; + +import junit.framework.TestSuite; + +import org.aspectj.ajde.AjdeTestCase; +import org.aspectj.asm.IProgramElement; + +/** + * @author Mik Kersten + */ +public class StructureModelUtilTest extends AjdeTestCase { + + // TODO-path + private final String CONFIG_FILE_PATH = "../examples/figures-coverage/all.lst"; + + public StructureModelUtilTest(String name) { + super(name); + } + + public static void main(String[] args) { + junit.swingui.TestRunner.run(StructureModelUtilTest.class); + } + + public static TestSuite suite() { + TestSuite result = new TestSuite(); + result.addTestSuite(StructureModelUtilTest.class); + return result; + } + + public void testPackageViewUtil() { + List packages = StructureModelUtil.getPackagesInModel(); + assertTrue("packages list not null", packages != null); + assertTrue("packages list not empty", !packages.isEmpty()); + + IProgramElement packageNode = (IProgramElement)((Object[])packages.get(0))[0]; + assertTrue("package node not null", packageNode != null); + + List files = StructureModelUtil.getFilesInPackage(packageNode); + assertTrue("fle list not null", files != null); + + // TODO: re-enable +// Map lineAdviceMap = StructureModelUtil.getLinesToAspectMap( +// ((IProgramElement)files.get(0)).getSourceLocation().getSourceFile().getAbsolutePath() +// ); +// +// assertTrue("line->advice map not null", lineAdviceMap != null); +// +// Set aspects = StructureModelUtil.getAspectsAffectingPackage(packageNode); +// assertTrue("aspect list not null", aspects != null); + } + + + protected void setUp() throws Exception { + super.setUp("StructureModelUtilTest"); + doSynchronousBuild(CONFIG_FILE_PATH); + } + + protected void tearDown() throws Exception { + super.tearDown(); + } +} + diff --git a/testing/testsrc/org/aspectj/testing/util/UtilTests.java b/testing/testsrc/org/aspectj/testing/util/UtilTests.java index 01fbae4db..f5583725d 100644 --- a/testing/testsrc/org/aspectj/testing/util/UtilTests.java +++ b/testing/testsrc/org/aspectj/testing/util/UtilTests.java @@ -29,6 +29,7 @@ public class UtilTests extends TestCase { suite.addTestSuite(LangUtilTest.class); suite.addTestSuite(MessageUtilTest.class); suite.addTestSuite(StreamGrabberTest.class); + suite.addTestSuite(StructureModelUtilTest.class); //$JUnit-END$ return suite; } |