diff options
author | aclement <aclement> | 2004-08-19 16:38:16 +0000 |
---|---|---|
committer | aclement <aclement> | 2004-08-19 16:38:16 +0000 |
commit | dbe1024f852c600d2752e5f39eb31ca4f5d72de9 (patch) | |
tree | 0742f9f6c0d18241cc1406af4e05f858e3897def /org.aspectj.ajdt.core/testsrc | |
parent | b7db7da4c67aa4e93eba8b36daa3ff3d50b12194 (diff) | |
download | aspectj-dbe1024f852c600d2752e5f39eb31ca4f5d72de9.tar.gz aspectj-dbe1024f852c600d2752e5f39eb31ca4f5d72de9.zip |
Fix and testcase for Bugzilla Bug 49657
Weaver results in rt error if affected base class not exposed
Diffstat (limited to 'org.aspectj.ajdt.core/testsrc')
2 files changed, 55 insertions, 0 deletions
diff --git a/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/AjdtBatchTests.java b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/AjdtBatchTests.java index 5f9d266a9..5dcc167df 100644 --- a/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/AjdtBatchTests.java +++ b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/AjdtBatchTests.java @@ -30,6 +30,7 @@ public class AjdtBatchTests extends TestCase { suite.addTestSuite(ImageTestCase.class); suite.addTestSuite(MultipleCompileTestCase.class); suite.addTestSuite(JavadocTest.class); + suite.addTestSuite(PartiallyExposedHierarchyTestCase.class); // XXX suite.addTestSuite(VerifyWeaveTestCase.class); //suite.addTestSuite(WorkingCommandTestCase.class); //$JUnit-END$ diff --git a/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/PartiallyExposedHierarchyTestCase.java b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/PartiallyExposedHierarchyTestCase.java new file mode 100644 index 000000000..de45e9ea5 --- /dev/null +++ b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/PartiallyExposedHierarchyTestCase.java @@ -0,0 +1,54 @@ +/******************************************************************************* + * Copyright (c) 2004 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v10.html + * + * Contributors: + * Matthew Webster - initial implementation + *******************************************************************************/ +package org.aspectj.ajdt.internal.compiler.batch; + +import java.io.File; + +import org.aspectj.tools.ajc.AjcTestCase; +import org.aspectj.tools.ajc.CompilationResult; + +/** + * If you need to rebuild the components for this test, I'm afraid you will have + * to run build.cmd in the testdata/partialHierarchy directory which calls ajc and + * does some jar manipulation. + */ +public class PartiallyExposedHierarchyTestCase extends AjcTestCase { + + public static final String PROJECT_DIR = "partialHierarchy"; + + private File baseDir; + + protected void setUp() throws Exception { + super.setUp(); + baseDir = new File("../org.aspectj.ajdt.core/testdata",PROJECT_DIR); + } + + /** + * This test verifies that AspectJ behaves correctly when parts of an object + * hierarchy are exposed to it for weaving. See pr49657 for all the details. + */ + public void testPartiallyExposedHierarchy () { + Message warning = new Message(11,"no interface constructor-execution join point"); + //TODO This line number will change to 15 (from 5) when type mungers remember where they came from! + Message error = new Message(5, "type sample.Base must be accessible for weaving interface inter type declaration from aspect sample.Trace"); + CompilationResult result = ajc(baseDir, + new String[]{"-classpath","fullBase.jar", + "-injars","base.jar", + "sample"+File.separator+"Trace.aj"}); +// System.err.println(result.getWarningMessages()); +// System.err.println(result.getErrorMessages()); +// System.err.println(result.getStandardOutput()); + MessageSpec spec = new MessageSpec(null,newMessageList(warning),newMessageList(error)); + assertMessages(result,spec); + } + + +} |