cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject cxf-fediz git commit: [FEDIZ-129] - Default values in the schema are not actually used
Date Tue, 01 Sep 2015 10:20:51 GMT
Repository: cxf-fediz
Updated Branches:
  refs/heads/1.1.x-fixes e81876390 -> 41622e76d


[FEDIZ-129] - Default values in the schema are not actually used

Conflicts:
	pom.xml

Conflicts:
	plugins/core/src/main/resources/schemas/FedizConfig.xsd


Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/41622e76
Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/41622e76
Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/41622e76

Branch: refs/heads/1.1.x-fixes
Commit: 41622e76d50fd4c46cfe484c8a839c8141e4de0c
Parents: e818763
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Mon Aug 31 17:15:44 2015 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Tue Sep 1 11:20:44 2015 +0100

----------------------------------------------------------------------
 plugins/core/pom.xml                            | 34 ++++++++++----------
 .../fediz/core/config/FederationContext.java    |  6 ++--
 .../fediz/core/config/FederationProtocol.java   |  6 ++--
 .../core/config/FedizConfigurationTest.java     |  9 +++++-
 pom.xml                                         | 11 -------
 5 files changed, 30 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/41622e76/plugins/core/pom.xml
----------------------------------------------------------------------
diff --git a/plugins/core/pom.xml b/plugins/core/pom.xml
index a0d269e..3b30e92 100644
--- a/plugins/core/pom.xml
+++ b/plugins/core/pom.xml
@@ -30,6 +30,7 @@
     <packaging>bundle</packaging>
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <cxf.xjc-utils.version>3.0.5-SNAPSHOT</cxf.xjc-utils.version>
     </properties>
     <dependencies>
         <dependency>
@@ -71,30 +72,29 @@
     <build>
         <plugins>
             <plugin>
-                <groupId>com.sun.tools.xjc.maven2</groupId>
-                <artifactId>maven-jaxb-plugin</artifactId>
-                <version>1.1.1</version>
+                <groupId>org.apache.cxf</groupId>
+                <artifactId>cxf-xjc-plugin</artifactId>
+                <version>${cxf.xjc-utils.version}</version>
                 <executions>
                     <execution>
                         <goals>
-                            <goal>generate</goal>
+                            <goal>xsdtojava</goal>
                         </goals>
                     </execution>
                 </executions>
                 <configuration>
-                    <schemaDirectory>${basedir}/src/main/resources</schemaDirectory>
-                    <generatePackage>org.apache.cxf.fediz.core.config.jaxb</generatePackage>
-                    <includeSchemas>
-                        <includeSchema>**/FedizConfig.xsd</includeSchema>
-                    </includeSchemas>
-                    <excludeSchemas>
-                        <excludeSchema>test*.xsd</excludeSchema>
-                    </excludeSchemas>
-                    <includeBindings>
-                        <includeBinding>*.xjb</includeBinding>
-                    </includeBindings>
-                    <strict>true</strict>
-                    <verbose>true</verbose>
+                    <xsdOptions>
+                        <xsdOption>
+                            <xsd>${basedir}/src/main/resources/schemas/FedizConfig.xsd</xsd>
+                            <packagename>org.apache.cxf.fediz.core.config.jaxb</packagename>
+                            <extensionArgs>
+                                <arg>-Xdv</arg>
+                            </extensionArgs>
+                        </xsdOption>
+                    </xsdOptions>
+                    <extensions>
+                        <extension>org.apache.cxf.xjcplugins:cxf-xjc-dv:${cxf.xjc-utils.version}</extension>
+                    </extensions>
                 </configuration>
             </plugin>
             <plugin>

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/41622e76/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FederationContext.java
----------------------------------------------------------------------
diff --git a/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FederationContext.java
b/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FederationContext.java
index fe45ab1..2afd679 100644
--- a/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FederationContext.java
+++ b/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FederationContext.java
@@ -168,9 +168,8 @@ public class FederationContext implements Closeable {
         }
         keyManager = new KeyManager(config.getSigningKey());
         Properties sigProperties = createCryptoProperties(config.getSigningKey());
