From e5aaa05c071e311f1f0d8298dce268a3b44d32ea Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 2 Dec 2011 02:57:18 +0100 Subject: TestTracer -> JunitTracer --- src/junit/com/jogamp/common/nio/BuffersTest.java | 4 +- .../jogamp/common/nio/CachedBufferFactoryTest.java | 4 +- .../nio/TestBuffersFloatDoubleConversion.java | 4 +- .../jogamp/common/nio/TestPointerBufferEndian.java | 4 +- .../common/nio/TestStructAccessorEndian.java | 4 +- .../com/jogamp/common/util/TestArrayHashSet01.java | 4 +- src/junit/com/jogamp/common/util/TestIOUtil01.java | 4 +- .../jogamp/common/util/TestIteratorIndexCORE.java | 4 +- src/junit/com/jogamp/common/util/TestJarUtil.java | 4 +- .../com/jogamp/common/util/TestPlatform01.java | 4 +- .../com/jogamp/common/util/TestRunnableTask01.java | 4 +- .../com/jogamp/common/util/TestTempJarCache.java | 4 +- .../com/jogamp/common/util/TestVersionInfo.java | 4 +- .../common/util/locks/TestRecursiveLock01.java | 4 +- .../gluegen/test/junit/generation/BaseClass.java | 4 +- src/junit/com/jogamp/junit/util/JunitTracer.java | 76 ++++++++++++++++++++++ src/junit/com/jogamp/junit/util/TestTracer.java | 76 ---------------------- 17 files changed, 106 insertions(+), 106 deletions(-) create mode 100644 src/junit/com/jogamp/junit/util/JunitTracer.java delete mode 100644 src/junit/com/jogamp/junit/util/TestTracer.java (limited to 'src/junit') diff --git a/src/junit/com/jogamp/common/nio/BuffersTest.java b/src/junit/com/jogamp/common/nio/BuffersTest.java index 675f8e1..02c246f 100644 --- a/src/junit/com/jogamp/common/nio/BuffersTest.java +++ b/src/junit/com/jogamp/common/nio/BuffersTest.java @@ -34,14 +34,14 @@ package com.jogamp.common.nio; import java.nio.IntBuffer; import org.junit.Test; -import com.jogamp.junit.util.TestTracer; +import com.jogamp.junit.util.JunitTracer; import static org.junit.Assert.*; /** * @author Michael Bien */ -public class BuffersTest extends TestTracer { +public class BuffersTest extends JunitTracer { @Test public void slice() { diff --git a/src/junit/com/jogamp/common/nio/CachedBufferFactoryTest.java b/src/junit/com/jogamp/common/nio/CachedBufferFactoryTest.java index 4157bdf..326b4cf 100644 --- a/src/junit/com/jogamp/common/nio/CachedBufferFactoryTest.java +++ b/src/junit/com/jogamp/common/nio/CachedBufferFactoryTest.java @@ -42,7 +42,7 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; -import com.jogamp.junit.util.TestTracer; +import com.jogamp.junit.util.JunitTracer; import static java.lang.System.*; import static org.junit.Assert.*; @@ -51,7 +51,7 @@ import static org.junit.Assert.*; * * @author Michael Bien */ -public class CachedBufferFactoryTest extends TestTracer { +public class CachedBufferFactoryTest extends JunitTracer { private final int BUFFERCOUNT = 120; diff --git a/src/junit/com/jogamp/common/nio/TestBuffersFloatDoubleConversion.java b/src/junit/com/jogamp/common/nio/TestBuffersFloatDoubleConversion.java index d62cd69..439ff08 100644 --- a/src/junit/com/jogamp/common/nio/TestBuffersFloatDoubleConversion.java +++ b/src/junit/com/jogamp/common/nio/TestBuffersFloatDoubleConversion.java @@ -33,9 +33,9 @@ import org.junit.Assert; import org.junit.Test; -import com.jogamp.junit.util.TestTracer; +import com.jogamp.junit.util.JunitTracer; -public class TestBuffersFloatDoubleConversion extends TestTracer { +public class TestBuffersFloatDoubleConversion extends JunitTracer { public static boolean cmpFloatArray(float[] d1, int d1_offset, float[] d2, int d2_offset, int len) { if( d1.length - d1_offset < len) { diff --git a/src/junit/com/jogamp/common/nio/TestPointerBufferEndian.java b/src/junit/com/jogamp/common/nio/TestPointerBufferEndian.java index 798457d..c40d1d3 100644 --- a/src/junit/com/jogamp/common/nio/TestPointerBufferEndian.java +++ b/src/junit/com/jogamp/common/nio/TestPointerBufferEndian.java @@ -4,14 +4,14 @@ package com.jogamp.common.nio; import java.io.IOException; import com.jogamp.common.os.*; -import com.jogamp.junit.util.TestTracer; +import com.jogamp.junit.util.JunitTracer; import org.junit.Assert; import org.junit.Test; import static java.lang.System.*; -public class TestPointerBufferEndian extends TestTracer { +public class TestPointerBufferEndian extends JunitTracer { protected void testImpl (boolean direct) { final MachineDescription machine = Platform.getMachineDescription(); diff --git a/src/junit/com/jogamp/common/nio/TestStructAccessorEndian.java b/src/junit/com/jogamp/common/nio/TestStructAccessorEndian.java index 5f13ec9..c1d946e 100644 --- a/src/junit/com/jogamp/common/nio/TestStructAccessorEndian.java +++ b/src/junit/com/jogamp/common/nio/TestStructAccessorEndian.java @@ -2,7 +2,7 @@ package com.jogamp.common.nio; import com.jogamp.common.os.*; import com.jogamp.gluegen.test.junit.generation.Test1p1JavaEmitter; -import com.jogamp.junit.util.TestTracer; +import com.jogamp.junit.util.JunitTracer; import java.io.IOException; import java.nio.*; @@ -12,7 +12,7 @@ import org.junit.Test; import static java.lang.System.*; -public class TestStructAccessorEndian extends TestTracer { +public class TestStructAccessorEndian extends JunitTracer { @Test public void testStructAccessorEndian1 () { diff --git a/src/junit/com/jogamp/common/util/TestArrayHashSet01.java b/src/junit/com/jogamp/common/util/TestArrayHashSet01.java index a41b86c..1e1c281 100644 --- a/src/junit/com/jogamp/common/util/TestArrayHashSet01.java +++ b/src/junit/com/jogamp/common/util/TestArrayHashSet01.java @@ -34,9 +34,9 @@ import java.io.IOException; import org.junit.Assert; import org.junit.Test; -import com.jogamp.junit.util.TestTracer; +import com.jogamp.junit.util.JunitTracer; -public class TestArrayHashSet01 extends TestTracer { +public class TestArrayHashSet01 extends JunitTracer { public static class Dummy { int i1, i2, i3; diff --git a/src/junit/com/jogamp/common/util/TestIOUtil01.java b/src/junit/com/jogamp/common/util/TestIOUtil01.java index 3875acd..cac6cd8 100644 --- a/src/junit/com/jogamp/common/util/TestIOUtil01.java +++ b/src/junit/com/jogamp/common/util/TestIOUtil01.java @@ -46,9 +46,9 @@ import org.junit.Test; import com.jogamp.common.os.MachineDescription; import com.jogamp.common.os.Platform; -import com.jogamp.junit.util.TestTracer; +import com.jogamp.junit.util.JunitTracer; -public class TestIOUtil01 extends TestTracer { +public class TestIOUtil01 extends JunitTracer { static final MachineDescription machine = Platform.getMachineDescription(); static final int tsz = machine.pageSizeInBytes() + machine.pageSizeInBytes() / 2 ; diff --git a/src/junit/com/jogamp/common/util/TestIteratorIndexCORE.java b/src/junit/com/jogamp/common/util/TestIteratorIndexCORE.java index eb3e2ee..cb142a3 100644 --- a/src/junit/com/jogamp/common/util/TestIteratorIndexCORE.java +++ b/src/junit/com/jogamp/common/util/TestIteratorIndexCORE.java @@ -38,9 +38,9 @@ import org.junit.AfterClass; import org.junit.Test; import com.jogamp.common.os.Platform; -import com.jogamp.junit.util.TestTracer; +import com.jogamp.junit.util.JunitTracer; -public class TestIteratorIndexCORE extends TestTracer { +public class TestIteratorIndexCORE extends JunitTracer { static int elems = 10; static int loop = ( Platform.getCPUFamily() == Platform.CPUFamily.ARM ) ? 20 : 9999999; diff --git a/src/junit/com/jogamp/common/util/TestJarUtil.java b/src/junit/com/jogamp/common/util/TestJarUtil.java index 11540d9..caaac9c 100644 --- a/src/junit/com/jogamp/common/util/TestJarUtil.java +++ b/src/junit/com/jogamp/common/util/TestJarUtil.java @@ -46,9 +46,9 @@ import com.jogamp.common.GlueGenVersion; import com.jogamp.common.util.cache.TempCacheReg; import com.jogamp.common.util.cache.TempFileCache; import com.jogamp.common.util.cache.TempJarCache; -import com.jogamp.junit.util.TestTracer; +import com.jogamp.junit.util.JunitTracer; -public class TestJarUtil extends TestTracer { +public class TestJarUtil extends JunitTracer { static TempFileCache fileCache; @BeforeClass diff --git a/src/junit/com/jogamp/common/util/TestPlatform01.java b/src/junit/com/jogamp/common/util/TestPlatform01.java index d26ecf5..8c0fd46 100644 --- a/src/junit/com/jogamp/common/util/TestPlatform01.java +++ b/src/junit/com/jogamp/common/util/TestPlatform01.java @@ -33,9 +33,9 @@ import org.junit.Test; import com.jogamp.common.os.MachineDescription; import com.jogamp.common.os.Platform; -import com.jogamp.junit.util.TestTracer; +import com.jogamp.junit.util.JunitTracer; -public class TestPlatform01 extends TestTracer { +public class TestPlatform01 extends JunitTracer { @Test public void testInfo00() { diff --git a/src/junit/com/jogamp/common/util/TestRunnableTask01.java b/src/junit/com/jogamp/common/util/TestRunnableTask01.java index 8fa776f..272684d 100644 --- a/src/junit/com/jogamp/common/util/TestRunnableTask01.java +++ b/src/junit/com/jogamp/common/util/TestRunnableTask01.java @@ -34,9 +34,9 @@ import java.lang.reflect.InvocationTargetException; import org.junit.Assert; import org.junit.Test; -import com.jogamp.junit.util.TestTracer; +import com.jogamp.junit.util.JunitTracer; -public class TestRunnableTask01 extends TestTracer { +public class TestRunnableTask01 extends JunitTracer { @Test public void testInvokeAndWait00() throws IOException, InterruptedException, InvocationTargetException { diff --git a/src/junit/com/jogamp/common/util/TestTempJarCache.java b/src/junit/com/jogamp/common/util/TestTempJarCache.java index bff66f9..58e44c5 100644 --- a/src/junit/com/jogamp/common/util/TestTempJarCache.java +++ b/src/junit/com/jogamp/common/util/TestTempJarCache.java @@ -47,9 +47,9 @@ import com.jogamp.common.os.Platform; import com.jogamp.common.util.cache.TempCacheReg; import com.jogamp.common.util.cache.TempFileCache; import com.jogamp.common.util.cache.TempJarCache; -import com.jogamp.junit.util.TestTracer; +import com.jogamp.junit.util.JunitTracer; -public class TestTempJarCache extends TestTracer { +public class TestTempJarCache extends JunitTracer { static TempFileCache fileCache; static class TestClassLoader extends URLClassLoader { diff --git a/src/junit/com/jogamp/common/util/TestVersionInfo.java b/src/junit/com/jogamp/common/util/TestVersionInfo.java index 910b478..272ef73 100644 --- a/src/junit/com/jogamp/common/util/TestVersionInfo.java +++ b/src/junit/com/jogamp/common/util/TestVersionInfo.java @@ -29,13 +29,13 @@ package com.jogamp.common.util; import com.jogamp.common.GlueGenVersion; -import com.jogamp.junit.util.TestTracer; +import com.jogamp.junit.util.JunitTracer; import java.io.IOException; import org.junit.Test; -public class TestVersionInfo extends TestTracer { +public class TestVersionInfo extends JunitTracer { @Test public void testInfo01() { diff --git a/src/junit/com/jogamp/common/util/locks/TestRecursiveLock01.java b/src/junit/com/jogamp/common/util/locks/TestRecursiveLock01.java index a224633..3576be7 100644 --- a/src/junit/com/jogamp/common/util/locks/TestRecursiveLock01.java +++ b/src/junit/com/jogamp/common/util/locks/TestRecursiveLock01.java @@ -40,9 +40,9 @@ import org.junit.Assert; import org.junit.Test; import com.jogamp.common.os.Platform; -import com.jogamp.junit.util.TestTracer; +import com.jogamp.junit.util.JunitTracer; -public class TestRecursiveLock01 extends TestTracer { +public class TestRecursiveLock01 extends JunitTracer { public enum YieldMode { NONE(0), YIELD(1), SLEEP(2); diff --git a/src/junit/com/jogamp/gluegen/test/junit/generation/BaseClass.java b/src/junit/com/jogamp/gluegen/test/junit/generation/BaseClass.java index 0bed9f5..4673805 100644 --- a/src/junit/com/jogamp/gluegen/test/junit/generation/BaseClass.java +++ b/src/junit/com/jogamp/gluegen/test/junit/generation/BaseClass.java @@ -32,7 +32,7 @@ import com.jogamp.common.nio.Buffers; import com.jogamp.common.nio.PointerBuffer; import com.jogamp.common.os.MachineDescription; import com.jogamp.common.os.Platform; -import com.jogamp.junit.util.TestTracer; +import com.jogamp.junit.util.JunitTracer; import java.nio.ByteBuffer; import java.nio.ByteOrder; @@ -48,7 +48,7 @@ import org.junit.Assert; * @author Michael Bien * @author Sven Gothel */ -public class BaseClass extends TestTracer { +public class BaseClass extends JunitTracer { /** * Verifies the existence and creation of the generated class. diff --git a/src/junit/com/jogamp/junit/util/JunitTracer.java b/src/junit/com/jogamp/junit/util/JunitTracer.java new file mode 100644 index 0000000..c175601 --- /dev/null +++ b/src/junit/com/jogamp/junit/util/JunitTracer.java @@ -0,0 +1,76 @@ +/** + * Copyright 2011 JogAmp Community. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of JogAmp Community. + */ + +package com.jogamp.junit.util; + +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Rule; +import org.junit.rules.TestName; + + +public abstract class JunitTracer { + @Rule public TestName _unitTestName = new TestName(); + + public final String getTestMethodName() { + return _unitTestName.getMethodName(); + } + + public final String getSimpleTestName() { + return getClass().getSimpleName()+" - "+getTestMethodName(); + } + + public final String getFullTestName() { + return getClass().getName()+" - "+getTestMethodName(); + } + + @BeforeClass + public static void oneTimeSetUp() { + // one-time initialization code + } + + @AfterClass + public static void oneTimeTearDown() { + // one-time cleanup code + System.gc(); // force cleanup + } + + @Before + public void setUp() { + System.err.println("++++ TestCase.setUp: "+getFullTestName()); + } + + @After + public void tearDown() { + System.err.println("++++ TestCase.tearDown: "+getFullTestName()); + } + +} + diff --git a/src/junit/com/jogamp/junit/util/TestTracer.java b/src/junit/com/jogamp/junit/util/TestTracer.java deleted file mode 100644 index c7d3cba..0000000 --- a/src/junit/com/jogamp/junit/util/TestTracer.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * Copyright 2011 JogAmp Community. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of JogAmp Community. - */ - -package com.jogamp.junit.util; - -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Rule; -import org.junit.rules.TestName; - - -public abstract class TestTracer { - @Rule public TestName _unitTestName = new TestName(); - - public final String getTestMethodName() { - return _unitTestName.getMethodName(); - } - - public final String getSimpleTestName() { - return getClass().getSimpleName()+" - "+getTestMethodName(); - } - - public final String getFullTestName() { - return getClass().getName()+" - "+getTestMethodName(); - } - - @BeforeClass - public static void oneTimeSetUp() { - // one-time initialization code - } - - @AfterClass - public static void oneTimeTearDown() { - // one-time cleanup code - System.gc(); // force cleanup - } - - @Before - public void setUp() { - System.err.println("++++ TestCase.setUp: "+getFullTestName()); - } - - @After - public void tearDown() { - System.err.println("++++ TestCase.tearDown: "+getFullTestName()); - } - -} - -- cgit v1.2.3