syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbernha...@apache.org
Subject svn commit: r1442169 - in /syncope/trunk: client/src/main/java/org/apache/syncope/client/services/proxy/ common/src/main/java/org/apache/syncope/common/services/ common/src/main/java/org/apache/syncope/common/types/ console/src/main/java/org/apache/syn...
Date Mon, 04 Feb 2013 16:37:05 GMT
Author: jbernhardt
Date: Mon Feb  4 16:37:04 2013
New Revision: 1442169

URL: http://svn.apache.org/viewvc?rev=1442169&view=rev
Log:
[[SYNCOPE-231]
* Extracting SchemaType from SchemaService Interface

Added:
    syncope/trunk/common/src/main/java/org/apache/syncope/common/types/SchemaType.java
Modified:
    syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/SchemaServiceProxy.java
    syncope/trunk/common/src/main/java/org/apache/syncope/common/services/SchemaService.java
    syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/SchemaRestClient.java
    syncope/trunk/core/src/main/java/org/apache/syncope/core/services/SchemaServiceImpl.java
    syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/AbstractTest.java
    syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/AuthenticationTestITCase.java
    syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/DerivedSchemaTestITCase.java
    syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/SchemaTestITCase.java
    syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/VirtualSchemaTestITCase.java

Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/SchemaServiceProxy.java
URL: http://svn.apache.org/viewvc/syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/SchemaServiceProxy.java?rev=1442169&r1=1442168&r2=1442169&view=diff
==============================================================================
--- syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/SchemaServiceProxy.java
(original)
+++ syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/SchemaServiceProxy.java
Mon Feb  4 16:37:04 2013
@@ -34,6 +34,7 @@ import org.apache.syncope.common.to.Deri
 import org.apache.syncope.common.to.SchemaTO;
 import org.apache.syncope.common.to.VirtualSchemaTO;
 import org.apache.syncope.common.types.AttributableType;
+import org.apache.syncope.common.types.SchemaType;
 import org.springframework.web.client.RestTemplate;
 
 @SuppressWarnings("unchecked")

Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/SchemaService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/SchemaService.java?rev=1442169&r1=1442168&r2=1442169&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/SchemaService.java
(original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/SchemaService.java
Mon Feb  4 16:37:04 2013
@@ -26,47 +26,13 @@ import javax.ws.rs.PUT;
 import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
 import javax.ws.rs.core.Response;
-import javax.xml.bind.annotation.XmlEnum;
 import org.apache.syncope.common.to.AbstractSchemaTO;
 import org.apache.syncope.common.types.AttributableType;
+import org.apache.syncope.common.types.SchemaType;
 
 @Path("schemas/{kind}/{type}")
 public interface SchemaService {
 
-    @XmlEnum
-    enum SchemaType {
-
-        /**
-         * Derived schema calculated based on other attributes.
-         */
-        DERIVED("derivedSchema"),
-
-        /**
-         * Standard schema for normal attributes to be stored within syncope.
-         */
-        NORMAL("schema"),
-
-        /**
-         * Virtual schema for attributes fetched from remote resources only.
-         */
-        VIRTUAL("virtualSchema");
-
-        public static SchemaType fromString(String value) {
-            return SchemaType.valueOf(value.toUpperCase());
-        }
-
-        // TODO remove name once CXF migration is complete
-        private final String name;
-
-        private SchemaType(String name) {
-            this.name = name;
-        }
-
-        public String toSpringURL() {
-            return name;
-        }
-    }
-
     /**
      * @param kind Kind for schema to be created
      * @param type Type for schema to be created

Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/types/SchemaType.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/types/SchemaType.java?rev=1442169&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/types/SchemaType.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/types/SchemaType.java Mon
Feb  4 16:37:04 2013
@@ -0,0 +1,56 @@
+/*
+ * 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.syncope.common.types;
+
+import javax.xml.bind.annotation.XmlEnum;
+
+@XmlEnum
+public
+enum SchemaType {
+
+    /**
+     * Derived schema calculated based on other attributes.
+     */
+    DERIVED("derivedSchema"),
+
+    /**
+     * Standard schema for normal attributes to be stored within syncope.
+     */
+    NORMAL("schema"),
+
+    /**
+     * Virtual schema for attributes fetched from remote resources only.
+     */
+    VIRTUAL("virtualSchema");
+
+    public static SchemaType fromString(String value) {
+        return SchemaType.valueOf(value.toUpperCase());
+    }
+
+    // TODO remove name once CXF migration is complete
+    private final String name;
+
+    private SchemaType(String name) {
+        this.name = name;
+    }
+
+    public String toSpringURL() {
+        return name;
+    }
+}
\ No newline at end of file

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/SchemaRestClient.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/SchemaRestClient.java?rev=1442169&r1=1442168&r2=1442169&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/SchemaRestClient.java
(original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/SchemaRestClient.java
Mon Feb  4 16:37:04 2013
@@ -23,12 +23,12 @@ import java.util.List;
 
 import org.apache.syncope.common.services.ConfigurationService;
 import org.apache.syncope.common.services.SchemaService;
-import org.apache.syncope.common.services.SchemaService.SchemaType;
 import org.apache.syncope.common.to.DerivedSchemaTO;
 import org.apache.syncope.common.to.SchemaTO;
 import org.apache.syncope.common.to.ValidatorTO;
 import org.apache.syncope.common.to.VirtualSchemaTO;
 import org.apache.syncope.common.types.AttributableType;
+import org.apache.syncope.common.types.SchemaType;
 import org.apache.syncope.common.util.CollectionWrapper;
 import org.apache.syncope.common.validation.SyncopeClientCompositeErrorException;
 import org.springframework.stereotype.Component;

Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/services/SchemaServiceImpl.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/services/SchemaServiceImpl.java?rev=1442169&r1=1442168&r2=1442169&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/services/SchemaServiceImpl.java
(original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/services/SchemaServiceImpl.java
Mon Feb  4 16:37:04 2013
@@ -32,6 +32,7 @@ import org.apache.syncope.common.to.Deri
 import org.apache.syncope.common.to.SchemaTO;
 import org.apache.syncope.common.to.VirtualSchemaTO;
 import org.apache.syncope.common.types.AttributableType;
+import org.apache.syncope.common.types.SchemaType;
 import org.apache.syncope.core.rest.controller.DerivedSchemaController;
 import org.apache.syncope.core.rest.controller.SchemaController;
 import org.apache.syncope.core.rest.controller.VirtualSchemaController;

Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/AbstractTest.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/AbstractTest.java?rev=1442169&r1=1442168&r2=1442169&view=diff
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/AbstractTest.java (original)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/AbstractTest.java Mon Feb
 4 16:37:04 2013
@@ -67,7 +67,6 @@ import org.apache.syncope.common.service
 import org.apache.syncope.common.services.UserRequestService;
 import org.apache.syncope.common.services.UserService;
 import org.apache.syncope.common.services.WorkflowService;
-import org.apache.syncope.common.services.SchemaService.SchemaType;
 import org.apache.syncope.common.to.AbstractSchemaTO;
 import org.apache.syncope.common.to.AttributeTO;
 import org.apache.syncope.common.to.PolicyTO;
@@ -76,6 +75,7 @@ import org.apache.syncope.common.to.Role
 import org.apache.syncope.common.to.UserTO;
 import org.apache.syncope.common.types.AttributableType;
 import org.apache.syncope.common.types.PolicyType;
+import org.apache.syncope.common.types.SchemaType;
 import org.apache.syncope.common.validation.SyncopeClientErrorHandler;
 import org.junit.Before;
 import org.junit.runner.RunWith;

Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/AuthenticationTestITCase.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/AuthenticationTestITCase.java?rev=1442169&r1=1442168&r2=1442169&view=diff
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/AuthenticationTestITCase.java
(original)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/AuthenticationTestITCase.java
Mon Feb  4 16:37:04 2013
@@ -44,6 +44,7 @@ import org.apache.syncope.common.to.Sche
 import org.apache.syncope.common.to.UserTO;
 import org.apache.syncope.common.types.AttributableType;
 import org.apache.syncope.common.types.AttributeSchemaType;
+import org.apache.syncope.common.types.SchemaType;
 import org.apache.syncope.common.types.SyncopeClientExceptionType;
 import org.apache.syncope.common.validation.SyncopeClientCompositeErrorException;
 import org.apache.syncope.common.validation.SyncopeClientException;
@@ -91,7 +92,7 @@ public class AuthenticationTestITCase ex
         schemaTO.setMandatoryCondition("false");
         schemaTO.setType(AttributeSchemaType.String);
 
-        response = createSchema(AttributableType.USER, SchemaService.SchemaType.NORMAL, schemaTO);
+        response = createSchema(AttributableType.USER, SchemaType.NORMAL, schemaTO);
         SchemaTO newSchemaTO = getObject(response, SchemaTO.class, entitlementService);
         assertEquals(schemaTO, newSchemaTO);
 
@@ -110,18 +111,18 @@ public class AuthenticationTestITCase ex
         assertNotNull(userTO);
 
         // 3. read the schema created above (as admin) - success
-        schemaTO = schemaService.read(AttributableType.USER, SchemaService.SchemaType.NORMAL,
schemaName);
+        schemaTO = schemaService.read(AttributableType.USER, SchemaType.NORMAL, schemaName);
         assertNotNull(schemaTO);
 
         // 4. read the schema created above (as user) - success
         SchemaService schemaService2 = setupCredentials(schemaService, SchemaService.class,
userTO.getUsername(), "password123");
 
-        schemaTO = schemaService2.read(AttributableType.USER, SchemaService.SchemaType.NORMAL,
schemaName);
+        schemaTO = schemaService2.read(AttributableType.USER, SchemaType.NORMAL, schemaName);
         assertNotNull(schemaTO);
 
         // 5. update the schema create above (as user) - failure
         try {
-            schemaService2.update(AttributableType.ROLE, SchemaService.SchemaType.NORMAL,
schemaName, schemaTO);
+            schemaService2.update(AttributableType.ROLE, SchemaType.NORMAL, schemaName, schemaTO);
             fail("Schemaupdate as user schould not work");
         } catch (HttpClientErrorException e) {
             assertNotNull(e);

Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/DerivedSchemaTestITCase.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/DerivedSchemaTestITCase.java?rev=1442169&r1=1442168&r2=1442169&view=diff
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/DerivedSchemaTestITCase.java
(original)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/DerivedSchemaTestITCase.java
Mon Feb  4 16:37:04 2013
@@ -27,9 +27,9 @@ import java.util.List;
 import javax.ws.rs.core.Response;
 
 import org.apache.http.HttpStatus;
-import org.apache.syncope.common.services.SchemaService;
 import org.apache.syncope.common.to.DerivedSchemaTO;
 import org.apache.syncope.common.types.AttributableType;
+import org.apache.syncope.common.types.SchemaType;
 import org.apache.syncope.common.types.SyncopeClientExceptionType;
 import org.apache.syncope.common.validation.SyncopeClientCompositeErrorException;
 import org.junit.FixMethodOrder;
@@ -43,7 +43,7 @@ public class DerivedSchemaTestITCase ext
     public void list() {
         @SuppressWarnings("unchecked")
         List<DerivedSchemaTO> derivedSchemas = (List<DerivedSchemaTO>) schemaService.list(AttributableType.USER,
-                SchemaService.SchemaType.DERIVED);
+                SchemaType.DERIVED);
         assertFalse(derivedSchemas.isEmpty());
         for (DerivedSchemaTO derivedSchemaTO : derivedSchemas) {
             assertNotNull(derivedSchemaTO);
@@ -52,7 +52,7 @@ public class DerivedSchemaTestITCase ext
 
     @Test
     public void read() {
-        DerivedSchemaTO derivedSchemaTO = schemaService.read(AttributableType.USER, SchemaService.SchemaType.DERIVED,
+        DerivedSchemaTO derivedSchemaTO = schemaService.read(AttributableType.USER, SchemaType.DERIVED,
                 "cn");
         assertNotNull(derivedSchemaTO);
     }
@@ -63,33 +63,33 @@ public class DerivedSchemaTestITCase ext
         schema.setName("derived");
         schema.setExpression("derived_sx + '_' + derived_dx");
 
-        Response response = createSchema(AttributableType.USER, SchemaService.SchemaType.DERIVED,
schema);
+        Response response = createSchema(AttributableType.USER, SchemaType.DERIVED, schema);
         DerivedSchemaTO actual = getObject(response, DerivedSchemaTO.class, schemaService);
         assertNotNull(actual);
 
-        actual = schemaService.read(AttributableType.USER, SchemaService.SchemaType.DERIVED,
actual.getName());
+        actual = schemaService.read(AttributableType.USER, SchemaType.DERIVED, actual.getName());
         assertNotNull(actual);
         assertEquals(actual.getExpression(), "derived_sx + '_' + derived_dx");
     }
 
     @Test
     public void delete() {
-        DerivedSchemaTO schema = schemaService.read(AttributableType.ROLE, SchemaService.SchemaType.DERIVED,
+        DerivedSchemaTO schema = schemaService.read(AttributableType.ROLE, SchemaType.DERIVED,
                 "rderiveddata");
         assertNotNull(schema);
 
-        schemaService.delete(AttributableType.ROLE, SchemaService.SchemaType.DERIVED,
+        schemaService.delete(AttributableType.ROLE, SchemaType.DERIVED,
                 schema.getName());
 
         Throwable t = null;
         try {
-            schemaService.read(AttributableType.ROLE, SchemaService.SchemaType.DERIVED, "rderiveddata");
+            schemaService.read(AttributableType.ROLE, SchemaType.DERIVED, "rderiveddata");
         } catch (SyncopeClientCompositeErrorException e) {
             t = e;
             assertNotNull(e.getException(SyncopeClientExceptionType.NotFound));
         } finally {
             // Recreate schema to make test re-runnable
-            Response response = createSchema(AttributableType.ROLE, SchemaService.SchemaType.DERIVED,
schema);
+            Response response = createSchema(AttributableType.ROLE, SchemaType.DERIVED, schema);
             assertNotNull(response);
             assertEquals(HttpStatus.SC_CREATED, response.getStatus());
         }
@@ -98,23 +98,23 @@ public class DerivedSchemaTestITCase ext
 
     @Test
     public void update() {
-        DerivedSchemaTO schema = schemaService.read(AttributableType.MEMBERSHIP, SchemaService.SchemaType.DERIVED,
+        DerivedSchemaTO schema = schemaService.read(AttributableType.MEMBERSHIP, SchemaType.DERIVED,
                 "mderiveddata");
         assertNotNull(schema);
         assertEquals("mderived_sx + '-' + mderived_dx", schema.getExpression());
         try {
             schema.setExpression("mderived_sx + '.' + mderived_dx");
 
-            schemaService.update(AttributableType.MEMBERSHIP, SchemaService.SchemaType.DERIVED,
+            schemaService.update(AttributableType.MEMBERSHIP, SchemaType.DERIVED,
                     schema.getName(), schema);
 
-            schema = schemaService.read(AttributableType.MEMBERSHIP, SchemaService.SchemaType.DERIVED,
"mderiveddata");
+            schema = schemaService.read(AttributableType.MEMBERSHIP, SchemaType.DERIVED,
"mderiveddata");
             assertNotNull(schema);
             assertEquals("mderived_sx + '.' + mderived_dx", schema.getExpression());
         } finally {
             // Set updated back to make test re-runnable
             schema.setExpression("mderived_sx + '-' + mderived_dx");
-            schemaService.update(AttributableType.MEMBERSHIP, SchemaService.SchemaType.DERIVED,
+            schemaService.update(AttributableType.MEMBERSHIP, SchemaType.DERIVED,
                     schema.getName(), schema);
         }
     }

Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/SchemaTestITCase.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/SchemaTestITCase.java?rev=1442169&r1=1442168&r2=1442169&view=diff
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/SchemaTestITCase.java (original)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/SchemaTestITCase.java Mon
Feb  4 16:37:04 2013
@@ -30,13 +30,13 @@ import java.util.List;
 import javax.ws.rs.core.Response;
 
 import org.apache.syncope.common.mod.UserMod;
-import org.apache.syncope.common.services.SchemaService;
 import org.apache.syncope.common.to.MembershipTO;
 import org.apache.syncope.common.to.SchemaTO;
 import org.apache.syncope.common.to.UserTO;
 import org.apache.syncope.common.types.AttributableType;
 import org.apache.syncope.common.types.EntityViolationType;
 import org.apache.syncope.common.types.AttributeSchemaType;
+import org.apache.syncope.common.types.SchemaType;
 import org.apache.syncope.common.types.SyncopeClientExceptionType;
 import org.apache.syncope.common.util.AttributableOperations;
 import org.apache.syncope.common.validation.SyncopeClientCompositeErrorException;
@@ -55,11 +55,11 @@ public class SchemaTestITCase extends Ab
         SchemaTO schemaTO = buildSchemaTO("testAttribute", AttributeSchemaType.String);
         schemaTO.setMandatoryCondition("false");
 
-        Response response = createSchema(AttributableType.USER, SchemaService.SchemaType.NORMAL,
schemaTO);
+        Response response = createSchema(AttributableType.USER, SchemaType.NORMAL, schemaTO);
         SchemaTO newSchemaTO = getObject(response, SchemaTO.class, schemaService);
         assertEquals(schemaTO, newSchemaTO);
 
-        response = createSchema(AttributableType.MEMBERSHIP, SchemaService.SchemaType.NORMAL,
schemaTO);
+        response = createSchema(AttributableType.MEMBERSHIP, SchemaType.NORMAL, schemaTO);
         newSchemaTO = getObject(response, SchemaTO.class, schemaService);
         assertEquals(schemaTO, newSchemaTO);
     }
@@ -71,7 +71,7 @@ public class SchemaTestITCase extends Ab
         schemaTO.setType(AttributeSchemaType.String);
 
         try {
-            createSchema(AttributableType.USER, SchemaService.SchemaType.NORMAL, schemaTO);
+            createSchema(AttributableType.USER, SchemaType.NORMAL, schemaTO);
             fail("This should not be reacheable");
         } catch (SyncopeClientCompositeErrorException scce) {
             SyncopeClientException sce = scce.getException(SyncopeClientExceptionType.InvalidUSchema);
@@ -89,7 +89,7 @@ public class SchemaTestITCase extends Ab
         schemaTO.setType(AttributeSchemaType.Enum);
 
         try {
-            createSchema(AttributableType.ROLE, SchemaService.SchemaType.NORMAL, schemaTO);
+            createSchema(AttributableType.ROLE, SchemaType.NORMAL, schemaTO);
             fail("This should not be reacheable");
         } catch (SyncopeClientCompositeErrorException scce) {
             SyncopeClientException sce = scce.getException(SyncopeClientExceptionType.InvalidRSchema);
@@ -108,7 +108,7 @@ public class SchemaTestITCase extends Ab
         schemaTO.setType(AttributeSchemaType.Enum);
 
         try {
-            createSchema(AttributableType.USER, SchemaService.SchemaType.NORMAL, schemaTO);
+            createSchema(AttributableType.USER, SchemaType.NORMAL, schemaTO);
             fail("This should not be reacheable");
         } catch (SyncopeClientCompositeErrorException scce) {
             SyncopeClientException sce = scce.getException(SyncopeClientExceptionType.InvalidUSchema);
@@ -124,12 +124,12 @@ public class SchemaTestITCase extends Ab
     public void delete() {
         SchemaTO schemaTO = buildSchemaTO("todelete", AttributeSchemaType.String);
         schemaTO.setMandatoryCondition("false");
-        createSchema(AttributableType.USER, SchemaService.SchemaType.NORMAL, schemaTO);
+        createSchema(AttributableType.USER, SchemaType.NORMAL, schemaTO);
 
-        schemaService.delete(AttributableType.USER, SchemaService.SchemaType.NORMAL, schemaTO.getName());
+        schemaService.delete(AttributableType.USER, SchemaType.NORMAL, schemaTO.getName());
         SchemaTO firstname = null;
         try {
-            firstname = schemaService.read(AttributableType.USER, SchemaService.SchemaType.NORMAL,
schemaTO.getName());
+            firstname = schemaService.read(AttributableType.USER, SchemaType.NORMAL, schemaTO.getName());
         } catch (HttpClientErrorException e) {
             assertEquals(HttpStatus.NOT_FOUND, e.getStatusCode());
         }
@@ -139,20 +139,20 @@ public class SchemaTestITCase extends Ab
     @SuppressWarnings("unchecked")
     @Test
     public void list() {
-        List<SchemaTO> userSchemas = (List<SchemaTO>) schemaService.list(AttributableType.USER,
SchemaService.SchemaType.NORMAL);
+        List<SchemaTO> userSchemas = (List<SchemaTO>) schemaService.list(AttributableType.USER,
SchemaType.NORMAL);
         assertFalse(userSchemas.isEmpty());
         for (SchemaTO schemaTO : userSchemas) {
             assertNotNull(schemaTO);
         }
 
-        List<SchemaTO> roleSchemas = (List<SchemaTO>) schemaService.list(AttributableType.ROLE,
SchemaService.SchemaType.NORMAL);
+        List<SchemaTO> roleSchemas = (List<SchemaTO>) schemaService.list(AttributableType.ROLE,
SchemaType.NORMAL);
         assertFalse(roleSchemas.isEmpty());
         for (SchemaTO schemaTO : roleSchemas) {
             assertNotNull(schemaTO);
         }
 
         List<SchemaTO> membershipSchemas = (List<SchemaTO>) schemaService.list(AttributableType.MEMBERSHIP,
-                SchemaService.SchemaType.NORMAL);
+                SchemaType.NORMAL);
         assertFalse(membershipSchemas.isEmpty());
         for (SchemaTO schemaTO : membershipSchemas) {
             assertNotNull(schemaTO);
@@ -161,17 +161,17 @@ public class SchemaTestITCase extends Ab
 
     @Test
     public void update() {
-        SchemaTO schemaTO = schemaService.read(AttributableType.ROLE, SchemaService.SchemaType.NORMAL,
"icon");
+        SchemaTO schemaTO = schemaService.read(AttributableType.ROLE, SchemaType.NORMAL,
"icon");
         assertNotNull(schemaTO);
 
-        schemaService.update(AttributableType.ROLE, SchemaService.SchemaType.NORMAL,
+        schemaService.update(AttributableType.ROLE, SchemaType.NORMAL,
                 schemaTO.getName(), schemaTO);
-        SchemaTO updatedTO = schemaService.read(AttributableType.ROLE, SchemaService.SchemaType.NORMAL,
"icon");
+        SchemaTO updatedTO = schemaService.read(AttributableType.ROLE, SchemaType.NORMAL,
"icon");
         assertEquals(schemaTO, updatedTO);
 
         updatedTO.setType(AttributeSchemaType.Date);
         try {
-            schemaService.update(AttributableType.ROLE, SchemaService.SchemaType.NORMAL,
schemaTO.getName(), updatedTO);
+            schemaService.update(AttributableType.ROLE, SchemaType.NORMAL, schemaTO.getName(),
updatedTO);
             fail("This should not be reacheable");
         } catch (SyncopeClientCompositeErrorException scce) {
             SyncopeClientException sce = scce.getException(SyncopeClientExceptionType.InvalidRSchema);
@@ -185,7 +185,7 @@ public class SchemaTestITCase extends Ab
         schemaTO.setName("schema_issue258");
         schemaTO.setType(AttributeSchemaType.Double);
 
-        Response response = createSchema(AttributableType.USER, SchemaService.SchemaType.NORMAL,
schemaTO);
+        Response response = createSchema(AttributableType.USER, SchemaType.NORMAL, schemaTO);
         schemaTO = getObject(response, SchemaTO.class, schemaService);
         assertNotNull(schemaTO);
 
@@ -197,7 +197,7 @@ public class SchemaTestITCase extends Ab
 
         schemaTO.setType(AttributeSchemaType.Long);
         try {
-            schemaService.update(AttributableType.USER, SchemaService.SchemaType.NORMAL,
schemaTO.getName(), schemaTO);
+            schemaService.update(AttributableType.USER, SchemaType.NORMAL, schemaTO.getName(),
schemaTO);
             fail("This should not be reacheable");
         } catch (SyncopeClientCompositeErrorException scce) {
             SyncopeClientException sce = scce.getException(SyncopeClientExceptionType.InvalidUSchema);
@@ -210,7 +210,7 @@ public class SchemaTestITCase extends Ab
         SchemaTO schemaTO = buildSchemaTO("schema_issue259", AttributeSchemaType.Double);
         schemaTO.setUniqueConstraint(true);
 
-        Response response = createSchema(AttributableType.USER, SchemaService.SchemaType.NORMAL,
schemaTO);
+        Response response = createSchema(AttributableType.USER, SchemaType.NORMAL, schemaTO);
         schemaTO = getObject(response, SchemaTO.class, schemaService);
         assertNotNull(schemaTO);
 
@@ -235,7 +235,7 @@ public class SchemaTestITCase extends Ab
         SchemaTO schemaTO = buildSchemaTO("schema_issue260", AttributeSchemaType.Double);
         schemaTO.setUniqueConstraint(true);
 
-        Response response = createSchema(AttributableType.USER, SchemaService.SchemaType.NORMAL,
schemaTO);
+        Response response = createSchema(AttributableType.USER, SchemaType.NORMAL, schemaTO);
         schemaTO = getObject(response, SchemaTO.class, schemaService);
         assertNotNull(schemaTO);
 
@@ -246,7 +246,7 @@ public class SchemaTestITCase extends Ab
 
         schemaTO.setUniqueConstraint(false);
         try {
-            schemaService.update(AttributableType.USER, SchemaService.SchemaType.NORMAL,
schemaTO.getName(), schemaTO);
+            schemaService.update(AttributableType.USER, SchemaType.NORMAL, schemaTO.getName(),
schemaTO);
             fail("This should not be reacheable");
         } catch (SyncopeClientCompositeErrorException scce) {
             SyncopeClientException sce = scce.getException(SyncopeClientExceptionType.InvalidUSchema);

Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/VirtualSchemaTestITCase.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/VirtualSchemaTestITCase.java?rev=1442169&r1=1442168&r2=1442169&view=diff
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/VirtualSchemaTestITCase.java
(original)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/VirtualSchemaTestITCase.java
Mon Feb  4 16:37:04 2013
@@ -25,9 +25,9 @@ import java.util.List;
 
 import javax.ws.rs.core.Response;
 
-import org.apache.syncope.common.services.SchemaService;
 import org.apache.syncope.common.to.VirtualSchemaTO;
 import org.apache.syncope.common.types.AttributableType;
+import org.apache.syncope.common.types.SchemaType;
 import org.apache.syncope.common.types.SyncopeClientExceptionType;
 import org.apache.syncope.common.validation.SyncopeClientCompositeErrorException;
 import org.junit.FixMethodOrder;
@@ -40,7 +40,7 @@ public class VirtualSchemaTestITCase ext
     @Test
     public void list() {
         @SuppressWarnings("unchecked")
-        List<VirtualSchemaTO> vSchemas = (List<VirtualSchemaTO>) schemaService.list(AttributableType.USER,
SchemaService.SchemaType.VIRTUAL);
+        List<VirtualSchemaTO> vSchemas = (List<VirtualSchemaTO>) schemaService.list(AttributableType.USER,
SchemaType.VIRTUAL);
         assertFalse(vSchemas.isEmpty());
         for (VirtualSchemaTO vSchemaTO : vSchemas) {
             assertNotNull(vSchemaTO);
@@ -49,7 +49,7 @@ public class VirtualSchemaTestITCase ext
 
     @Test
     public void read() {
-        VirtualSchemaTO vSchemaTO = schemaService.read(AttributableType.MEMBERSHIP, SchemaService.SchemaType.VIRTUAL,
+        VirtualSchemaTO vSchemaTO = schemaService.read(AttributableType.MEMBERSHIP, SchemaType.VIRTUAL,
                 "mvirtualdata");
         assertNotNull(vSchemaTO);
     }
@@ -59,26 +59,26 @@ public class VirtualSchemaTestITCase ext
         VirtualSchemaTO schema = new VirtualSchemaTO();
         schema.setName("virtual");
 
-        Response response = createSchema(AttributableType.USER, SchemaService.SchemaType.VIRTUAL,
schema);
+        Response response = createSchema(AttributableType.USER, SchemaType.VIRTUAL, schema);
         VirtualSchemaTO actual = getObject(response, VirtualSchemaTO.class, schemaService);
         assertNotNull(actual);
 
-        actual = schemaService.read(AttributableType.USER, SchemaService.SchemaType.VIRTUAL,
actual.getName());
+        actual = schemaService.read(AttributableType.USER, SchemaType.VIRTUAL, actual.getName());
         assertNotNull(actual);
     }
 
     @Test
     public void delete() {
-        VirtualSchemaTO schema = schemaService.read(AttributableType.ROLE, SchemaService.SchemaType.VIRTUAL,
+        VirtualSchemaTO schema = schemaService.read(AttributableType.ROLE, SchemaType.VIRTUAL,
                 "rvirtualdata");
         assertNotNull(schema);
 
-        schemaService.delete(AttributableType.ROLE, SchemaService.SchemaType.VIRTUAL,
+        schemaService.delete(AttributableType.ROLE, SchemaType.VIRTUAL,
                 schema.getName());
 
         Throwable t = null;
         try {
-            schemaService.read(AttributableType.ROLE, SchemaService.SchemaType.VIRTUAL, "rvirtualdata");
+            schemaService.read(AttributableType.ROLE, SchemaType.VIRTUAL, "rvirtualdata");
         } catch (SyncopeClientCompositeErrorException e) {
             t = e;
             assertNotNull(e.getException(SyncopeClientExceptionType.NotFound));



Mime
View raw message