From 10a28c860bd3f4ccecef156c9bbbc88087bf568d Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 31 Aug 2013 16:31:50 +0200 Subject: Bump junit 4.8.2 -> 4.11 (incl. hamcrest 1.2) ; TestTempJarCache uses '@FixMethodOrder(MethodSorters.NAME_ASCENDING)' annotation Issue: Java7 unit test order is no more predictable Fix: junit 4.11 performs a determined (not defined default) test order. Additionally user can force ascending method name test order Produced a drop-in junit.jar / junit-source.zip replacement, which includes - junit version version 4.11 - hamcrest-core version 1.3 --- src/junit/com/jogamp/common/util/TestTempJarCache.java | 4 ++++ src/junit/com/jogamp/junit/util/JunitTracer.java | 3 +++ 2 files changed, 7 insertions(+) (limited to 'src/junit/com/jogamp') diff --git a/src/junit/com/jogamp/common/util/TestTempJarCache.java b/src/junit/com/jogamp/common/util/TestTempJarCache.java index 62a916a..e357a2e 100644 --- a/src/junit/com/jogamp/common/util/TestTempJarCache.java +++ b/src/junit/com/jogamp/common/util/TestTempJarCache.java @@ -29,6 +29,7 @@ package com.jogamp.common.util; import java.io.File; + import java.io.IOException; import java.lang.reflect.Method; import java.net.URI; @@ -40,7 +41,9 @@ import java.util.jar.JarFile; import junit.framework.Assert; import org.junit.BeforeClass; +import org.junit.FixMethodOrder; import org.junit.Test; +import org.junit.runners.MethodSorters; import com.jogamp.common.GlueGenVersion; import com.jogamp.common.jvm.JNILibLoaderBase; @@ -52,6 +55,7 @@ import com.jogamp.common.util.cache.TempFileCache; import com.jogamp.common.util.cache.TempJarCache; import com.jogamp.junit.util.JunitTracer; +@FixMethodOrder(MethodSorters.NAME_ASCENDING) public class TestTempJarCache extends JunitTracer { static TempFileCache fileCache; diff --git a/src/junit/com/jogamp/junit/util/JunitTracer.java b/src/junit/com/jogamp/junit/util/JunitTracer.java index befc2ad..555f27f 100644 --- a/src/junit/com/jogamp/junit/util/JunitTracer.java +++ b/src/junit/com/jogamp/junit/util/JunitTracer.java @@ -33,10 +33,13 @@ import org.junit.Before; import org.junit.BeforeClass; import org.junit.After; import org.junit.AfterClass; +import org.junit.FixMethodOrder; import org.junit.Rule; import org.junit.rules.TestName; +import org.junit.runners.MethodSorters; +@FixMethodOrder(MethodSorters.NAME_ASCENDING) public abstract class JunitTracer { @Rule public TestName _unitTestName = new TestName(); -- cgit v1.2.3