From 9783d6431916dfe07b00581c9ff62aa5d53fc414 Mon Sep 17 00:00:00 2001 From: mwebster Date: Thu, 27 Jul 2006 09:28:41 +0000 Subject: [PATCH] Bug 150487 "Tracing and Logging Framework" (test default behaviour under 1.3 & 1.5) --- .../src/org/aspectj/systemtest/AllTests.java | 2 + .../systemtest/tracing/TracingTests.java | 37 +++++++++++++++++++ .../aspectj/systemtest/tracing/tracing.xml | 20 ++++++++++ tests/tracing/DefaultTracingTest.java | 15 ++++++++ tests/tracing/HelloWorld.java | 7 ++++ tests/tracing/TracingTest.java | 16 ++++++++ tests/tracing/ant.xml | 27 ++++++++++++++ tests/tracing/logging.properties | 1 + 8 files changed, 125 insertions(+) create mode 100644 tests/src/org/aspectj/systemtest/tracing/TracingTests.java create mode 100644 tests/src/org/aspectj/systemtest/tracing/tracing.xml create mode 100644 tests/tracing/DefaultTracingTest.java create mode 100644 tests/tracing/HelloWorld.java create mode 100644 tests/tracing/TracingTest.java create mode 100644 tests/tracing/ant.xml create mode 100644 tests/tracing/logging.properties 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 @@ + + + + + + + + + + + + + + + + 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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + 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 -- 2.39.5