From eb31ec6c3d7016f7b57210f61c27daa54118c263 Mon Sep 17 00:00:00 2001 From: mwebster Date: Sun, 30 Jul 2006 18:20:50 +0000 Subject: Bug 113948 "Repackage AspectJ" (move module root suites out of default package) --- runtime/testsrc/RuntimeModuleTests.java | 87 ---------------------- .../org/aspectj/runtime/RuntimeModuleTests.java | 86 +++++++++++++++++++++ 2 files changed, 86 insertions(+), 87 deletions(-) delete mode 100644 runtime/testsrc/RuntimeModuleTests.java create mode 100644 runtime/testsrc/org/aspectj/runtime/RuntimeModuleTests.java (limited to 'runtime') diff --git a/runtime/testsrc/RuntimeModuleTests.java b/runtime/testsrc/RuntimeModuleTests.java deleted file mode 100644 index 53ccf091d..000000000 --- a/runtime/testsrc/RuntimeModuleTests.java +++ /dev/null @@ -1,87 +0,0 @@ -/* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, - * 2002 Palo Alto Research Center, Incorporated (PARC). - * 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: - * Xerox/PARC initial implementation - * ******************************************************************/ - -// default package - -import java.io.*; - -import org.aspectj.lang.*; -import org.aspectj.runtime.reflect.JoinPointImplTest; -import org.aspectj.runtime.reflect.RuntimePerformanceTest; -import org.aspectj.runtime.reflect.SignatureTest; - -import junit.framework.*; - -public class RuntimeModuleTests extends TestCase { - - public static TestSuite suite() { - TestSuite suite = new TestSuite(RuntimeModuleTests.class.getName()); - suite.addTestSuite(RuntimeModuleTests.class); // minimum 1 test (testNothing) - suite.addTestSuite(SignatureTest.class); - suite.addTestSuite(JoinPointImplTest.class); - suite.addTestSuite(RuntimePerformanceTest.class); - return suite; - } - - public RuntimeModuleTests(String name) { super(name); } - - public void testNoAspectBoundException() { - RuntimeException fun = new RuntimeException("fun"); - NoAspectBoundException nab = new NoAspectBoundException("Foo", fun); - assertEquals(fun,nab.getCause()); - } - - public void testSoftExceptionPrintStackTrace() { - // let's see -// Throwable t = new Error("xyz"); -// new SoftException(t).printStackTrace(); - - // save to specified PrintStream - ByteArrayOutputStream sink = new ByteArrayOutputStream(); - PrintStream out = new PrintStream(sink); - new SoftException(new Error("xyz")).printStackTrace(out); - String s = new String(sink.toByteArray()); - out.flush(); - checkSoftExceptionString(s); - - // save to specified PrintWriter - sink = new ByteArrayOutputStream(); - PrintWriter pout = new PrintWriter(sink); - new SoftException(new Error("xyz")).printStackTrace(pout); - pout.flush(); - s = new String(sink.toByteArray()); - checkSoftExceptionString(s); - - // check System.err redirect - PrintStream systemErr = System.err; - try { - sink = new ByteArrayOutputStream(); - out = new PrintStream(sink); - System.setErr(out); - new SoftException(new Error("xyz")).printStackTrace(); - out.flush(); - s = new String(sink.toByteArray()); - checkSoftExceptionString(s); - } finally { - System.setErr(systemErr); - } - } - - - static void checkSoftExceptionString(String s) { - assertTrue(-1 != s.indexOf("SoftException")); - assertTrue(-1 != s.indexOf("Caused by: java.lang.Error")); - assertTrue(-1 != s.indexOf("xyz")); - assertTrue(-1 != s.indexOf("testSoftExceptionPrintStackTrace")); - } -} diff --git a/runtime/testsrc/org/aspectj/runtime/RuntimeModuleTests.java b/runtime/testsrc/org/aspectj/runtime/RuntimeModuleTests.java new file mode 100644 index 000000000..c9bfe88b9 --- /dev/null +++ b/runtime/testsrc/org/aspectj/runtime/RuntimeModuleTests.java @@ -0,0 +1,86 @@ +package org.aspectj.runtime; +/* ******************************************************************* + * Copyright (c) 1999-2001 Xerox Corporation, + * 2002 Palo Alto Research Center, Incorporated (PARC). + * 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: + * Xerox/PARC initial implementation + * ******************************************************************/ + +import java.io.*; + +import org.aspectj.lang.*; +import org.aspectj.runtime.reflect.JoinPointImplTest; +import org.aspectj.runtime.reflect.RuntimePerformanceTest; +import org.aspectj.runtime.reflect.SignatureTest; + +import junit.framework.*; + +public class RuntimeModuleTests extends TestCase { + + public static TestSuite suite() { + TestSuite suite = new TestSuite(RuntimeModuleTests.class.getName()); + suite.addTestSuite(RuntimeModuleTests.class); // minimum 1 test (testNothing) + suite.addTestSuite(SignatureTest.class); + suite.addTestSuite(JoinPointImplTest.class); + suite.addTestSuite(RuntimePerformanceTest.class); + return suite; + } + + public RuntimeModuleTests(String name) { super(name); } + + public void testNoAspectBoundException() { + RuntimeException fun = new RuntimeException("fun"); + NoAspectBoundException nab = new NoAspectBoundException("Foo", fun); + assertEquals(fun,nab.getCause()); + } + + public void testSoftExceptionPrintStackTrace() { + // let's see +// Throwable t = new Error("xyz"); +// new SoftException(t).printStackTrace(); + + // save to specified PrintStream + ByteArrayOutputStream sink = new ByteArrayOutputStream(); + PrintStream out = new PrintStream(sink); + new SoftException(new Error("xyz")).printStackTrace(out); + String s = new String(sink.toByteArray()); + out.flush(); + checkSoftExceptionString(s); + + // save to specified PrintWriter + sink = new ByteArrayOutputStream(); + PrintWriter pout = new PrintWriter(sink); + new SoftException(new Error("xyz")).printStackTrace(pout); + pout.flush(); + s = new String(sink.toByteArray()); + checkSoftExceptionString(s); + + // check System.err redirect + PrintStream systemErr = System.err; + try { + sink = new ByteArrayOutputStream(); + out = new PrintStream(sink); + System.setErr(out); + new SoftException(new Error("xyz")).printStackTrace(); + out.flush(); + s = new String(sink.toByteArray()); + checkSoftExceptionString(s); + } finally { + System.setErr(systemErr); + } + } + + + static void checkSoftExceptionString(String s) { + assertTrue(-1 != s.indexOf("SoftException")); + assertTrue(-1 != s.indexOf("Caused by: java.lang.Error")); + assertTrue(-1 != s.indexOf("xyz")); + assertTrue(-1 != s.indexOf("testSoftExceptionPrintStackTrace")); + } +} -- cgit v1.2.3