]> source.dussan.org Git - aspectj.git/commitdiff
Bug 150487 "Tracing and Logging Framework" (test default behaviour under 1.3 & 1.5)
authormwebster <mwebster>
Thu, 27 Jul 2006 09:28:41 +0000 (09:28 +0000)
committermwebster <mwebster>
Thu, 27 Jul 2006 09:28:41 +0000 (09:28 +0000)
tests/src/org/aspectj/systemtest/AllTests.java
tests/src/org/aspectj/systemtest/tracing/TracingTests.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/tracing/tracing.xml [new file with mode: 0644]
tests/tracing/DefaultTracingTest.java [new file with mode: 0644]
tests/tracing/HelloWorld.java [new file with mode: 0644]
tests/tracing/TracingTest.java [new file with mode: 0644]
tests/tracing/ant.xml [new file with mode: 0644]
tests/tracing/logging.properties [new file with mode: 0644]

index da2e7d9e29df175c8f66d3dbb681816ec177bbd2..f22cc1a39f985f7d2ee6da9927baec373534d9cc 100644 (file)
@@ -24,6 +24,7 @@ import org.aspectj.systemtest.inpath.InPathTests;
 import org.aspectj.systemtest.options.OptionsTests;
 import org.aspectj.systemtest.pre10x.AjcPre10xTests;
 import org.aspectj.systemtest.serialVerUID.SUIDTests;
+import org.aspectj.systemtest.tracing.TracingTests;
 import org.aspectj.systemtest.xlint.XLintTests;
 
 /**
@@ -52,6 +53,7 @@ public class AllTests {
                //suite.addTest(PureJavaTests.class);
                suite.addTest(SUIDTests.suite());
                suite.addTest(XLintTests.suite());
+               suite.addTest(TracingTests.suite());
                //$JUnit-END$
 
                return suite;
diff --git a/tests/src/org/aspectj/systemtest/tracing/TracingTests.java b/tests/src/org/aspectj/systemtest/tracing/TracingTests.java
new file mode 100644 (file)
index 0000000..0153d75
--- /dev/null
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * 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:
+ *     Matthew Webster - initial implementation
+ *******************************************************************************/
+package org.aspectj.systemtest.tracing;
+
+import java.io.File;
+
+import junit.framework.Test;
+
+import org.aspectj.testing.XMLBasedAjcTestCase;
+
+public class TracingTests extends org.aspectj.testing.XMLBasedAjcTestCase {
+
+       public static Test suite() {
+               return XMLBasedAjcTestCase.loadSuite(TracingTests.class);
+       }
+
+       protected File getSpecFile() {
+               return new File("../tests/src/org/aspectj/systemtest/tracing/tracing.xml");
+       }
+       
+       public void testTracing () {
+               runTest("Tracing");
+       }
+       
+       public void testDefaultTracing () {
+               runTest("Default tracing");
+       }
+
+}
diff --git a/tests/src/org/aspectj/systemtest/tracing/tracing.xml b/tests/src/org/aspectj/systemtest/tracing/tracing.xml
new file mode 100644 (file)
index 0000000..8528761
--- /dev/null
@@ -0,0 +1,20 @@
+<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]>
+
+<!-- Tracing Tests -->
+<suite>
+
+       <ajc-test dir="tracing" title="Tracing" keywords="tracing">
+        <compile
+               files="TracingTest.java"
+        />
+        <ant file="ant.xml" target="Tracing" verbose="true"/>
+    </ajc-test>
+
+       <ajc-test dir="tracing" title="Default tracing" keywords="tracing">
+        <compile
+               files="DefaultTracingTest.java"
+        />
+        <ant file="ant.xml" target="Default tracing" verbose="true"/>
+    </ajc-test>
+
+</suite>
diff --git a/tests/tracing/DefaultTracingTest.java b/tests/tracing/DefaultTracingTest.java
new file mode 100644 (file)
index 0000000..0b7c754
--- /dev/null
@@ -0,0 +1,15 @@
+import org.aspectj.weaver.tools.*;
+
+public class DefaultTracingTest {
+       
+       public void test () {
+               TraceFactory factory = new DefaultTraceFactory();
+               Trace trace = factory.getTrace(getClass());
+               System.out.println("? DefaultTracingTest.main() trace=" + trace);
+       }
+       
+       public static void main (String[] args) {
+               new DefaultTracingTest().test();
+       }
+       
+}
\ No newline at end of file
diff --git a/tests/tracing/HelloWorld.java b/tests/tracing/HelloWorld.java
new file mode 100644 (file)
index 0000000..8e5a1fd
--- /dev/null
@@ -0,0 +1,7 @@
+public class HelloWorld {
+       
+       public static void main (String[] args) throws Exception {
+               System.out.println("Hello World!");
+       }
+       
+}
\ No newline at end of file
diff --git a/tests/tracing/TracingTest.java b/tests/tracing/TracingTest.java
new file mode 100644 (file)
index 0000000..687dad7
--- /dev/null
@@ -0,0 +1,16 @@
+import org.aspectj.weaver.tools.Trace;
+import org.aspectj.weaver.tools.TraceFactory;
+
+public class TracingTest {
+       
+       public void test () {
+               TraceFactory factory = TraceFactory.getTraceFactory();
+               Trace trace = factory.getTrace(getClass());
+               System.out.println("? TracingTest.main() trace=" + trace);
+       }
+       
+       public static void main (String[] args) {
+               new TracingTest().test();
+       }
+       
+}
\ No newline at end of file
diff --git a/tests/tracing/ant.xml b/tests/tracing/ant.xml
new file mode 100644 (file)
index 0000000..f785294
--- /dev/null
@@ -0,0 +1,27 @@
+<!-- ajc-ant script, not to be used from Ant commant line - see AntSpec -->
+<project name="tracing">
+
+    <!-- using this we can debug the forked VM -->
+    <property
+        name="jdwp"
+        value="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"/>
+
+    <target name="Tracing">
+        <java fork="yes" classname="TracingTest" 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>
+
+    <target name="Default tracing">
+        <java fork="yes" classname="DefaultTracingTest" 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/tracing/logging.properties b/tests/tracing/logging.properties
new file mode 100644 (file)
index 0000000..0519ecb
--- /dev/null
@@ -0,0 +1 @@
\ No newline at end of file