-        Crypto crypto;
         try {
-            crypto = CryptoFactory.getInstance(sigProperties);
+            Crypto crypto = CryptoFactory.getInstance(sigProperties);
             keyManager.setCrypto(crypto);
         } catch (WSSecurityException e) {
             String name = keyManager.getName();
@@ -192,9 +191,8 @@ public class FederationContext implements Closeable {
         }
         decryptionKeyManager = new KeyManager(config.getTokenDecryptionKey());
         Properties decProperties = createCryptoProperties(config.getTokenDecryptionKey());
-        Crypto crypto;
         try {
-            crypto = CryptoFactory.getInstance(decProperties);
+            Crypto crypto = CryptoFactory.getInstance(decProperties);
             decryptionKeyManager.setCrypto(crypto);
         } catch (WSSecurityException e) {
             String name = decryptionKeyManager.getName();

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/41622e76/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FederationProtocol.java
----------------------------------------------------------------------
diff --git a/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FederationProtocol.java
b/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FederationProtocol.java
index e63b5dc..04ccec6 100644
--- a/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FederationProtocol.java
+++ b/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FederationProtocol.java
@@ -316,12 +316,12 @@ public class FederationProtocol extends Protocol {
     }
     
     private Object loadCallbackType(CallbackType cbt, String name) {
-        if (cbt == null) {
+        if (cbt == null || cbt.getValue() == null) {
             return null;
         }
-        if (cbt.getType() == null || cbt.getType().equals(ArgumentType.STRING)) {
+        if (ArgumentType.STRING.equals(cbt.getType()) || cbt.getType() == null) {
             return new String(cbt.getValue());
-        } else if (cbt.getType().equals(ArgumentType.CLASS)) {
+        } else if (ArgumentType.CLASS.equals(cbt.getType())) {
             try {
                 if (this.classloader == null) {
                     return ClassLoaderUtils.loadClass(cbt.getValue(), this.getClass()).newInstance();

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/41622e76/plugins/core/src/test/java/org/apache/cxf/fediz/core/config/FedizConfigurationTest.java
----------------------------------------------------------------------
diff --git a/plugins/core/src/test/java/org/apache/cxf/fediz/core/config/FedizConfigurationTest.java
b/plugins/core/src/test/java/org/apache/cxf/fediz/core/config/FedizConfigurationTest.java
index ce31904..9bb445f 100644
--- a/plugins/core/src/test/java/org/apache/cxf/fediz/core/config/FedizConfigurationTest.java
+++ b/plugins/core/src/test/java/org/apache/cxf/fediz/core/config/FedizConfigurationTest.java
@@ -310,5 +310,12 @@ public class FedizConfigurationTest {
         
         return fedContext.getTokenReplayCache();
     }
+    
+    @org.junit.Test
+    public void testDefaultValues() throws JAXBException, IOException {
+        ContextConfig config = new ContextConfig();
+
+        Assert.assertTrue(config.getMaximumClockSkew().intValue() == 5);
+    }
 
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/41622e76/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 09fdf1c..5834cb1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -76,14 +76,6 @@
 
         <!-- OSGi related properties -->
 
-        <!-- please maintain alphabetical order here -->
-        <fediz.jaxb21.version>2.1</fediz.jaxb21.version>
-        <fediz.jaxb21.impl.version>2.1.13</fediz.jaxb21.impl.version>
-        <fediz.jaxb21.xjc.version>2.1.13</fediz.jaxb21.xjc.version>
-        <fediz.jaxb22.version>2.2.6</fediz.jaxb22.version>
-        <fediz.jaxb22.impl.version>2.2.5</fediz.jaxb22.impl.version>
-        <fediz.jaxb22.xjc.version>2.2.5</fediz.jaxb22.xjc.version>
-
         <fediz.checkstyle.extension />
         <fediz.downloadSources>true</fediz.downloadSources>
 
@@ -743,9 +735,6 @@
                 <jdk>1.7</jdk>
             </activation>
             <properties>
-                <fediz.jaxb.version>${fediz.jaxb22.version}</fediz.jaxb.version>
-                <fediz.jaxb.impl.version>${fediz.jaxb22.impl.version}</fediz.jaxb.impl.version>
-                <fediz.jaxb.xjc.version>${fediz.jaxb22.impl.version}</fediz.jaxb.xjc.version>
                 <jdk.version>1.6</jdk.version>
             </properties>
             <build>


Mime
View raw message