cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From owu...@apache.org
Subject svn commit: r1573232 - in /cxf/fediz/trunk/services/idp/src: main/java/org/apache/cxf/fediz/service/idp/beans/ main/java/org/apache/cxf/fediz/service/idp/domain/ main/java/org/apache/cxf/fediz/service/idp/model/ main/java/org/apache/cxf/fediz/service/i...
Date Sat, 01 Mar 2014 22:00:40 GMT
Author: owulff
Date: Sat Mar  1 22:00:39 2014
New Revision: 1573232

URL: http://svn.apache.org/r1573232
Log:
Type safety improved for domain and persistence layer

Added:
    cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/domain/FederationType.java
    cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/domain/TrustType.java
Modified:
    cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/beans/STSClientAction.java
    cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/domain/Application.java
    cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/domain/Idp.java
    cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/domain/TrustedIdp.java
    cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/model/TrustedIDPConfig.java
    cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationEntity.java
    cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/DBLoaderImpl.java
    cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/IdpEntity.java
    cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpEntity.java
    cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/util/MetadataWriter.java
    cxf/fediz/trunk/services/idp/src/main/resources/entities-realma.xml
    cxf/fediz/trunk/services/idp/src/main/webapp/WEB-INF/idp-config-realma.xml
    cxf/fediz/trunk/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/integrationtests/RestITTest.java
    cxf/fediz/trunk/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationDAOJPATest.java
    cxf/fediz/trunk/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/service/jpa/IdpDAOJPATest.java
    cxf/fediz/trunk/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/service/jpa/TestDBLoader.java
    cxf/fediz/trunk/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpDAOJPATest.java
    cxf/fediz/trunk/services/idp/src/test/resources/idp-config.xml

Modified: cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/beans/STSClientAction.java
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/beans/STSClientAction.java?rev=1573232&r1=1573231&r2=1573232&view=diff
==============================================================================
--- cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/beans/STSClientAction.java (original)
+++ cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/beans/STSClientAction.java Sat Mar  1 22:00:39 2014
@@ -243,9 +243,9 @@ public class STSClientAction {
         }
         
         sts.setEnableLifetime(true);
