changeset 4956:686d810cb9b6

8009217: REGRESSION: test com/sun/org/apache/xml/internal/security/transforms/ClassLoaderTest.java fails to compile since 7u21b03 Reviewed-by: xuelei
author mullan
date Mon, 29 Apr 2013 10:20:55 -0400
parents 80fba79ca568
children 81f7897e8144
files test/com/sun/org/apache/xml/internal/security/transforms/ClassLoaderTest.java test/com/sun/org/apache/xml/internal/security/transforms/MyTransform.java
diffstat 2 files changed, 9 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/test/com/sun/org/apache/xml/internal/security/transforms/ClassLoaderTest.java	Wed Jun 26 22:20:19 2013 -0500
+++ b/test/com/sun/org/apache/xml/internal/security/transforms/ClassLoaderTest.java	Mon Apr 29 10:20:55 2013 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
 /**
  * @test
  * @author Sean Mullan
- * @bug 6461674
+ * @bug 6461674 8009217
  * @compile -XDignore.symbol.file ClassLoaderTest.java MyTransform.java
  * @run main ClassLoaderTest
  * @summary Ensure Transform.register works with transform implementations
@@ -43,13 +43,12 @@
 
     public static void main(String[] args) throws Exception {
 
-        Transform.init();
         File file = new File(BASE);
         URL[] urls = new URL[1];
         urls[0] = file.toURI().toURL();
         URLClassLoader ucl = new URLClassLoader(urls);
-        Class c = ucl.loadClass("MyTransform");
-        Constructor cons = c.getConstructor();
+        Class<?> c = ucl.loadClass("MyTransform");
+        Constructor<?> cons = c.getConstructor(new Class[] {});
         Object o = cons.newInstance();
         // Apache code swallows the ClassNotFoundExc, so we need to
         // check if the Transform has already been registered by registering
--- a/test/com/sun/org/apache/xml/internal/security/transforms/MyTransform.java	Wed Jun 26 22:20:19 2013 -0500
+++ b/test/com/sun/org/apache/xml/internal/security/transforms/MyTransform.java	Mon Apr 29 10:20:55 2013 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,13 +21,8 @@
  * questions.
  */
 
-import java.io.IOException;
-import javax.xml.parsers.ParserConfigurationException;
-import org.xml.sax.SAXException;
-import com.sun.org.apache.xml.internal.security.c14n.*;
-import com.sun.org.apache.xml.internal.security.exceptions.*;
-import com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput;
-import com.sun.org.apache.xml.internal.security.transforms.*;
+import com.sun.org.apache.xml.internal.security.transforms.Transform;
+import com.sun.org.apache.xml.internal.security.transforms.TransformSpi;
 
 public class MyTransform extends TransformSpi {
 
@@ -37,21 +32,13 @@
     public MyTransform() {
         try {
             System.out.println("Registering Transform");
-            Transform.init();
             Transform.register(URI, "MyTransform");
-        } catch (AlgorithmAlreadyRegisteredException e) {
-            // should not occur, so ignore
+        } catch (Exception e) {
+            e.printStackTrace();
         }
     }
 
     protected String engineGetURI() {
         return URI;
     }
-
-    protected XMLSignatureInput enginePerformTransform(XMLSignatureInput input)
-        throws IOException, CanonicalizationException,
-               InvalidCanonicalizerException, TransformationException,
-               ParserConfigurationException, SAXException {
-        throw new TransformationException("Unsupported Operation");
-    }
 }