]> source.dussan.org Git - aspectj.git/commitdiff
Bug 159854 "Problem Diagnosis Guide" (tests)
authormwebster <mwebster>
Mon, 30 Oct 2006 17:18:28 +0000 (17:18 +0000)
committermwebster <mwebster>
Mon, 30 Oct 2006 17:18:28 +0000 (17:18 +0000)
tests/ltw/ant.xml
tests/ltw/aop-simple.xml [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java
tests/src/org/aspectj/systemtest/ajc150/ltw/ltw-tests.xml
tests/src/org/aspectj/systemtest/tracing/TracingTests.java
tests/src/org/aspectj/systemtest/tracing/tracing.xml
tests/tracing/ant.xml
tests/tracing/logging.properties
weaver/src/org/aspectj/weaver/tools/TraceFactory.java

index c7f5cc26c08dd8b902ae584d51751e04472657b5..e1cb0a6bde7310d52eae479b1e96475e6fc99130 100644 (file)
     <target name="JDK14 LTW with XML">
         <java fork="yes" classname="HelloWorld" failonerror="yes">
             <classpath refid="aj.path"/>
-<!--           
-            <classpath>
-                <pathelement path="${aj.sandbox}/hello.jar"/>
-            </classpath>
--->            
             <jvmarg value="-Djava.system.class.loader=org.aspectj.weaver.loadtime.WeavingURLClassLoader"/>
                <sysproperty key="aj.class.path" path="${aj.sandbox}/hello.jar:${aj.sandbox}/handler.jar"/>
+<!--           
             <jvmarg value="-Daj.weaving.verbose=true"/>
             <jvmarg value="-Dorg.aspectj.weaver.showWeaveInfo=true"/>
+-->            
             <jvmarg value="-Dorg.aspectj.tracing.debug=true"/>
             <!-- use META-INF/aop.xml style -->
 <!--            <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>-->
     <target name="JDK14 LTW with ASPECTPATH">
         <java fork="yes" classname="HelloWorld" failonerror="yes">
             <classpath refid="aj.path"/>
-               <!--            
-            <classpath>
-                <pathelement path="${aj.sandbox}/hello.jar"/>
-            </classpath>
--->            
             <jvmarg value="-Djava.system.class.loader=org.aspectj.weaver.loadtime.WeavingURLClassLoader"/>
                <sysproperty key="aj.class.path" path="${aj.sandbox}/hello.jar:${aj.sandbox}/handler.jar"/>
                <sysproperty key="aj.aspect.path" path="${aj.sandbox}/handler.jar"/>
+<!--           
             <jvmarg value="-Daj.weaving.verbose=true"/>
             <jvmarg value="-Dorg.aspectj.weaver.showWeaveInfo=true"/>
+-->            
             <jvmarg value="-Dorg.aspectj.tracing.debug=true"/>
             <!-- use META-INF/aop.xml style -->
 <!--            <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>-->
         </java>
     </target>
 
+    <target name="simple LTW">
+        <copy file="${aj.root}/tests/ltw/aop-simple.xml"
+              tofile="${aj.sandbox}/META-INF/aop.xml"/>
+        <java fork="yes" classname="HelloWorld" failonerror="yes">
+            <classpath refid="aj.path"/>
+            <!-- use META-INF/aop.xml style -->
+            <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>
+<!--            <jvmarg line="${jdwp}"/>-->
+        </java>
+    </target>
+
 </project>
diff --git a/tests/ltw/aop-simple.xml b/tests/ltw/aop-simple.xml
new file mode 100644 (file)
index 0000000..89833f4
--- /dev/null
@@ -0,0 +1,4 @@
+<aspectj>
+       <weaver options="-verbose">
+       </weaver>
+</aspectj>
index 31783f6d6eb460c9c184a159c192ce6d3870d069..26759346819eaa28a96ffe0bd25f7bf94f84e90f 100644 (file)
@@ -152,6 +152,11 @@ public class LTWTests extends org.aspectj.testing.XMLBasedAjcTestCase {
                runTest("override default path using -Dorg.aspectj.weaver.loadtime.configuration");
                                
        }
+       
+       public void testSimpleLTW_pr159854 () {
+               runTest("simple LTW");
+                               
+       }
                
        /*
         * Allow system properties to be set and restored
index 919e3bff6b51f637bd9d3bc11fb54c8e09f85e8f..59bb176bde25b1de831eb753fde64b1e0722785b 100644 (file)
         <compile files="ExceptionHandler.aj" options="-outxml -outjar handler.jar"/>
                <ant file="ant.xml" target="JDK14 LTW with XML" verbose="true">
                <stdout>
-               <line text="TraceFactory.instance="/>
                <line text="Hello World!"/>
                </stdout>
+               <stderr>
+               <line text="TraceFactory.instance="/>
+               </stderr>
         </ant>
     </ajc-test>
     
         <compile files="ExceptionHandler.aj" options="-outjar handler.jar"/>
         <ant file="ant.xml" target="JDK14 LTW with ASPECTPATH" verbose="true">
                <stdout>
-               <line text="TraceFactory.instance="/>
                <line text="Hello World!"/>
                </stdout>
+               <stderr>
+               <line text="TraceFactory.instance="/>
+               </stderr>
         </ant>
     </ajc-test>
     
             </stderr>
         </run>
     </ajc-test>       
+
+       <ajc-test dir="ltw" title="simple LTW" keywords="ltw">
+        <compile files="HelloWorld.java"/>
+        <compile files="ExceptionHandler.aj" options="-outxml"/>
+               <ant file="ant.xml" target="simple LTW" verbose="true">
+               <stdout>
+               <line text="Hello World!"/>
+               </stdout>
+        </ant>
+    </ajc-test>
     
     
\ No newline at end of file
index eced86a4f58eb4e98f89109ec71fbccfb0b1d4b2..a0164d3051b1a8d5af97a29724b96bc405871738 100644 (file)
@@ -41,5 +41,9 @@ public class TracingTests extends org.aspectj.testing.XMLBasedAjcTestCase {
        public void testTraceEverything () {
                runTest("Trace everything");
        }
+       
+       public void testJDK14Tracing_pr159854 () {
+               runTest("JDK 1.4 tracing");
+       }
 
 }
index eb5998149938dd0b0e28fa6a830016bd71e275a7..c1a2b9c8a28bb611494da2bf4d37f885eba65ed5 100644 (file)
             </stdout>
         </ant>
     </ajc-test>
+
+       <ajc-test dir="tracing" title="JDK 1.4 tracing" keywords="tracing">
+        <compile
+               files="HelloWorld.java"
+        />
+        <compile files="Aspect.aj" options="-outxml"/>
+               <ant file="ant.xml" target="JDK 1.4 tracing" verbose="true">
+               <stdout>
+                <line text="Hello World!"/>
+            </stdout>
+        </ant>
+    </ajc-test>
 </suite>
index 064eecda052df281970dbbb3e77e36d6e2e0bd07..8e7ddad1831cbd599af4c7d75218b7276346bcbe 100644 (file)
         </java>
     </target>
 
+    <target name="JDK 1.4 tracing">
+        <copy file="${aj.root}/tests/tracing//logging.properties"
+              tofile="${aj.sandbox}/META-INF/logging.properties"/>
+        <java fork="yes" classname="HelloWorld" failonerror="yes">
+            <classpath refid="aj.path"/>
+            <jvmarg value="-Dorg.aspectj.tracing.debug=true"/>
+            <jvmarg value="-Djava.util.logging.config.file=logging.properties"/>
+            <!-- use META-INF/aop.xml style -->
+            <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>
+<!--            <jvmarg line="${jdwp}"/>-->
+        </java>
+    </target>
+
 </project>
index 0519ecba6ea913e21689ec692e81e9e4973fbf73..54421d045b044c6031ef3a03e67a71de77c9bfc4 100644 (file)
@@ -1 +1,58 @@
\ No newline at end of file
+############################################################
+#      Default Logging Configuration File
+#
+# You can use a different file by specifying a filename
+# with the java.util.logging.config.file system property.  
+# For example java -Djava.util.logging.config.file=myfile
+############################################################
+
+############################################################
+#      Global properties
+############################################################
+
+# "handlers" specifies a comma separated list of log Handler 
+# classes.  These handlers will be installed during VM startup.
+# Note that these classes must be on the system classpath.
+# By default we only configure a ConsoleHandler, which will only
+# show messages at the INFO and above levels.
+#handlers= java.util.logging.ConsoleHandler
+
+# To also add the FileHandler, use the following line instead.
+#handlers= java.util.logging.FileHandler, java.util.logging.ConsoleHandler
+handlers= java.util.logging.FileHandler
+
+# Default global logging level.
+# This specifies which kinds of events are logged across
+# all loggers.  For any given facility this global level
+# can be overriden by a facility specific level
+# Note that the ConsoleHandler also has a separate level
+# setting to limit messages printed to the console.
+.level= INFO
+
+############################################################
+# Handler specific properties.
+# Describes specific configuration info for Handlers.
+############################################################
+
+# default file output is in user's home directory.
+java.util.logging.FileHandler.pattern = %h/java%u.log
+#java.util.logging.FileHandler.limit = 50000
+java.util.logging.FileHandler.count = 1
+#java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter
+java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter
+java.util.logging.FileHandler.level = FINER
+
+# Limit the message that are printed on the console to INFO and above.
+java.util.logging.ConsoleHandler.level = FINER
+java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
+
+
+############################################################
+# Facility specific properties.
+# Provides extra control for each logger.
+############################################################
+
+# For example, set the com.xyz.foo logger to only log SEVERE
+# messages:
+#com.xyz.foo.level = SEVERE
+org.aspectj.weaver.loadtime.level = FINER
index dedceeadbc33a9a16897b60a10536baedd18d0a2..41c6b9f57ea20c431411a421bb96e4f1b8ffd60b 100644 (file)
@@ -77,7 +77,7 @@ public abstract class TraceFactory {
            instance = new DefaultTraceFactory();
        }
        
-       if (debug) System.out.println("TraceFactory.instance=" + instance);
+       if (debug) System.err.println("TraceFactory.instance=" + instance);
     }
 
 }