geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r1096035 - in /geronimo/components/jaspi/trunk/geronimo-jaspi: pom.xml src/main/java/org/apache/geronimo/components/jaspi/AuthConfigFactoryImpl.java src/test/java/org/apache/geronimo/components/jaspi/model/JaxbTest.java
Date Fri, 22 Apr 2011 21:00:03 GMT
Author: djencks
Date: Fri Apr 22 21:00:03 2011
New Revision: 1096035

URL: http://svn.apache.org/viewvc?rev=1096035&view=rev
Log:
GERONIMO-5927 don't force use of our xml spec versions since plain jaxb/sxc work fine

Modified:
    geronimo/components/jaspi/trunk/geronimo-jaspi/pom.xml
    geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/AuthConfigFactoryImpl.java
    geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/java/org/apache/geronimo/components/jaspi/model/JaxbTest.java

Modified: geronimo/components/jaspi/trunk/geronimo-jaspi/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/components/jaspi/trunk/geronimo-jaspi/pom.xml?rev=1096035&r1=1096034&r2=1096035&view=diff
==============================================================================
--- geronimo/components/jaspi/trunk/geronimo-jaspi/pom.xml (original)
+++ geronimo/components/jaspi/trunk/geronimo-jaspi/pom.xml Fri Apr 22 21:00:03 2011
@@ -71,17 +71,17 @@
             <version>1.1</version>
         </dependency>
 
-        <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-jaxb_2.2_spec</artifactId>
-            <version>1.0</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-stax-api_1.2_spec</artifactId>
-            <version>1.0</version>
-        </dependency>
+        <!--<dependency>-->
+            <!--<groupId>org.apache.geronimo.specs</groupId>-->
+            <!--<artifactId>geronimo-jaxb_2.2_spec</artifactId>-->
+            <!--<version>1.0</version>-->
+        <!--</dependency>-->
+
+        <!--<dependency>-->
+            <!--<groupId>org.apache.geronimo.specs</groupId>-->
+            <!--<artifactId>geronimo-stax-api_1.2_spec</artifactId>-->
+            <!--<version>1.0</version>-->
+        <!--</dependency>-->
 
         <dependency>
             <groupId>org.apache.xbean</groupId>
@@ -96,17 +96,17 @@
             <version>0.7.2_1</version>
         </dependency>
 
-        <dependency>
-            <groupId>org.apache.geronimo.bundles</groupId>
-            <artifactId>woodstox</artifactId>
-            <version>3.2.9_1</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.geronimo.bundles</groupId>
-            <artifactId>jaxb-impl</artifactId>
-            <version>2.2_1</version>
-        </dependency>
+        <!--<dependency>-->
+            <!--<groupId>org.apache.geronimo.bundles</groupId>-->
+            <!--<artifactId>woodstox</artifactId>-->
+            <!--<version>3.2.9_1</version>-->
+        <!--</dependency>-->
+
+        <!--<dependency>-->
+            <!--<groupId>org.apache.geronimo.bundles</groupId>-->
+            <!--<artifactId>jaxb-impl</artifactId>-->
+            <!--<version>2.2_1</version>-->
+        <!--</dependency>-->
 
         <dependency>
             <groupId>com.sun.xml.bind</groupId>
@@ -158,19 +158,19 @@
             <plugin>
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
-                <version>2.0.1</version>
+                <version>2.3.4</version>
                 <configuration>
                     <instructions>
                         <Export-Package>org.apache.geronimo.components.jaspi*;version=1.0</Export-Package>
                         <Export-SPI-Provider>org.apache.geronimo.components.jaspi.AuthConfigFactoryImpl</Export-SPI-Provider>
                         <Import-Package>
                             org.apache.geronimo.components.jaspi*;version="[1.0,1.1)",
+                            com.sun.xml.bind.*:resolution:=optional,
                             *
                         </Import-Package>
                         <!-- once a maven-bundle-plugin that can interpret the impl/uses
version policy is released we can remove the explicit version ranges on import-package -->
                         <_versionpolicy-impl>[$(version;==;$(@)),$(version;=+;$(@)))</_versionpolicy-impl>
                         <_versionpolicy-uses>[$(version;==;$(@)),$(version;+;$(@)))</_versionpolicy-uses>
-                        <_versionpolicy>[$(version;==;$(@)),$(version;+;$(@)))</_versionpolicy>
                         <Specification-Version>1.0</Specification-Version>
                         <Specification-Title>JASPIC</Specification-Title>
                         <Specification-Vendor>Sun Microsystems</Specification-Vendor>

Modified: geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/AuthConfigFactoryImpl.java
URL: http://svn.apache.org/viewvc/geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/AuthConfigFactoryImpl.java?rev=1096035&r1=1096034&r2=1096035&view=diff
==============================================================================
--- geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/AuthConfigFactoryImpl.java
(original)
+++ geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/AuthConfigFactoryImpl.java
Fri Apr 22 21:00:03 2011
@@ -30,9 +30,13 @@ import javax.xml.bind.JAXBException;
 import javax.xml.parsers.ParserConfigurationException;
 import javax.xml.stream.XMLStreamException;
 import java.io.File;
+import java.io.FileOutputStream;
 import java.io.FileReader;
 import java.io.FileWriter;
 import java.io.IOException;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