-        if (serviceConfig.getLifeTime() != null && serviceConfig.getLifeTime().length() > 0) {
+        if (serviceConfig.getLifeTime() > 0) {
             try {
-                int lifetime = Integer.parseInt(serviceConfig.getLifeTime());
+                int lifetime = serviceConfig.getLifeTime();
                 sts.setTtl(lifetime);
                 sts.setEnableLifetime(lifetime > 0);
                 if (LOG.isDebugEnabled()) {

Modified: cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/domain/Application.java
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/domain/Application.java?rev=1573232&r1=1573231&r2=1573232&view=diff
==============================================================================
--- cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/domain/Application.java (original)
+++ cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/domain/Application.java Sat Mar  1 22:00:39 2014
@@ -75,7 +75,7 @@ public class Application implements Seri
     protected String tokenType;
     
     // Not in Metadata, configured in IDP or passed in wreq parameter
-    protected String lifeTime;
+    protected int lifeTime;
     
     // WS-Policy Namespace for AppliesTo element
     protected String policyNamespace;
@@ -171,11 +171,11 @@ public class Application implements Seri
         this.tokenType = tokenType;
     }
 
-    public String getLifeTime() {
+    public int getLifeTime() {
         return lifeTime;
     }
 
-    public void setLifeTime(String lifeTime) {
+    public void setLifeTime(int lifeTime) {
         this.lifeTime = lifeTime;
     }
 

Added: cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/domain/FederationType.java
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/domain/FederationType.java?rev=1573232&view=auto
==============================================================================
--- cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/domain/FederationType.java (added)
+++ cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/domain/FederationType.java Sat Mar  1 22:00:39 2014
@@ -0,0 +1,40 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.fediz.service.idp.domain;
+
+import javax.xml.bind.annotation.XmlEnum;
+
+@XmlEnum
+public enum FederationType {
+
+    FEDERATE_IDENTITY("FederateIdentity"),
+    FEDERATE_CLAIMS("FederateClaims");
+
+    private String name;
+
+    private FederationType(final String name) {
+        this.name = name;
+    }
+
+    @Override
+    public String toString() {
+        return name;
+    }
+
+}

Modified: cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/domain/Idp.java
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/domain/Idp.java?rev=1573232&r1=1573231&r2=1573232&view=diff
==============================================================================
--- cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/domain/Idp.java (original)
+++ cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/domain/Idp.java Sat Mar  1 22:00:39 2014
@@ -19,6 +19,7 @@
 package org.apache.cxf.fediz.service.idp.domain;
 
 import java.io.Serializable;
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -72,11 +73,11 @@ public class Idp implements Serializable
     protected String certificatePassword;
 
     // fed:SecurityTokenSerivceEndpoint
-    protected String stsUrl;
+    protected URL stsUrl;
 
     // fed:PassiveRequestorEndpoint
     // published hostname, port must be configured
-    protected String idpUrl;
+    protected URL idpUrl;
 
     // RoleDescriptor protocolSupportEnumeration=
     // "http://docs.oasis-open.org/wsfed/federation/200706"
@@ -179,19 +180,19 @@ public class Idp implements Serializable
         this.certificatePassword = password;
     }
 
-    public String getStsUrl() {
+    public URL getStsUrl() {
         return stsUrl;
     }
 
-    public void setStsUrl(String stsUrl) {
+    public void setStsUrl(URL stsUrl) {
         this.stsUrl = stsUrl;
     }
 
-    public String getIdpUrl() {
+    public URL getIdpUrl() {
         return idpUrl;
     }
 
-    public void setIdpUrl(String idpUrl) {
+    public void setIdpUrl(URL idpUrl) {
         this.idpUrl = idpUrl;
     }
 

Added: cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/domain/TrustType.java
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/domain/TrustType.java?rev=1573232&view=auto
==============================================================================
--- cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/domain/TrustType.java (added)
+++ cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/domain/TrustType.java Sat Mar  1 22:00:39 2014
@@ -0,0 +1,40 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.fediz.service.idp.domain;
+
+import javax.xml.bind.annotation.XmlEnum;
+
+@XmlEnum
+public enum TrustType {
+
+    PEER_TRUST("PeerTrust"),
+    INDIRECT_TRUST("IndirectTrust");
+
+    private String name;
+
+    private TrustType(final String name) {
+        this.name = name;
+    }
+
+    @Override
+    public String toString() {
+        return name;
+    }
+
+}

Modified: cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/domain/TrustedIdp.java
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/domain/TrustedIdp.java?rev=1573232&r1=1573231&r2=1573232&view=diff
==============================================================================
--- cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/domain/TrustedIdp.java (original)
+++ cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/domain/TrustedIdp.java Sat Mar  1 22:00:39 2014
@@ -50,7 +50,7 @@ public class TrustedIdp implements Seria
     protected String certificate;
     
     //Direct trust (signing cert imported), Indirect trust (CA certs imported, subject configured)
-    protected String trustType;
+    protected TrustType trustType;
     
     //Could be read from Metadata, RoleDescriptor protocolSupportEnumeration=
     // "http://docs.oasis-open.org/wsfed/federation/200706"
@@ -58,7 +58,7 @@ public class TrustedIdp implements Seria
     protected String protocol;
     
     //FederateIdentity, FederateClaims
-    protected String federationType;
+    protected FederationType federationType;
     
     //optional (to provide a list of IDPs)
     protected String name;
@@ -119,11 +119,11 @@ public class TrustedIdp implements Seria
         this.protocol = protocol;
     }
 
-    public String getFederationType() {
+    public FederationType getFederationType() {
         return federationType;
     }
 
-    public void setFederationType(String federationType) {
+    public void setFederationType(FederationType federationType) {
         this.federationType = federationType;
     }
 
@@ -151,11 +151,11 @@ public class TrustedIdp implements Seria
         this.logo = logo;
     }
 
-    public String getTrustType() {
+    public TrustType getTrustType() {
         return trustType;
     }
 
-    public void setTrustType(String trustType) {
+    public void setTrustType(TrustType trustType) {
         this.trustType = trustType;
     }
                

Modified: cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/model/TrustedIDPConfig.java
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/model/TrustedIDPConfig.java?rev=1573232&r1=1573231&r2=1573232&view=diff
==============================================================================
--- cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/model/TrustedIDPConfig.java (original)
+++ cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/model/TrustedIDPConfig.java Sat Mar  1 22:00:39 2014
@@ -21,6 +21,8 @@ package org.apache.cxf.fediz.service.idp
 
 import javax.xml.bind.annotation.XmlAttribute;
 
+import org.apache.cxf.fediz.service.idp.domain.FederationType;
+import org.apache.cxf.fediz.service.idp.domain.TrustType;
 import org.apache.cxf.fediz.service.idp.domain.TrustedIdp;
 
 //@XmlRootElement(name = "TrustedIDP", namespace = "http://org.apache.cxf.fediz")
@@ -45,7 +47,7 @@ public class TrustedIDPConfig extends Tr
     private String certificate;
     
     //Direct trust (signing cert imported), Indirect trust (CA certs imported, subject configured)
-    private String trustType;
+    private TrustType trustType;
     
     //Could be read from Metadata, RoleDescriptor protocolSupportEnumeration=
     // "http://docs.oasis-open.org/wsfed/federation/200706"
@@ -53,7 +55,7 @@ public class TrustedIDPConfig extends Tr
     private String protocol;
     
     //FederateIdentity, FederateClaims
-    private String federationType;
+    private FederationType federationType;
     
     //optional (to provide a list of IDPs)
     private String name;
@@ -113,11 +115,11 @@ public class TrustedIDPConfig extends Tr
         this.protocol = protocol;
     }
 
-    public String getFederationType() {
+    public FederationType getFederationType() {
         return federationType;
     }
 
-    public void setFederationType(String federationType) {
+    public void setFederationType(FederationType federationType) {
         this.federationType = federationType;
     }
 
@@ -145,11 +147,11 @@ public class TrustedIDPConfig extends Tr
         this.logo = logo;
     }
 
-    public String getTrustType() {
+    public TrustType getTrustType() {
         return trustType;
     }
 
-    public void setTrustType(String trustType) {
+    public void setTrustType(TrustType trustType) {
         this.trustType = trustType;
     }
                

Modified: cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationEntity.java
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationEntity.java?rev=1573232&r1=1573231&r2=1573232&view=diff
==============================================================================
--- cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationEntity.java (original)
+++ cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationEntity.java Sat Mar  1 22:00:39 2014
@@ -67,7 +67,7 @@ public class ApplicationEntity {
     private String tokenType;
     
     // Not in Metadata, configured in IDP or passed in wreq parameter
-    private String lifeTime;
+    private int lifeTime;
     
     // WS-Policy Namespace in SignIn Response
     private String policyNamespace;
@@ -147,11 +147,11 @@ public class ApplicationEntity {
         this.tokenType = tokenType;
     }
 
-    public String getLifeTime() {
+    public int getLifeTime() {
         return lifeTime;
     }
 
-    public void setLifeTime(String lifeTime) {
+    public void setLifeTime(int lifeTime) {
         this.lifeTime = lifeTime;
     }
     

Modified: cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/DBLoaderImpl.java
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/DBLoaderImpl.java?rev=1573232&r1=1573231&r2=1573232&view=diff
==============================================================================
--- cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/DBLoaderImpl.java (original)
+++ cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/DBLoaderImpl.java Sat Mar  1 22:00:39 2014
@@ -18,6 +18,7 @@
  */
 package org.apache.cxf.fediz.service.idp.service.jpa;
 
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -26,6 +27,8 @@ import java.util.Map;
 import javax.persistence.EntityManager;
 import javax.persistence.PersistenceContext;
 
+import org.apache.cxf.fediz.service.idp.domain.FederationType;
+import org.apache.cxf.fediz.service.idp.domain.TrustType;
 import org.apache.wss4j.dom.WSConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -82,7 +85,7 @@ public class DBLoaderImpl implements DBL
             
             ApplicationEntity entity = new ApplicationEntity();
             entity.setEncryptionCertificate("");
-            entity.setLifeTime("3600");
+            entity.setLifeTime(3600);
             entity.setProtocol("http://docs.oasis-open.org/wsfed/federation/200706");
             entity.setRealm("urn:org:apache:cxf:fediz:fedizhelloworld");
             entity.setRole("ApplicationServiceType");
@@ -114,11 +117,11 @@ public class DBLoaderImpl implements DBL
             entity3.setCacheTokens(true);
             entity3.setCertificate("trusted cert");
             entity3.setDescription("Realm B description");
-            entity3.setFederationType("FederateIdentity");
+            entity3.setFederationType(FederationType.FEDERATE_IDENTITY);
             entity3.setName("Realm B");
             entity3.setProtocol("http://docs.oasis-open.org/wsfed/federation/200706");
             entity3.setRealm("urn:org:apache:cxf:fediz:idp:realm-B");
-            entity3.setTrustType("PEER_TRUST");
+            entity3.setTrustType(TrustType.PEER_TRUST);
             entity3.setUrl("https://localhost:12443/fediz-idp-remote/federation");
             em.persist(entity3);
             
@@ -127,9 +130,9 @@ public class DBLoaderImpl implements DBL
             idpEntity.getTrustedIdps().add(entity3);
             idpEntity.setCertificate("stsKeystoreA.properties");
             idpEntity.setCertificatePassword("realma");
-            idpEntity.setIdpUrl("https://localhost:9443/fediz-idp/federation");
+            idpEntity.setIdpUrl(new URL("https://localhost:9443/fediz-idp/federation"));
             idpEntity.setRealm("urn:org:apache:cxf:fediz:idp:realm-A");
-            idpEntity.setStsUrl("https://localhost:9443/fediz-idp-sts/REALMA");
+            idpEntity.setStsUrl(new URL("https://localhost:9443/fediz-idp-sts/REALMA"));
             idpEntity.setServiceDisplayName("REALM A");
             idpEntity.setServiceDescription("IDP of Realm A");
             idpEntity.setUri("realma");

Modified: cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/IdpEntity.java
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/IdpEntity.java?rev=1573232&r1=1573231&r2=1573232&view=diff
==============================================================================
--- cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/IdpEntity.java (original)
+++ cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/IdpEntity.java Sat Mar  1 22:00:39 2014
@@ -19,6 +19,7 @@
 
 package org.apache.cxf.fediz.service.idp.service.jpa;
 
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -72,11 +73,11 @@ public class IdpEntity {
     private String certificatePassword;
 
     // fed:SecurityTokenSerivceEndpoint
-    private String stsUrl;
+    private URL stsUrl;
 
     // fedl:PassiveRequestorEndpoint
     // published hostname, port must be configured
-    private String idpUrl;
+    private URL idpUrl;
     
     private boolean rpSingleSignOutConfirmation;
 
@@ -194,19 +195,19 @@ public class IdpEntity {
         this.certificatePassword = password;
     }
 
-    public String getStsUrl() {
+    public URL getStsUrl() {
         return stsUrl;
     }
 
-    public void setStsUrl(String stsUrl) {
+    public void setStsUrl(URL stsUrl) {
         this.stsUrl = stsUrl;
     }
 
-    public String getIdpUrl() {
+    public URL getIdpUrl() {
         return idpUrl;
     }
 
-    public void setIdpUrl(String idpUrl) {
+    public void setIdpUrl(URL idpUrl) {
         this.idpUrl = idpUrl;
     }
 

Modified: cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpEntity.java
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpEntity.java?rev=1573232&r1=1573231&r2=1573232&view=diff
==============================================================================
--- cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpEntity.java (original)
+++ cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpEntity.java Sat Mar  1 22:00:39 2014
@@ -19,8 +19,12 @@
 package org.apache.cxf.fediz.service.idp.service.jpa;
 
 import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
 import javax.persistence.Id;
 
+import org.apache.cxf.fediz.service.idp.domain.FederationType;
+import org.apache.cxf.fediz.service.idp.domain.TrustType;
 import org.apache.openjpa.persistence.jdbc.Index;
 
 
@@ -46,7 +50,8 @@ public class TrustedIdpEntity {
     private String certificate;
     
     //Direct trust (signing cert imported), Indirect trust (CA certs imported, subject configured)
-    private String trustType;
+    @Enumerated(EnumType.STRING)
+    private TrustType trustType;
     
     //Could be read from Metadata, RoleDescriptor protocolSupportEnumeration=
     // "http://docs.oasis-open.org/wsfed/federation/200706"
@@ -54,7 +59,8 @@ public class TrustedIdpEntity {
     private String protocol;
     
     //FederateIdentity, FederateClaims
-    private String federationType;
+    @Enumerated(EnumType.STRING)
+    private FederationType federationType;
     
     //optional (to provide a list of IDPs)
     private String name;
@@ -114,11 +120,11 @@ public class TrustedIdpEntity {
         this.protocol = protocol;
     }
 
-    public String getFederationType() {
+    public FederationType getFederationType() {
         return federationType;
     }
 
-    public void setFederationType(String federationType) {
+    public void setFederationType(FederationType federationType) {
         this.federationType = federationType;
     }
 
@@ -146,11 +152,11 @@ public class TrustedIdpEntity {
         this.logo = logo;
     }
 
-    public String getTrustType() {
+    public TrustType getTrustType() {
         return trustType;
     }
 
-    public void setTrustType(String trustType) {
+    public void setTrustType(TrustType trustType) {
         this.trustType = trustType;
     }
 

Modified: cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/util/MetadataWriter.java
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/util/MetadataWriter.java?rev=1573232&r1=1573231&r2=1573232&view=diff
==============================================================================
--- cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/util/MetadataWriter.java (original)
+++ cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/util/MetadataWriter.java Sat Mar  1 22:00:39 2014
@@ -75,7 +75,7 @@ public class MetadataWriter {
             writer.writeStartElement("", "EntityDescriptor", SAML2_METADATA_NS);
             writer.writeAttribute("ID", referenceID);
                       
-            writer.writeAttribute("entityID", config.getIdpUrl());
+            writer.writeAttribute("entityID", config.getIdpUrl().toString());
 
             writer.writeNamespace("fed", WS_FEDERATION_NS);
             writer.writeNamespace("wsa", WS_ADDRESSING_NS);
@@ -120,7 +120,7 @@ public class MetadataWriter {
             writer.writeStartElement("wsa", "EndpointReference", WS_ADDRESSING_NS);
 
             writer.writeStartElement("wsa", "Address", WS_ADDRESSING_NS);
-            writer.writeCharacters(config.getStsUrl());
+            writer.writeCharacters(config.getStsUrl().toString());
             
             writer.writeEndElement(); // Address
             writer.writeEndElement(); // EndpointReference
@@ -132,7 +132,7 @@ public class MetadataWriter {
             writer.writeStartElement("wsa", "EndpointReference", WS_ADDRESSING_NS);
 
             writer.writeStartElement("wsa", "Address", WS_ADDRESSING_NS);
-            writer.writeCharacters(config.getIdpUrl());
+            writer.writeCharacters(config.getIdpUrl().toString());
             
             writer.writeEndElement(); // Address
             writer.writeEndElement(); // EndpointReference

Modified: cxf/fediz/trunk/services/idp/src/main/resources/entities-realma.xml
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/main/resources/entities-realma.xml?rev=1573232&r1=1573231&r2=1573232&view=diff
==============================================================================
--- cxf/fediz/trunk/services/idp/src/main/resources/entities-realma.xml (original)
+++ cxf/fediz/trunk/services/idp/src/main/resources/entities-realma.xml Sat Mar  1 22:00:39 2014
@@ -85,7 +85,7 @@
         <property name="certificate" value="realmb.cert" />
         <property name="trustType" value="PEER_TRUST" />
         <property name="protocol" value="http://docs.oasis-open.org/wsfed/federation/200706" />
-        <property name="federationType" value="FederateIdentity" />
+        <property name="federationType" value="FEDERATE_IDENTITY" />
         <property name="name" value="Realm B" />
         <property name="description" value="Realm B description" />
     </bean>

Modified: cxf/fediz/trunk/services/idp/src/main/webapp/WEB-INF/idp-config-realma.xml
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/main/webapp/WEB-INF/idp-config-realma.xml?rev=1573232&r1=1573231&r2=1573232&view=diff
==============================================================================
--- cxf/fediz/trunk/services/idp/src/main/webapp/WEB-INF/idp-config-realma.xml (original)
+++ cxf/fediz/trunk/services/idp/src/main/webapp/WEB-INF/idp-config-realma.xml Sat Mar  1 22:00:39 2014
@@ -98,7 +98,7 @@
         <property name="trustType" value="PEER_TRUST" />  <!-- Required for Fediz Core, Process SignInResponse -->
         <property name="protocol"
             value="http://docs.oasis-open.org/wsfed/federation/200706" />
-        <property name="federationType" value="FederateIdentity" /> <!-- Required for STS Relationship -->
+        <property name="federationType" value="FEDERATE_IDENTITY" /> <!-- Required for STS Relationship -->
         <property name="name" value="REALM B" />
         <property name="description" value="IDP of Realm B" />
         <!-- todo true / false prop for propagate sign-out of other realms !?-->

Modified: cxf/fediz/trunk/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/integrationtests/RestITTest.java
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/integrationtests/RestITTest.java?rev=1573232&r1=1573231&r2=1573232&view=diff
==============================================================================
--- cxf/fediz/trunk/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/integrationtests/RestITTest.java (original)
+++ cxf/fediz/trunk/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/integrationtests/RestITTest.java Sat Mar  1 22:00:39 2014
@@ -19,6 +19,7 @@
 package org.apache.cxf.fediz.service.idp.integrationtests;
 
 import java.io.UnsupportedEncodingException;
+import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URL;
 
@@ -79,7 +80,7 @@ public class RestITTest {
     }
     
     @Test
-    public void testGetAllIdps() throws UnsupportedEncodingException {
+    public void testGetAllIdps() throws UnsupportedEncodingException, MalformedURLException {
         String address = "https://localhost:" + idpHttpsPort + "/fediz-idp/services/rs";
         Client client = ClientBuilder.newClient();
         Idps idps = client.target(address).path("idps")
@@ -99,9 +100,9 @@ public class RestITTest {
         Assert.assertEquals("ServiceDisplayName doesn't match",
                             "REALM A", idp.getServiceDisplayName());
         Assert.assertEquals("IdpUrl doesn't match",
-                            "https://localhost:9443/fediz-idp/federation", idp.getIdpUrl());
+                            new URL("https://localhost:9443/fediz-idp/federation"), idp.getIdpUrl());
         Assert.assertEquals("StsUrl doesn't match",
-                            "https://localhost:9443/fediz-idp-sts/REALMA", idp.getStsUrl());
+                            new URL("https://localhost:9443/fediz-idp-sts/REALMA"), idp.getStsUrl());
         Assert.assertEquals("Uri doesn't match",
                             "realma", idp.getUri());
         Assert.assertTrue("ProvideIDPList doesn't match", idp.isProvideIdpList());
@@ -140,7 +141,7 @@ public class RestITTest {
         Application application = new Application();
         application.setRealm(realm);
         application.setEncryptionCertificate("");
-        application.setLifeTime("3600");
+        application.setLifeTime(3600);
         application.setProtocol("http://docs.oasis-open.org/wsfed/federation/200706");
         application.setRole("ApplicationServiceType");
         application.setServiceDescription("Fedizhelloworld description");

Modified: cxf/fediz/trunk/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationDAOJPATest.java
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationDAOJPATest.java?rev=1573232&r1=1573231&r2=1573232&view=diff
==============================================================================
--- cxf/fediz/trunk/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationDAOJPATest.java (original)
+++ cxf/fediz/trunk/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationDAOJPATest.java Sat Mar  1 22:00:39 2014
@@ -67,7 +67,7 @@ public class ApplicationDAOJPATest {
         Application application = applicationDAO.getApplication("urn:org:apache:cxf:fediz:fedizhelloworld",
                                                                 Arrays.asList("all"));
         
-        Assert.isTrue("3600".equals(application.getLifeTime()),
+        Assert.isTrue(application.getLifeTime() == 3600,
                       "LifeTime doesn't match");
         Assert.isTrue("http://docs.oasis-open.org/wsfed/federation/200706".equals(application.getProtocol()),
                       "Protocol doesn't match");
@@ -122,7 +122,7 @@ public class ApplicationDAOJPATest {
         
         Assert.isTrue("".equals(application.getEncryptionCertificate()),
                       "EncryptionCertificate doesn't match");
-        Assert.isTrue("3600".equals(application.getLifeTime()),
+        Assert.isTrue(application.getLifeTime() == 3600,
                       "LifeTime doesn't match");
         Assert.isTrue("http://docs.oasis-open.org/wsfed/federation/200706".equals(application.getProtocol()),
                       "Protocol doesn't match");
@@ -156,7 +156,7 @@ public class ApplicationDAOJPATest {
         application = new Application();
         application.setRealm(realm);
         application.setEncryptionCertificate("U");
-        application.setLifeTime("U3600");
+        application.setLifeTime(1800);
         application.setProtocol("Uhttp://docs.oasis-open.org/wsfed/federation/200706");
         application.setRole("UApplicationServiceType");
         application.setServiceDescription("UFedizhelloworld2 description");
@@ -166,7 +166,7 @@ public class ApplicationDAOJPATest {
         
         Assert.isTrue("U".equals(application.getEncryptionCertificate()),
                       "EncryptionCertificate doesn't match");
-        Assert.isTrue("U3600".equals(application.getLifeTime()),
+        Assert.isTrue(application.getLifeTime() == 1800,
                       "LifeTime doesn't match");
         Assert.isTrue("Uhttp://docs.oasis-open.org/wsfed/federation/200706".equals(application.getProtocol()),
                       "Protocol doesn't match");
@@ -193,7 +193,7 @@ public class ApplicationDAOJPATest {
         Application application = new Application();
         application.setRealm("urn:org:apache:cxf:fediz:fedizhelloworld");
         application.setEncryptionCertificate("");
-        application.setLifeTime("3600");
+        application.setLifeTime(3600);
         application.setProtocol("http://docs.oasis-open.org/wsfed/federation/200706");
         application.setRole("ApplicationServiceType");
         application.setServiceDescription("Fedizhelloworld description");
@@ -228,7 +228,7 @@ public class ApplicationDAOJPATest {
         Application application = new Application();
         application.setRealm("urn:org:apache:cxf:fediz:fedizhelloworld:testaddclaim");
         application.setEncryptionCertificate("");
-        application.setLifeTime("3600");
+        application.setLifeTime(3600);
         application.setProtocol("http://docs.oasis-open.org/wsfed/federation/200706");
         application.setRole("ApplicationServiceType");
         application.setServiceDescription("Fedizhelloworld description");
@@ -281,7 +281,7 @@ public class ApplicationDAOJPATest {
         Application application = new Application();
         application.setRealm("urn:org:apache:cxf:fediz:fedizhelloworld:testremoveclaim");
         application.setEncryptionCertificate("");
-        application.setLifeTime("3600");
+        application.setLifeTime(3600);
         application.setProtocol("http://docs.oasis-open.org/wsfed/federation/200706");
         application.setRole("ApplicationServiceType");
         application.setServiceDescription("Fedizhelloworld description");
@@ -335,7 +335,7 @@ public class ApplicationDAOJPATest {
         Application application = new Application();
         application.setRealm(realm);
         application.setEncryptionCertificate("");
-        application.setLifeTime("3600");
+        application.setLifeTime(3600);
         application.setProtocol("http://docs.oasis-open.org/wsfed/federation/200706");
         application.setRole("ApplicationServiceType");
         application.setServiceDescription("Fedizhelloworld2 description");

Modified: cxf/fediz/trunk/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/service/jpa/IdpDAOJPATest.java
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/service/jpa/IdpDAOJPATest.java?rev=1573232&r1=1573231&r2=1573232&view=diff
==============================================================================
--- cxf/fediz/trunk/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/service/jpa/IdpDAOJPATest.java (original)
+++ cxf/fediz/trunk/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/service/jpa/IdpDAOJPATest.java Sat Mar  1 22:00:39 2014
@@ -18,7 +18,9 @@
  */
 package org.apache.cxf.fediz.service.idp.service.jpa;
 
+import java.net.MalformedURLException;
 import java.net.URI;
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
@@ -66,7 +68,7 @@ public class IdpDAOJPATest {
     
     
     @Test
-    public void testReadExistingIdpEmbeddedAll() {
+    public void testReadExistingIdpEmbeddedAll() throws MalformedURLException {
         Idp idp = idpDAO.getIdp("urn:org:apache:cxf:fediz:idp:realm-A",
                                                                 Arrays.asList("all"));
         
@@ -80,9 +82,9 @@ public class IdpDAOJPATest {
                       "ServiceDescription doesn't match");
         Assert.isTrue("REALM A".equals(idp.getServiceDisplayName()),
                       "ServiceDisplayName doesn't match");        
-        Assert.isTrue("https://localhost:9443/fediz-idp/federation".equals(idp.getIdpUrl()),
+        Assert.isTrue(new URL("https://localhost:9443/fediz-idp/federation").equals(idp.getIdpUrl()),
                       "IdpUrl doesn't match");
-        Assert.isTrue("https://localhost:9443/fediz-idp-sts/REALMA".equals(idp.getStsUrl()),
+        Assert.isTrue(new URL("https://localhost:9443/fediz-idp-sts/REALMA").equals(idp.getStsUrl()),
                       "StsUrl doesn't match");
         Assert.isTrue("realma".equals(idp.getUri()),
                       "Uri doesn't match");
@@ -153,13 +155,13 @@ public class IdpDAOJPATest {
     
     
     @Test
-    public void testAddNewIdp() {
+    public void testAddNewIdp() throws MalformedURLException {
         Idp idp = new Idp();
         idp.setRealm("urn:org:apache:cxf:fediz:idp:testadd");
         idp.setCertificate("stsKeystoreA.properties");
         idp.setCertificatePassword("realma");
-        idp.setIdpUrl("https://localhost:9443/fediz-idp/federation");
-        idp.setStsUrl("https://localhost:9443/fediz-idp-sts/REALMN");
+        idp.setIdpUrl(new URL("https://localhost:9443/fediz-idp/federation"));
+        idp.setStsUrl(new URL("https://localhost:9443/fediz-idp-sts/REALMN"));
         idp.setServiceDisplayName("NEW REALM");
         idp.setServiceDescription("IDP of New Realm");
         idp.setUri("realmn");
@@ -191,9 +193,9 @@ public class IdpDAOJPATest {
                       "ServiceDescription doesn't match");
         Assert.isTrue("NEW REALM".equals(idp.getServiceDisplayName()),
                       "ServiceDisplayName doesn't match");        
-        Assert.isTrue("https://localhost:9443/fediz-idp/federation".equals(idp.getIdpUrl()),
+        Assert.isTrue(new URL("https://localhost:9443/fediz-idp/federation").equals(idp.getIdpUrl()),
                       "IdpUrl doesn't match");
-        Assert.isTrue("https://localhost:9443/fediz-idp-sts/REALMN".equals(idp.getStsUrl()),
+        Assert.isTrue(new URL("https://localhost:9443/fediz-idp-sts/REALMN").equals(idp.getStsUrl()),
                       "StsUrl doesn't match");
         Assert.isTrue("realmn".equals(idp.getUri()),
                       "Uri doesn't match");
@@ -245,7 +247,7 @@ public class IdpDAOJPATest {
     }
     
     @Test
-    public void testUpdateIdp() {
+    public void testUpdateIdp() throws MalformedURLException {
         String realm = "urn:org:apache:cxf:fediz:idp:testupdate";
         //Prepare
         Idp idp = createIdp(realm);
@@ -256,8 +258,8 @@ public class IdpDAOJPATest {
         idp.setRealm(realm);
         idp.setCertificate("UstsKeystoreA.properties");
         idp.setCertificatePassword("Urealma");
-        idp.setIdpUrl("Uhttps://localhost:9443/fediz-idp/federation");
-        idp.setStsUrl("Uhttps://localhost:9443/fediz-idp-sts/REALMA");
+        idp.setIdpUrl(new URL("https://localhost:9443/fediz-idp/federationUU"));
+        idp.setStsUrl(new URL("https://localhost:9443/fediz-idp-sts/REALMAUU"));
         idp.setServiceDisplayName("UNEW REALM");
         idp.setServiceDescription("UIDP of New Realm");
         idp.setUri("Urealmn");
@@ -286,9 +288,9 @@ public class IdpDAOJPATest {
                       "ServiceDescription doesn't match");
         Assert.isTrue("UNEW REALM".equals(idp.getServiceDisplayName()),
                       "ServiceDisplayName doesn't match");        
-        Assert.isTrue("Uhttps://localhost:9443/fediz-idp/federation".equals(idp.getIdpUrl()),
+        Assert.isTrue(new URL("https://localhost:9443/fediz-idp/federationUU").equals(idp.getIdpUrl()),
                       "IdpUrl doesn't match");
-        Assert.isTrue("Uhttps://localhost:9443/fediz-idp-sts/REALMA".equals(idp.getStsUrl()),
+        Assert.isTrue(new URL("https://localhost:9443/fediz-idp-sts/REALMAUU").equals(idp.getStsUrl()),
                       "StsUrl doesn't match");
         Assert.isTrue("Urealmn".equals(idp.getUri()),
                       "Uri doesn't match");
@@ -312,7 +314,7 @@ public class IdpDAOJPATest {
     }
     
     @Test(expected = EmptyResultDataAccessException.class)
-    public void testUpdateUnknownIdp() {
+    public void testUpdateUnknownIdp() throws MalformedURLException {
         String realm = "urn:org:apache:cxf:fediz:idp:testupdate2";
         
         //Prepare
@@ -324,8 +326,8 @@ public class IdpDAOJPATest {
         idp.setRealm(realm);
         idp.setCertificate("UstsKeystoreA.properties");
         idp.setCertificatePassword("Urealma");
-        idp.setIdpUrl("Uhttps://localhost:9443/fediz-idp/federation");
-        idp.setStsUrl("Uhttps://localhost:9443/fediz-idp-sts/REALMN");
+        idp.setIdpUrl(new URL("https://localhost:9443/fediz-idp/federationUU"));
+        idp.setStsUrl(new URL("https://localhost:9443/fediz-idp-sts/REALMNUU"));
         idp.setServiceDisplayName("UNEW REALM");
         idp.setServiceDescription("UIDP of New Realm");
         idp.setUri("Urealmn");
@@ -344,7 +346,7 @@ public class IdpDAOJPATest {
     }
     
     @Test
-    public void testAddClaimToIdp() {
+    public void testAddClaimToIdp() throws MalformedURLException {
         String realm = "urn:org:apache:cxf:fediz:idp:testaddclaim";
         
         //Prepare
@@ -386,7 +388,7 @@ public class IdpDAOJPATest {
     }
     
     @Test
-    public void testRemoveClaimFromIdp() {
+    public void testRemoveClaimFromIdp() throws MalformedURLException {
         String realm = "urn:org:apache:cxf:fediz:fedizhelloworld:testremoveclaim";
         //Prepare step
         Idp idp = createIdp(realm);
@@ -430,7 +432,7 @@ public class IdpDAOJPATest {
     }
     
     @Test
-    public void testAddApplicationToIdp() {
+    public void testAddApplicationToIdp() throws MalformedURLException {
         String realm = "urn:org:apache:cxf:fediz:app:testaddApplication";
         
         //Prepare
@@ -473,7 +475,7 @@ public class IdpDAOJPATest {
     }
     
     @Test
-    public void testRemoveApplicationFromIdp() {
+    public void testRemoveApplicationFromIdp() throws MalformedURLException {
         String realm = "urn:org:apache:cxf:fediz:fedizhelloworld:testremoveapp";
         //Prepare step
         Idp idp = createIdp(realm);
@@ -524,7 +526,7 @@ public class IdpDAOJPATest {
     
     
     @Test
-    public void testAddTrustedIdpToIdp() {
+    public void testAddTrustedIdpToIdp() throws MalformedURLException {
         String realm = "urn:org:apache:cxf:fediz:trusted-idp:testaddTrustedIdp";
         
         //Prepare
@@ -613,13 +615,13 @@ public class IdpDAOJPATest {
     */
     
     
-    private static Idp createIdp(String realm) {
+    private static Idp createIdp(String realm) throws MalformedURLException {
         Idp idp = new Idp();
         idp.setRealm(realm);
         idp.setCertificate("stsKeystoreA.properties");
         idp.setCertificatePassword("realma");
-        idp.setIdpUrl("https://localhost:9443/fediz-idp/federation");
-        idp.setStsUrl("https://localhost:9443/fediz-idp-sts/REALMA");
+        idp.setIdpUrl(new URL("https://localhost:9443/fediz-idp/federation"));
+        idp.setStsUrl(new URL("https://localhost:9443/fediz-idp-sts/REALMA"));
         idp.setServiceDisplayName("NEW REALM");
         idp.setServiceDescription("IDP of New Realm");
         idp.setUri("realma");

Modified: cxf/fediz/trunk/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/service/jpa/TestDBLoader.java
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/service/jpa/TestDBLoader.java?rev=1573232&r1=1573231&r2=1573232&view=diff
==============================================================================
--- cxf/fediz/trunk/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/service/jpa/TestDBLoader.java (original)
+++ cxf/fediz/trunk/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/service/jpa/TestDBLoader.java Sat Mar  1 22:00:39 2014
@@ -21,6 +21,8 @@ package org.apache.cxf.fediz.service.idp
 import javax.persistence.EntityManager;
 import javax.persistence.PersistenceContext;
 
+import org.apache.cxf.fediz.service.idp.domain.FederationType;
+import org.apache.cxf.fediz.service.idp.domain.TrustType;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.transaction.annotation.Transactional;
@@ -55,7 +57,7 @@ public class TestDBLoader implements DBL
                         
             ApplicationEntity entity2 = new ApplicationEntity();
             entity2.setEncryptionCertificate("my encryption cert2");
-            entity2.setLifeTime("22my lifetime");
+            entity2.setLifeTime(1800);
             entity2.setProtocol("22protocol");
             entity2.setRealm("myrealm2");
             entity2.setRole("myrole");
@@ -74,11 +76,11 @@ public class TestDBLoader implements DBL
             entity4.setCacheTokens(true);
             entity4.setCertificate("trusted cert");
             entity4.setDescription("Realm B description");
-            entity4.setFederationType("FederateIdentity");
+            entity4.setFederationType(FederationType.FEDERATE_IDENTITY);
             entity4.setName("Realm B");
             entity4.setProtocol("http://docs.oasis-open.org/wsfed/federation/200706");
             entity4.setRealm("trustedidp2realm");
-            entity4.setTrustType("PEER_TRUST");
+            entity4.setTrustType(TrustType.PEER_TRUST);
             entity4.setUrl("https://localhost:${realmB.port}/fediz-idp-remote/federation");
             em.persist(entity4);
             

Modified: cxf/fediz/trunk/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpDAOJPATest.java
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpDAOJPATest.java?rev=1573232&r1=1573231&r2=1573232&view=diff
==============================================================================
--- cxf/fediz/trunk/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpDAOJPATest.java (original)
+++ cxf/fediz/trunk/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpDAOJPATest.java Sat Mar  1 22:00:39 2014
@@ -20,6 +20,8 @@ package org.apache.cxf.fediz.service.idp
 
 import java.util.List;
 
+import org.apache.cxf.fediz.service.idp.domain.FederationType;
+import org.apache.cxf.fediz.service.idp.domain.TrustType;
 import org.apache.cxf.fediz.service.idp.domain.TrustedIdp;
 import org.apache.cxf.fediz.service.idp.service.TrustedIdpDAO;
 
@@ -62,7 +64,7 @@ public class TrustedIdpDAOJPATest {
                       "Certificate name doesn't match");
         Assert.isTrue("Realm B description".equals(trustedIdp.getDescription()),
                       "Description name doesn't match");
-        Assert.isTrue("FederateIdentity".equals(trustedIdp.getFederationType()),
+        Assert.isTrue(FederationType.FEDERATE_IDENTITY.equals(trustedIdp.getFederationType()),
                       "FederationType doesn't match");        
         Assert.isTrue("Realm B".equals(trustedIdp.getName()),
                       "Name doesn't match");      
@@ -70,7 +72,7 @@ public class TrustedIdpDAOJPATest {
                       "Protocol doesn't match");          
         Assert.isTrue("urn:org:apache:cxf:fediz:idp:realm-B".equals(trustedIdp.getRealm()),
                       "Realm doesn't match");          
-        Assert.isTrue("PEER_TRUST".equals(trustedIdp.getTrustType()),
+        Assert.isTrue(TrustType.PEER_TRUST.equals(trustedIdp.getTrustType()),
                       "TrustType doesn't match");
         Assert.isTrue("https://localhost:12443/fediz-idp-remote/federation".equals(trustedIdp.getUrl()),
                       "Url doesn't match"); 
@@ -96,7 +98,7 @@ public class TrustedIdpDAOJPATest {
                       "Certificate name doesn't match");
         Assert.isTrue("Realm B description".equals(trustedIdp.getDescription()),
                       "Description name doesn't match");
-        Assert.isTrue("FederateIdentity".equals(trustedIdp.getFederationType()),
+        Assert.isTrue(FederationType.FEDERATE_IDENTITY.equals(trustedIdp.getFederationType()),
                       "FederationType doesn't match");        
         Assert.isTrue("Realm B".equals(trustedIdp.getName()),
                       "Name doesn't match");      
@@ -104,9 +106,9 @@ public class TrustedIdpDAOJPATest {
                       "Protocol doesn't match");          
         Assert.isTrue(realm.equals(trustedIdp.getRealm()),
                       "Realm doesn't match");          
-        Assert.isTrue("PEER_TRUST".equals(trustedIdp.getTrustType()),
+        Assert.isTrue(TrustType.PEER_TRUST.equals(trustedIdp.getTrustType()),
                       "TrustType doesn't match");
-        Assert.isTrue("https://localhost:${realmB.port}/fediz-idp-remote/federation".equals(trustedIdp.getUrl()),
+        Assert.isTrue("https://localhost:12443/fediz-idp-remote/federation".equals(trustedIdp.getUrl()),
                       "Url doesn't match"); 
         Assert.isTrue(!trustedIdp.isCacheTokens(), "CacheTokens doesn't match"); 
     }
@@ -125,11 +127,11 @@ public class TrustedIdpDAOJPATest {
         trustedIdp.setCacheTokens(true);
         trustedIdp.setCertificate("Utrusted cert");
         trustedIdp.setDescription("URealm B description");
-        trustedIdp.setFederationType("UFederateIdentity");
+        trustedIdp.setFederationType(FederationType.FEDERATE_CLAIMS);
         trustedIdp.setName("URealm B");
         trustedIdp.setProtocol("Uhttp://docs.oasis-open.org/wsfed/federation/200706");
-        trustedIdp.setTrustType("UPEER_TRUST");
-        trustedIdp.setUrl("Uhttps://localhost:${realmB.port}/fediz-idp-remote/federation");
+        trustedIdp.setTrustType(TrustType.INDIRECT_TRUST);
+        trustedIdp.setUrl("Uhttps://localhost:12443/fediz-idp-remote/federation");
         
         trustedIdpDAO.updateTrustedIDP(realm, trustedIdp);
         
@@ -139,7 +141,7 @@ public class TrustedIdpDAOJPATest {
                       "Certificate name doesn't match");
         Assert.isTrue("URealm B description".equals(trustedIdp.getDescription()),
                       "Description name doesn't match");
-        Assert.isTrue("UFederateIdentity".equals(trustedIdp.getFederationType()),
+        Assert.isTrue(FederationType.FEDERATE_CLAIMS.equals(trustedIdp.getFederationType()),
                       "FederationType doesn't match");        
         Assert.isTrue("URealm B".equals(trustedIdp.getName()),
                       "Name doesn't match");      
@@ -147,9 +149,9 @@ public class TrustedIdpDAOJPATest {
                       "Protocol doesn't match");          
         Assert.isTrue(realm.equals(trustedIdp.getRealm()),
                       "Realm doesn't match");          
-        Assert.isTrue("UPEER_TRUST".equals(trustedIdp.getTrustType()),
+        Assert.isTrue(TrustType.INDIRECT_TRUST.equals(trustedIdp.getTrustType()),
                       "TrustType doesn't match");
-        Assert.isTrue("Uhttps://localhost:${realmB.port}/fediz-idp-remote/federation".equals(trustedIdp.getUrl()),
+        Assert.isTrue("Uhttps://localhost:12443/fediz-idp-remote/federation".equals(trustedIdp.getUrl()),
                       "Url doesn't match"); 
         Assert.isTrue(trustedIdp.isCacheTokens(), "CacheTokens doesn't match");
         
@@ -190,11 +192,11 @@ public class TrustedIdpDAOJPATest {
         trustedIdp.setCacheTokens(false);
         trustedIdp.setCertificate("realmb.cert");
         trustedIdp.setDescription("Realm B description");
-        trustedIdp.setFederationType("FederateIdentity");
+        trustedIdp.setFederationType(FederationType.FEDERATE_IDENTITY);
         trustedIdp.setName("Realm B");
         trustedIdp.setProtocol("http://docs.oasis-open.org/wsfed/federation/200706");
-        trustedIdp.setTrustType("PEER_TRUST");
-        trustedIdp.setUrl("https://localhost:${realmB.port}/fediz-idp-remote/federation");
+        trustedIdp.setTrustType(TrustType.PEER_TRUST);
+        trustedIdp.setUrl("https://localhost:12443/fediz-idp-remote/federation");
         return trustedIdp;
     }
     

Modified: cxf/fediz/trunk/services/idp/src/test/resources/idp-config.xml
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/test/resources/idp-config.xml?rev=1573232&r1=1573231&r2=1573232&view=diff
==============================================================================
--- cxf/fediz/trunk/services/idp/src/test/resources/idp-config.xml (original)
+++ cxf/fediz/trunk/services/idp/src/test/resources/idp-config.xml Sat Mar  1 22:00:39 2014
@@ -110,7 +110,7 @@
         <property name="trustType" value="PEER_TRUST" />  <!-- Required for Fediz Core, Process SignInResponse -->
         <property name="protocol"
             value="http://docs.oasis-open.org/wsfed/federation/200706" />
-        <property name="federationType" value="FederateIdentity" /> <!-- Required for STS Relationship -->
+        <property name="federationType" value="FEDERATE_IDENTITY" /> <!-- Required for STS Relationship -->
         <property name="name" value="REALM B" />
         <property name="description" value="IDP of Realm B" />
         <!--<property name="logo" value="true" /> -->



Mime
View raw message