changeset 7642:e344f9213d0c

Suppress test that was failing with SOE under serialization mangling
author briangoetz
date Thu, 14 Mar 2013 11:05:33 -0400
parents 76a06a20617f
children 36ec39aecf66
files test-ng/bootlib/java/util/stream/SpliteratorTestHelper.java test-ng/boottests/java/util/stream/DoubleNodeTest.java test-ng/tests/org/openjdk/tests/java/lang/invoke/GenBadMHTest.java test-ng/tests/org/openjdk/tests/java/lang/invoke/SerializedLambdaTest.java
diffstat 4 files changed, 26 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/test-ng/bootlib/java/util/stream/SpliteratorTestHelper.java	Thu Mar 14 15:29:30 2013 +0100
+++ b/test-ng/bootlib/java/util/stream/SpliteratorTestHelper.java	Thu Mar 14 11:05:33 2013 -0400
@@ -110,7 +110,7 @@
             public void accept(double value) {
                 b.accept(value);
             }
-        };
+        }
 
         UnaryOperator<Consumer<Double>> boxingAdapter = b -> new BoxingAdapter(b);
 
--- a/test-ng/boottests/java/util/stream/DoubleNodeTest.java	Thu Mar 14 15:29:30 2013 +0100
+++ b/test-ng/boottests/java/util/stream/DoubleNodeTest.java	Thu Mar 14 11:05:33 2013 -0400
@@ -24,12 +24,19 @@
  */
 package java.util.stream;
 
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 import java.util.PrimitiveIterator;
+import java.util.Spliterator;
 import java.util.Spliterators;
 import java.util.function.Function;
+import java.util.function.Supplier;
 
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
@@ -157,7 +164,8 @@
         exerciseTerminalOps(data, s -> s.toArray());
     }
 
-    @Test(dataProvider = "nodes")
+    @Test(dataProvider = "nodes", groups={ "serialization-hostile" })
+    // throws SOE on serialization of DoubleConcNode[size=1000]
     public void testSpliterator(double[] array, Node.OfDouble n) {
         SpliteratorTestHelper.testDoubleSpliterator(n::spliterator);
     }
--- a/test-ng/tests/org/openjdk/tests/java/lang/invoke/GenBadMHTest.java	Thu Mar 14 15:29:30 2013 +0100
+++ b/test-ng/tests/org/openjdk/tests/java/lang/invoke/GenBadMHTest.java	Thu Mar 14 11:05:33 2013 -0400
@@ -55,7 +55,7 @@
  *
  * @author Brian Goetz
  */
-@Test
+@Test(groups = { "serialization-hostile" })
 public class GenBadMHTest {
     public void testMHForStringToUpper() throws IOException, ReflectiveOperationException {
         ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS | ClassWriter.COMPUTE_FRAMES);
--- a/test-ng/tests/org/openjdk/tests/java/lang/invoke/SerializedLambdaTest.java	Thu Mar 14 15:29:30 2013 +0100
+++ b/test-ng/tests/org/openjdk/tests/java/lang/invoke/SerializedLambdaTest.java	Thu Mar 14 11:05:33 2013 -0400
@@ -27,8 +27,12 @@
 import org.testng.annotations.Test;
 
 import java.io.*;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicLong;
 import java.util.function.BiPredicate;
 import java.util.function.Consumer;
+import java.util.function.LongConsumer;
 import java.util.function.Predicate;
 import java.util.function.Supplier;
 
@@ -264,4 +268,15 @@
         };
         assertSerial(ctor, b);
     }
+
+    //Test throwing away return type
+    public void testDiscardReturnBound() throws IOException, ClassNotFoundException {
+        List<String> list = new ArrayList<>();
+        Consumer<String> c = list::add;
+        assertSerial(c, cc -> { assertTrue(cc instanceof Consumer); });
+
+        AtomicLong a = new AtomicLong();
+        LongConsumer lc = a::addAndGet;
+        assertSerial(lc, plc -> { plc.accept(3); });
+    }
 }