changeset 7700:48a6e8fd6bfd

test cleanups. Remove harmful type witnesses.
author mduigou
date Tue, 19 Mar 2013 17:32:45 -0700
parents 2dc2457241a5
children d0369c9b3721
files test/Makefile test/java/util/function/FunctionsTest.java test/java/util/function/PredicatesTest.java
diffstat 3 files changed, 20 insertions(+), 100 deletions(-) [+]
line wrap: on
line diff
--- a/test/Makefile	Tue Mar 19 17:13:49 2013 -0700
+++ b/test/Makefile	Tue Mar 19 17:32:45 2013 -0700
@@ -601,7 +601,7 @@
 # Stable agentvm testruns (minus items from PROBLEM_LIST)
 jdk_lambda: $(call TestDirs, java/lang/invoke/lambda java/util/function java/util/Optional java/util/stream ) \
         java/util/Map/LambdaTest.java \
-        test/java/nio/Files/FilesLambdaTest.java
+        java/nio/Files/FilesLambdaTest.java
 	$(call RunAgentvmBatch)
 	(cd ../test-ng && \
 		JAVA_HOME=$(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)") \
@@ -831,88 +831,6 @@
 PHONY_LIST += vmsqe_jdwp vmsqe_jdi vmsqe_jdb vmsqe_quick-jdi vmsqe_sajdi \
               vmsqe_jvmti vmsqe_hprof vmsqe_monitoring vmsqe_tests
 
-################################################################
-
-# jck tests
-
-# Default is to use jck 7 from /java/re
-JCK7_DEFAULT_HOME = $(SLASH_JAVA)/re/jck/7/promoted/latest/binaries
-
-# Expect JPRT to set JPRT_JCK7COMPILER_HOME.
-JCK7COMPILER_HOME = $(JCK7_DEFAULT_HOME)/JCK-compiler-7
-ifdef JPRT_JCK7COMPILER_HOME
-  JCK7COMPILER_HOME = $(JPRT_JCK7COMPILER_HOME)/JCK-compiler-7
-endif
-
-# Expect JPRT to set JPRT_JCK7RUNTIME_HOME.
-JCK7RUNTIME_HOME = $(JCK7_DEFAULT_HOME)/JCK-runtime-7
-ifdef JPRT_JCK7RUNTIME_HOME
-  JCK7RUNTIME_HOME = $(JPRT_JCK7RUNTIME_HOME)/JCK-runtime-7
-endif
-
-# Expect JPRT to set JPRT_JCK7DEVTOOLS_HOME.
-JCK7DEVTOOLS_HOME = $(JCK7_DEFAULT_HOME)/JCK-devtools-7
-ifdef JPRT_JCK7DEVTOOLS_HOME
-  JCK7DEVTOOLS_HOME = $(JPRT_JCK7DEVTOOLS_HOME)/JCK-devtools-7
-endif
-
-# The jtjck.jar utility to use to run the tests
-JTJCK_JAR = $(JCK_HOME)/lib/jtjck.jar
-JTJCK_JAVA_ARGS =  -XX:MaxPermSize=256m -Xmx512m
-JTJCK_OPTIONS = -headless -v
-
-# Default tests to run
-ifndef JCK_COMPILER_TESTS
-  JCK_COMPILER_TESTS =
-endif
-ifndef JCK_RUNTIME_TESTS
-  JCK_RUNTIME_TESTS  =
-endif
-ifndef JCK_DEVTOOLS_TESTS
-  JCK_DEVTOOLS_TESTS =
-endif
-
-# Generic rule used to run jck tests
-_generic_jck_tests: prep $(PRODUCT_HOME) $(EXCLUDELIST)
-	@$(EXPAND) $(EXCLUDELIST) \
-            | $(CUT) -d' ' -f1 \
-            | $(SED) -e 's@^@Excluding: @'
-	( $(CD) $(ABS_TEST_OUTPUT_DIR) &&          			   \
-	  $(PRODUCT_HOME)/bin/java $(JTJCK_JAVA_ARGS) 			   \
-	    -jar "$(JTJCK_JAR)" 					   \
-	    $(JTJCK_OPTIONS) 						   \
-            -r:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTreport  \
-            -w:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTwork    \
-            -jdk:$(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)")                \
-	    $(TESTDIRS) 						   \
-        ) ; $(BUNDLE_UP_AND_EXIT)
-
-# JCK7 compiler tests
-jck7compiler:
-	$(MAKE) UNIQUE_DIR=$@ \
-	        JCK_HOME=$(JCK7COMPILER_HOME) \
-	        TESTDIRS="$(JCK_COMPILER_TESTS)" \
-                _generic_jck_tests
-
-# JCK7 runtime tests
-jck7runtime:
-	$(MAKE) UNIQUE_DIR=$@ \
-	        JCK_HOME=$(JCK7RUNTIME_HOME) \
-	        TESTDIRS="$(JCK_RUNTIME_TESTS)" \
-                _generic_jck_tests
-
-# JCK7 devtools tests
-jck7devtools:
-	$(MAKE) UNIQUE_DIR=$@ \
-	        JCK_HOME=$(JCK7DEVTOOLS_HOME) \
-                TESTDIRS="$(JCK_DEVTOOLS_TESTS)" \
-                _generic_jck_tests
-
-# Run all 3 sets of JCK7 tests
-jck_all: jck7runtime jck7devtools jck7compiler
-
-PHONY_LIST += jck_all _generic_jck_tests \
-	      jck7compiler jck7runtime jck7devtools
 
 ################################################################
 
--- a/test/java/util/function/FunctionsTest.java	Tue Mar 19 17:13:49 2013 -0700
+++ b/test/java/util/function/FunctionsTest.java	Tue Mar 19 17:32:45 2013 -0700
@@ -22,7 +22,7 @@
  */
 
 /*
- * @test
+ * @test Basic test for Functions functional utils
  * @run testng FunctionsTest
  */
 
@@ -96,7 +96,7 @@
 
     @Test
     public void testForPredicate() {
-        Function<Integer, String> mapper = Functions.<Integer, String>forPredicate(x -> x != 0, "true", "false");
+        Function<Integer, String> mapper = Functions.forPredicate(x -> x != 0, "true", "false");
 
         assertEquals("false", mapper.apply(0));
         assertEquals("true", mapper.apply(1));
@@ -108,7 +108,7 @@
         truths.put(0, "sky");
         truths.put(1, "ice");
 
-        Function<Integer, String> mapper = Functions.<String, Integer>forMap(truths);
+        Function<Integer, String> mapper = Functions.forMap(truths);
 
         assertEquals("sky", mapper.apply(0));
         assertEquals("ice", mapper.apply(1));
@@ -121,7 +121,7 @@
         truths.put(0, "sky");
         truths.put(1, "ice");
 
-        Function<Integer, String> mapper = Functions.<Integer, String>forMap(truths, "fire");
+        Function<Integer, String> mapper = Functions.forMap(truths, "fire");
 
         assertEquals("sky", mapper.apply(0));
         assertEquals("ice", mapper.apply(1));
@@ -131,8 +131,8 @@
 
     @Test
     public void testChain() {
-        Function<Integer, Boolean> first = Functions.<Integer, Boolean>forPredicate(x -> x != 0, true, false);
-        Function<Boolean, String> second = Functions.<Boolean, String>forPredicate(x -> !x, "false", "true");
+        Function<Integer, Boolean> first = Functions.forPredicate(x -> x != 0, true, false);
+        Function<Boolean, String> second = Functions.forPredicate(x -> !x, "false", "true");
         Function<Integer, String> mapper = Functions.chain(first, second);
         Function<Integer, Integer> f1 = x -> x * 2;
         Function<Integer, Integer> f2 = x -> x * 3;
@@ -146,10 +146,10 @@
 
     @Test
     public void testSubstitute() {
-        Function<Integer, Integer> ints = Functions.<Integer>substitute(3, 999);
-        Function<String, String> strings = Functions.<String>substitute("hello", "bonjour");
-        Function<String, String> stringNullIn = Functions.<String>substitute(null, "default");
-        Function<String, String> stringNullOut = Functions.<String>substitute("default", null);
+        Function<Integer, Integer> ints = Functions.substitute(3, 999);
+        Function<String, String> strings = Functions.substitute("hello", "bonjour");
+        Function<String, String> stringNullIn = Functions.substitute(null, "default");
+        Function<String, String> stringNullOut = Functions.substitute("default", null);
 
         assertEquals(1, (int) ints.apply(1));
         assertEquals(999, (int) ints.apply(3));
@@ -197,9 +197,12 @@
 
     void THROWS(Class<? extends Throwable> k, Fun... fs) {
         for (Fun f : fs)
-            try { f.f(); fail("Expected " + k.getName() + " not thrown"); }
-            catch (Throwable t) {
+            try {
+                f.f();
+                fail("Expected " + k.getName() + " not thrown");
+            } catch (Throwable t) {
                 if (!k.isAssignableFrom(t.getClass()))
-                    throw new UndeclaredThrowableException(t);}
+                    throw new UndeclaredThrowableException(t);
+            }
     }
 }
--- a/test/java/util/function/PredicatesTest.java	Tue Mar 19 17:13:49 2013 -0700
+++ b/test/java/util/function/PredicatesTest.java	Tue Mar 19 17:32:45 2013 -0700
@@ -22,11 +22,11 @@
  */
 
 /*
- * @test
- * @run testng FunctionsTest
+ * @tests Basic test for Predicates functional utils
+ * @author  Mike Duigou
+ * @run testng PredicatesTest
  */
 
-
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashSet;
@@ -43,7 +43,6 @@
 
 /*
  * Basic test for Predicates functional utils
- * @author  Mike Duigou
  */
 public class PredicatesTest {