@@ -260,7 +264,8 @@ public class AuthConfigFactoryImpl exten
     private void saveConfig() {
         if (configFile != null) {
             try {
-                FileWriter out = new FileWriter(configFile);
+                OutputStream outStream = new FileOutputStream(configFile);
+                Writer out = new OutputStreamWriter(outStream, "UTF-8");
                 try {
                     JaspiXmlUtil.writeJaspi(jaspiType, out);
                 } finally {

Modified: geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/java/org/apache/geronimo/components/jaspi/model/JaxbTest.java
URL: http://svn.apache.org/viewvc/geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/java/org/apache/geronimo/components/jaspi/model/JaxbTest.java?rev=1096035&r1=1096034&r2=1096035&view=diff
==============================================================================
--- geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/java/org/apache/geronimo/components/jaspi/model/JaxbTest.java
(original)
+++ geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/java/org/apache/geronimo/components/jaspi/model/JaxbTest.java
Fri Apr 22 21:00:03 2011
@@ -20,11 +20,14 @@
 
 package org.apache.geronimo.components.jaspi.model;
 
+import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
 import java.io.Reader;
 import java.io.File;
+import java.io.UnsupportedEncodingException;
 import java.io.Writer;
 import java.io.FileWriter;
 import java.io.FileReader;
@@ -63,7 +66,7 @@ public class JaxbTest {
         JaspiType jaspi1 = loadJaspi(file);
         if (jaspi1.getConfigProvider().size() != count) throw new Exception("expected " +
count + " configprovider, not this: " + jaspi1.getConfigProvider());
         File newFile = getWriteFile(file);
-        Writer writer = new FileWriter(newFile);
+        Writer writer = getWriter(newFile);
         JaspiXmlUtil.writeJaspi(jaspi1, writer);
         JaspiType jaspi2 = JaspiXmlUtil.loadJaspi(new FileReader(newFile));
         if (jaspi2.getConfigProvider().size() != count) throw new Exception("expected " +
count + " configprovider, not this: " + jaspi2.getConfigProvider());
@@ -75,7 +78,7 @@ public class JaxbTest {
         JaspiType jaspi1 = loadJaspi(file);
         if (jaspi1.getConfigProvider().size() != count) throw new Exception("expected " +
count + " configprovider, not this: " + jaspi1.getConfigProvider());
         File newFile = getWriteFile(file);
-        Writer writer = new FileWriter(newFile);
+        Writer writer = getWriter(newFile);
         JaspiXmlUtil.writeJaspi(jaspi1, writer);
         JaspiType jaspi2 = JaspiXmlUtil.loadJaspi(new FileReader(newFile));
         if (jaspi2.getConfigProvider().size() != count) throw new Exception("expected " +
count + " configprovider, not this: " + jaspi2.getConfigProvider());
@@ -90,9 +93,9 @@ public class JaxbTest {
         return rbac;
     }
 
-    private Reader getReader(String file) {
+    private Reader getReader(String file) throws UnsupportedEncodingException {
         InputStream in = getClass().getClassLoader().getResourceAsStream("test-" + file +
".xml");
-        Reader reader = new InputStreamReader(in);
+        Reader reader = new InputStreamReader(in, "UTF-8");
         return reader;
     }
 
@@ -109,7 +112,7 @@ public class JaxbTest {
         ConfigProviderType jaspi1 = JaspiXmlUtil.loadConfigProvider(reader);
         jaspi1.initialize(callbackHandler);
         File newFile = getWriteFile(file);
-        Writer writer = new FileWriter(newFile);
+        Writer writer = getWriter(newFile);
         JaspiXmlUtil.writeConfigProvider(jaspi1, writer);
         ConfigProviderType jaspi2 = JaspiXmlUtil.loadConfigProvider(new FileReader(newFile));
 
@@ -124,7 +127,7 @@ public class JaxbTest {
         ClientAuthConfigType jaspi1 = JaspiXmlUtil.loadClientAuthConfig(reader);
         jaspi1.initialize(callbackHandler);
         File newFile = getWriteFile(file);
-        Writer writer = new FileWriter(newFile);
+        Writer writer = getWriter(newFile);
         JaspiXmlUtil.writeClientAuthConfig(jaspi1, writer);
         ClientAuthConfigType jaspi2 = JaspiXmlUtil.loadClientAuthConfig(new FileReader(newFile));
 
@@ -138,7 +141,7 @@ public class JaxbTest {
         Reader reader = getReader(file);
         ClientAuthContextType jaspi1 = JaspiXmlUtil.loadClientAuthContext(reader);
         File newFile = getWriteFile(file);
-        Writer writer = new FileWriter(newFile);
+        Writer writer = getWriter(newFile);
         JaspiXmlUtil.writeClientAuthContext(jaspi1, writer);
         ClientAuthContextType jaspi2 = JaspiXmlUtil.loadClientAuthContext(new FileReader(newFile));
 
@@ -146,13 +149,18 @@ public class JaxbTest {
         clientAuthConfig.secureRequest(null, null);
     }
 
+    private Writer getWriter(File newFile) throws IOException {
+        FileOutputStream out = new FileOutputStream(newFile);
+        return new OutputStreamWriter(out, "UTF-8");//new FileWriter(newFile);
+    }
+
     @Test
     public void testClientAuthModule() throws Exception {
         String file = "client-auth-module";
         Reader reader = getReader(file);
         AuthModuleType<ClientAuthModule> jaspi1 = JaspiXmlUtil.loadClientAuthModule(reader);
         File newFile = getWriteFile(file);
-        Writer writer = new FileWriter(newFile);
+        Writer writer = getWriter(newFile);
         JaspiXmlUtil.writeClientAuthModule(jaspi1, writer);
         AuthModuleType jaspi2 = JaspiXmlUtil.loadClientAuthModule(new FileReader(newFile));
 



Mime
View raw message