You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by di...@apache.org on 2004/07/11 23:48:30 UTC
cvs commit: xml-security/src_unitTests/org/apache/xml/security/test/encryption BaltimoreEncTest.java XMLCipherTester.java
dims 2004/07/11 14:48:30
Modified: src_unitTests/org/apache/xml/security/test/encryption
BaltimoreEncTest.java XMLCipherTester.java
Log:
- Remove unnecessary code
- Remove unnecessary imports
Revision Changes Path
1.16 +1 -57 xml-security/src_unitTests/org/apache/xml/security/test/encryption/BaltimoreEncTest.java
Index: BaltimoreEncTest.java
===================================================================
RCS file: /home/cvs/xml-security/src_unitTests/org/apache/xml/security/test/encryption/BaltimoreEncTest.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- BaltimoreEncTest.java 6 Mar 2004 11:35:19 -0000 1.15
+++ BaltimoreEncTest.java 11 Jul 2004 21:48:30 -0000 1.16
@@ -16,9 +16,7 @@
*/
package org.apache.xml.security.test.encryption;
-import java.io.ByteArrayOutputStream;
import java.io.File;
-import java.io.IOException;
import java.security.Key;
import java.security.KeyFactory;
import java.security.NoSuchAlgorithmException;
@@ -49,10 +47,6 @@
import org.apache.xml.security.keys.keyresolver.KeyResolver;
import org.apache.xml.security.utils.JavaUtils;
import org.apache.xml.security.utils.XMLUtils;
-import org.apache.xml.serialize.DOMSerializer;
-import org.apache.xml.serialize.Method;
-import org.apache.xml.serialize.OutputFormat;
-import org.apache.xml.serialize.XMLSerializer;
import org.apache.xpath.XPathAPI;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -122,16 +116,9 @@
}
/**
- * Method main
- *
- * @param args
+ * Method setUp
*/
-
protected void setUp() throws Exception {
-
- String[] testCaseName = { "-noloading",
- BaltimoreEncTest.class.getName() };
-
// Create the comparison strings
DocumentBuilderFactory dbf =
@@ -710,47 +697,4 @@
return count;
}
-
- private static void dump(Document document) {
- OutputFormat of = new OutputFormat();
- of.setIndenting(true);
- of.setMethod(Method.XML);
- of.setOmitDocumentType(true);
- of.setOmitXMLDeclaration(true);
- DOMSerializer serializer = new XMLSerializer(System.out, of);
- try {
- serializer.serialize(document);
- } catch (IOException ioe) {
- ioe.printStackTrace();
- }
- }
-
- private static String toString(Element element) {
- OutputFormat of = new OutputFormat();
- of.setIndenting(true);
- of.setMethod(Method.XML);
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- DOMSerializer serializer = new XMLSerializer(baos, of);
- try {
- serializer.serialize(element);
- } catch (IOException ioe) {
- ioe.printStackTrace();
- }
- return (baos.toString());
- }
-
- private static String toString(Document document) {
- OutputFormat of = new OutputFormat();
- of.setIndenting(true);
- of.setMethod(Method.XML);
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- DOMSerializer serializer = new XMLSerializer(baos, of);
- try {
- serializer.serialize(document);
- } catch (IOException ioe) {
- ioe.printStackTrace();
- }
- return (baos.toString());
- }
-
}
1.16 +0 -84 xml-security/src_unitTests/org/apache/xml/security/test/encryption/XMLCipherTester.java
Index: XMLCipherTester.java
===================================================================
RCS file: /home/cvs/xml-security/src_unitTests/org/apache/xml/security/test/encryption/XMLCipherTester.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- XMLCipherTester.java 8 Apr 2004 03:39:09 -0000 1.15
+++ XMLCipherTester.java 11 Jul 2004 21:48:30 -0000 1.16
@@ -17,11 +17,7 @@
package org.apache.xml.security.test.encryption;
import java.io.ByteArrayOutputStream;
-import java.io.FileOutputStream;
import java.io.File;
-import java.io.IOException;
-import java.io.FileNotFoundException;
-import java.io.UnsupportedEncodingException;
import java.security.Key;
import java.security.KeyPairGenerator;
import java.security.KeyPair;
@@ -51,12 +47,7 @@
import org.apache.xml.security.encryption.CipherData;
import org.apache.xml.security.transforms.params.XPathContainer;
import org.apache.xml.security.utils.IdResolver;
-import org.apache.xml.security.utils.XMLUtils;
import org.apache.xml.security.keys.KeyInfo;
-import org.apache.xml.serialize.DOMSerializer;
-import org.apache.xml.serialize.Method;
-import org.apache.xml.serialize.OutputFormat;
-import org.apache.xml.serialize.XMLSerializer;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -670,67 +661,6 @@
}
- private void dump(Element element) {
- OutputFormat of = new OutputFormat();
- of.setIndenting(true);
- of.setMethod(Method.XML);
- of.setOmitDocumentType(true);
- of.setOmitXMLDeclaration(true);
- DOMSerializer serializer = new XMLSerializer(System.out, of);
- try {
- serializer.serialize(element);
- } catch (IOException ioe) {
- ioe.printStackTrace();
- }
- }
-
- private void dump(Document document) {
- OutputFormat of = new OutputFormat();
- of.setIndenting(true);
- of.setMethod(Method.XML);
- of.setOmitDocumentType(true);
- of.setOmitXMLDeclaration(true);
- DOMSerializer serializer = new XMLSerializer(System.out, of);
- try {
- serializer.serialize(document);
- } catch (IOException ioe) {
- ioe.printStackTrace();
- }
- }
-
- /*
- private String toString(Element element)
- throws UnsupportedEncodingException {
- OutputFormat of = new OutputFormat();
- of.setIndenting(true);
- of.setEncoding("UTF-8");
- of.setMethod(Method.XML);
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- DOMSerializer serializer = new XMLSerializer(baos, of);
- try {
- serializer.serialize(element);
- } catch (IOException ioe) {
- ioe.printStackTrace();
- }
- return (baos.toString("UTF-8"));
- }
- private String toString(Document document)
- throws UnsupportedEncodingException {
- OutputFormat of = new OutputFormat();
- of.setIndenting(true);
- of.setEncoding("UTF-8");
- of.setMethod(Method.XML);
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- DOMSerializer serializer = new XMLSerializer(baos, of);
- try {
- serializer.serialize(document);
- } catch (IOException ioe) {
- ioe.printStackTrace();
- }
- return (baos.toString("UTF-8"));
- }
- */
-
private String toString (Node n)
throws Exception {
@@ -746,20 +676,6 @@
}
- private void toString(Document document, String outputFile)
- throws UnsupportedEncodingException , FileNotFoundException {
- OutputFormat of = new OutputFormat();
- of.setIndenting(true);
- of.setEncoding("UTF-8");
- of.setMethod(Method.XML);
- FileOutputStream baos = new FileOutputStream(outputFile);
- DOMSerializer serializer = new XMLSerializer(baos, of);
- try {
- serializer.serialize(document);
- } catch (IOException ioe) {
- ioe.printStackTrace();
- }
- }
static {
org.apache.xml.security.Init.init();
}