aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authormwebster <mwebster>2006-07-27 09:28:41 +0000
committermwebster <mwebster>2006-07-27 09:28:41 +0000
commit9783d6431916dfe07b00581c9ff62aa5d53fc414 (patch)
treebc41503399d77c621ff09df2854e42b5a32ecaba /tests
parent54f7bb4f25792e717eadf21421c81ae1dc8e0718 (diff)
downloadaspectj-9783d6431916dfe07b00581c9ff62aa5d53fc414.tar.gz
aspectj-9783d6431916dfe07b00581c9ff62aa5d53fc414.zip
Bug 150487 "Tracing and Logging Framework" (test default behaviour under 1.3 & 1.5)
Diffstat (limited to 'tests')
-rw-r--r--tests/src/org/aspectj/systemtest/AllTests.java2
-rw-r--r--tests/src/org/aspectj/systemtest/tracing/TracingTests.java37
-rw-r--r--tests/src/org/aspectj/systemtest/tracing/tracing.xml20
-rw-r--r--tests/tracing/DefaultTracingTest.java15
-rw-r--r--tests/tracing/HelloWorld.java7
-rw-r--r--tests/tracing/TracingTest.java16
-rw-r--r--tests/tracing/ant.xml27
-rw-r--r--tests/tracing/logging.properties1
8 files changed, 125 insertions, 0 deletions
diff --git a/tests/src/org/aspectj/systemtest/AllTests.java b/tests/src/org/aspectj/systemtest/AllTests.java
index da2e7d9e2..f22cc1a39 100644
--- a/tests/src/org/aspectj/systemtest/AllTests.java
+++ b/tests/src/org/aspectj/systemtest/AllTests.java
@@ -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
index 000000000..0153d757d
--- /dev/null
+++ b/tests/src/org/aspectj/systemtest/tracing/TracingTests.java
@@ -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
index 000000000..8528761ca
--- /dev/null
+++ b/tests/src/org/aspectj/systemtest/tracing/tracing.xml
@@ -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
index 000000000..0b7c754be
--- /dev/null
+++ b/tests/tracing/DefaultTracingTest.java
@@ -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
index 000000000..8e5a1fdd7
--- /dev/null
+++ b/tests/tracing/HelloWorld.java
@@ -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
index 000000000..687dad7ef
--- /dev/null
+++ b/tests/tracing/TracingTest.java
@@ -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
index 000000000..f7852949e
--- /dev/null
+++ b/tests/tracing/ant.xml
@@ -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
index 000000000..0519ecba6
--- /dev/null
+++ b/tests/tracing/logging.properties
@@ -0,0 +1 @@
+ \ No newline at end of file