1 /*******************************************************************************
2 * Copyright (c) 2004 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * Matthew Webster - initial implementation
10 *******************************************************************************/
11 package org.aspectj.ajdt.internal.compiler.batch;
15 import org.aspectj.tools.ajc.AjcTestCase;
16 import org.aspectj.tools.ajc.CompilationResult;
19 * If you need to rebuild the components for this test, I'm afraid you will have
20 * to run build.cmd in the testdata/partialHierarchy directory which calls ajc and
21 * does some jar manipulation.
23 public class PartiallyExposedHierarchyTestCase extends AjcTestCase {
25 public static final String PROJECT_DIR = "partialHierarchy";
29 protected void setUp() throws Exception {
31 baseDir = new File("../org.aspectj.ajdt.core/testdata",PROJECT_DIR);
35 * This test verifies that AspectJ behaves correctly when parts of an object
36 * hierarchy are exposed to it for weaving. See pr49657 for all the details.
38 public void testPartiallyExposedHierarchy () {
39 Message warning = new Message(11,"no interface constructor-execution join point");
40 //TODO This line number will change to 15 (from 5) when type mungers remember where they came from!
41 Message error = new Message(5, "type sample.Base must be accessible for weaving interface inter type declaration from aspect sample.Trace");
42 CompilationResult result = ajc(baseDir,
43 new String[]{"-classpath","fullBase.jar",
45 "sample"+File.separator+"Trace.aj"});
46 // System.err.println(result.getWarningMessages());
47 // System.err.println(result.getErrorMessages());
48 // System.err.println(result.getStandardOutput());
49 MessageSpec spec = new MessageSpec(null,newMessageList(warning),newMessageList(error));
50 assertMessages(result,spec);