Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 28495 Details for
Bug 113191
Contribution: Command Line Weaver that Can be Packaged with aspectjweaver.jar
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
patch to org.aspectj.ajdt.core to allow an additional test of declare parents using the jar weaver
ajdt.core.test.jarweaver.patch.txt (text/plain), 6.84 KB, created by
Ron Bodkin
on 2005-10-20 01:07:46 EDT
(
hide
)
Description:
patch to org.aspectj.ajdt.core to allow an additional test of declare parents using the jar weaver
Filename:
MIME Type:
Creator:
Ron Bodkin
Created:
2005-10-20 01:07:46 EDT
Size:
6.84 KB
patch
obsolete
>Index: testsrc/org/aspectj/ajdt/internal/compiler/batch/DeclareParents.java >=================================================================== >RCS file: /home/technology/org.aspectj/modules/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/DeclareParents.java,v >retrieving revision 1.3 >diff -u -r1.3 DeclareParents.java >--- testsrc/org/aspectj/ajdt/internal/compiler/batch/DeclareParents.java 29 Apr 2005 20:22:00 -0000 1.3 >+++ testsrc/org/aspectj/ajdt/internal/compiler/batch/DeclareParents.java 20 Oct 2005 05:07:04 -0000 >@@ -332,7 +332,7 @@ > if (result.getErrorMessages().size()!=0) System.err.println("Expecting no errors from jar building but got\n"+result.getErrorMessages()); > assertTrue("Should get no errors for this compile, but got: "+result.getErrorMessages().size(),result.getErrorMessages().size()==0); > // Execute: "ajc -inpath classes -showWeaveInfo -d classes2 -aspectpath aspects.jar" >- result = ajc(testBase,new String[]{"-inpath","classes","-showWeaveInfo","-d","classes2","-aspectpath","aspects.jar"}); >+ result = weave(testBase,new String[]{"-inpath","classes","-showWeaveInfo","-d","classes2","-aspectpath","aspects.jar"}); > > if (!expectErrors) assertTrue("unexpected errors? \n"+result.getErrorMessages(),!result.hasErrorMessages()); > >@@ -415,7 +415,13 @@ > // } > } > >- public String[] mergeOptions(String[] input,String[] extras) { >+ // default to testing with ajc >+ protected CompilationResult weave(File testBase, String[] strings) { >+ return ajc(testBase, strings); >+ } >+ >+ >+ public String[] mergeOptions(String[] input,String[] extras) { > String[] ret = new String[input.length+extras.length]; > System.arraycopy(input,0,ret,0,input.length); > System.arraycopy(extras,0,ret,input.length,extras.length); >@@ -425,7 +431,7 @@ > > > >- private List getWeaveMessages(CompilationResult result) { >+ protected List getWeaveMessages(CompilationResult result) { > List infoMessages = result.getInfoMessages(); > List weaveMessages = new ArrayList(); > for (Iterator iter = infoMessages.iterator(); iter.hasNext();) { >Index: testsrc/org/aspectj/tools/ajc/Ajc.java >=================================================================== >RCS file: /home/technology/org.aspectj/modules/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/Ajc.java,v >retrieving revision 1.21 >diff -u -r1.21 Ajc.java >--- testsrc/org/aspectj/tools/ajc/Ajc.java 29 Sep 2005 15:40:48 -0000 1.21 >+++ testsrc/org/aspectj/tools/ajc/Ajc.java 20 Oct 2005 05:07:04 -0000 >@@ -30,6 +30,7 @@ > import org.aspectj.bridge.IMessage.Kind; > import org.aspectj.bridge.context.CompilationAndWeavingContext; > import org.aspectj.util.FileUtil; >+import org.aspectj.weaver.tools.CmdLineWeaver; > > /** > * The Ajc class is intended for use as part of a unit-test suite, it drives >@@ -76,6 +77,7 @@ > private File sandbox; > private File baseDir; > private Main main; >+ private CmdLineWeaver weaver; > private String[] ajcArgs; > private int incrementalStage = 10; > private boolean shouldEmptySandbox = true; >@@ -194,6 +196,11 @@ > // important to sleep after preparing the sandbox on first incremental stage (see notes in pr90806) > try { Thread.sleep(1000); } catch (Exception e) {} > } >+ if (weaver != null) { >+ weaver.setMessageHander(holder); >+ weaver.run(args); >+ weaver = null; >+ } else > if (isIncremental) { > controller.doIncremental(holder); > } else { >@@ -269,6 +276,13 @@ > if ((dir != null) && !dir.isDirectory()) throw new IllegalArgumentException(dir.getPath() + " is not a directory"); > baseDir = dir; > } >+ >+ /** >+ * Set a jar weaver to be used for the next compile only >+ */ >+ public void setJarWeaverNext(CmdLineWeaver weaver) { >+ this.weaver = weaver; >+ } > > private void addMessagesTo(List aList, IMessage[] messages) { > for (int i = 0; i < messages.length; i++) { >@@ -314,7 +328,7 @@ > * Make every relative file name and dir be absolute under sandbox > * Add TESTER_PATH to classpath > */ >- private String[] adjustToSandbox(String[] args,boolean doCopy) throws IOException { >+ String[] adjustToSandbox(String[] args,boolean doCopy) throws IOException { > String[] newArgs = new String[args.length]; > boolean hasClasspath = false; > boolean hasOutdir = false; >Index: testsrc/org/aspectj/tools/ajc/AjcTestCase.java >=================================================================== >RCS file: /home/technology/org.aspectj/modules/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/AjcTestCase.java,v >retrieving revision 1.23 >diff -u -r1.23 AjcTestCase.java >--- testsrc/org/aspectj/tools/ajc/AjcTestCase.java 14 Oct 2005 07:23:54 -0000 1.23 >+++ testsrc/org/aspectj/tools/ajc/AjcTestCase.java 20 Oct 2005 05:07:05 -0000 >@@ -30,6 +30,8 @@ > import org.aspectj.testing.util.TestUtil; > import org.aspectj.weaver.loadtime.WeavingURLClassLoader; > >+import org.aspectj.weaver.tools.CmdLineWeaver; >+ > import junit.framework.TestCase; > > /** >@@ -519,7 +521,7 @@ > return lastRunResult; > } > public void testNothingForAntJUnit() {} >- >+ > /** > * Run the given class (main method), and return the result in a RunResult. The program runs with > * a classpath containing the sandbox directory, runtime, testing-client, bridge, and >@@ -725,6 +727,13 @@ > } > } > >+ /** >+ * Set a jar weaver to be used for the next compile only >+ */ >+ public void setJarWeaverNext(CmdLineWeaver weaver) { >+ ajc.setJarWeaverNext(weaver); >+ } >+ > /* (non-Javadoc) > * @see junit.framework.TestCase#setUp() > */ >Index: aspects.jar >=================================================================== >RCS file: aspects.jar >diff -N aspects.jar >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ aspects.jar 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,1 @@ >+PKb~I3META-INF/MANIFEST.MFþÊ >Index: testsrc/org/aspectj/ajdt/internal/compiler/batch/DeclareParentsJarWeaver.java >=================================================================== >RCS file: testsrc/org/aspectj/ajdt/internal/compiler/batch/DeclareParentsJarWeaver.java >diff -N testsrc/org/aspectj/ajdt/internal/compiler/batch/DeclareParentsJarWeaver.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ testsrc/org/aspectj/ajdt/internal/compiler/batch/DeclareParentsJarWeaver.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,17 @@ >+package org.aspectj.ajdt.internal.compiler.batch; >+ >+import java.io.File; >+ >+import org.aspectj.tools.ajc.CompilationResult; >+import org.aspectj.weaver.tools.CmdLineWeaver; >+ >+/** run declare parents tests using the jar weaver command line weaver */ >+public class DeclareParentsJarWeaver extends DeclareParents { >+ >+ public CompilationResult weave(File baseDir, String[] args) { >+ ajc.setJarWeaverNext(new CmdLineWeaver()); >+ return super.weave(baseDir, args); >+ } >+ >+ >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 113191
:
28494
| 28495 |
28496