harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r452748 - in /incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test: java/common/javax/security/auth/x500/ resources/
Date Wed, 04 Oct 2006 05:59:02 GMT
Author: smishura
Date: Tue Oct  3 22:59:01 2006
New Revision: 452748

URL: http://svn.apache.org/viewvc?view=rev&rev=452748
Log:
Get resources for testing from classpath

Added:
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/resources/X500PrincipalTest.0.dat
      - copied unchanged from r452703, incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/x500/inputdata.0
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/resources/X500PrincipalTest.1.dat
      - copied unchanged from r452703, incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/x500/inputdata
Removed:
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/x500/inputdata
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/x500/inputdata.0
Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/x500/X500PrincipalTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/x500/X500PrincipalTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/x500/X500PrincipalTest.java?view=diff&rev=452748&r1=452747&r2=452748
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/x500/X500PrincipalTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/x500/X500PrincipalTest.java
Tue Oct  3 22:59:01 2006
@@ -23,7 +23,6 @@
 package javax.security.auth.x500;
 
 import java.io.ByteArrayInputStream;
-import java.io.File;
 import java.io.FileInputStream;
 import java.io.InputStream;
 import java.util.ArrayList;
@@ -33,6 +32,7 @@
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
+import tests.support.resource.Support_Resources;
 
 /**
  * Tests X500Principal class
@@ -49,17 +49,6 @@
 
     private boolean testing = false;
 
-    static String outputPath = System.getProperty("RESOURCE_DIR",
-            "test/common/unit");
-
-    static String inputFile = outputPath + File.separator + "javax"
-            + File.separator + "security" + File.separator + "auth"
-            + File.separator + "x500" + File.separator + "inputdata";
-
-    static String inputFile0 = outputPath + File.separator + "javax"
-            + File.separator + "security" + File.separator + "auth"
-            + File.separator + "x500" + File.separator + "inputdata.0";
-
     public void testStreamPosition() throws Exception {
         //this encoding is read from the file
         /*byte [] mess = {0x30, 0x30, 
@@ -69,7 +58,8 @@
          };
          */
 
-        InputStream is = new FileInputStream(inputFile0);
+        InputStream is = Support_Resources
+                .getResourceStream("X500PrincipalTest.0.dat");
         X500Principal principal = new X500Principal(is);
         String s = principal.toString();
         assertEquals("CN=A, CN=B, CN=A, CN=B", s);
@@ -89,7 +79,8 @@
          };
          */
 
-        InputStream is = new FileInputStream(inputFile);
+        InputStream is = Support_Resources
+                .getResourceStream("X500PrincipalTest.1.dat");
         X500Principal principal = new X500Principal(is);
         String s = principal.toString();
         assertEquals("CN=A, CN=B, CN=A, CN=B", s);
@@ -147,7 +138,8 @@
          0x31, 0x0A, 0x30, 0x08, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x01, 0x42, 0x31, 0x0A,
0x30, 0x08, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x01, 0x41
          };
          */
-        InputStream is = new FileInputStream(inputFile);
+        InputStream is = Support_Resources
+                .getResourceStream("X500PrincipalTest.1.dat");
         X500Principal principal = new X500Principal(is);
         String s = principal.toString();
         assertEquals("CN=A, CN=B, CN=A, CN=B", s);



Mime
View raw message