diff --git a/infra/schema/src/main/resources/META-INF/catalog.xml b/infra/schema/src/main/resources/META-INF/catalog.xml index ec7028a25e2..078ea6e8baa 100644 --- a/infra/schema/src/main/resources/META-INF/catalog.xml +++ b/infra/schema/src/main/resources/META-INF/catalog.xml @@ -38,6 +38,9 @@ + + + diff --git a/infra/schema/src/main/resources/xml/ns/public/model/model-1.wsdl b/infra/schema/src/main/resources/xml/ns/public/model/model-1.wsdl index 951023d2e50..d26bca56d74 100644 --- a/infra/schema/src/main/resources/xml/ns/public/model/model-1.wsdl +++ b/infra/schema/src/main/resources/xml/ns/public/model/model-1.wsdl @@ -52,7 +52,7 @@ - + + + diff --git a/infra/schema/src/main/resources/xml/ns/public/resource/capabilities-2.xsd b/infra/schema/src/main/resources/xml/ns/public/resource/capabilities-2.xsd index 43a59f51611..8d6c8028203 100644 --- a/infra/schema/src/main/resources/xml/ns/public/resource/capabilities-2.xsd +++ b/infra/schema/src/main/resources/xml/ns/public/resource/capabilities-2.xsd @@ -44,7 +44,8 @@ - + Import of the common schema. Some datatypes are reused here. diff --git a/model/model-client/pom.xml b/model/model-client/pom.xml index 2c11932c861..9ea915c5522 100644 --- a/model/model-client/pom.xml +++ b/model/model-client/pom.xml @@ -191,44 +191,6 @@ - wsdl2java @@ -253,35 +215,6 @@ - - - diff --git a/model/model-client/src/compile/resources/catalog.xml b/model/model-client/src/compile/resources/catalog.xml index e85e9b8481f..d232b89a445 100644 --- a/model/model-client/src/compile/resources/catalog.xml +++ b/model/model-client/src/compile/resources/catalog.xml @@ -38,6 +38,9 @@ + + + diff --git a/model/model-client/src/main/resources/META-INF/catalog.xml b/model/model-client/src/main/resources/META-INF/catalog.xml index a4fec2aad4b..f1ecbeb4e87 100644 --- a/model/model-client/src/main/resources/META-INF/catalog.xml +++ b/model/model-client/src/main/resources/META-INF/catalog.xml @@ -36,7 +36,10 @@ - + + + + diff --git a/samples/model-client-sample/src/main/java/com/evolveum/midpoint/testing/model/client/sample/Main.java b/samples/model-client-sample/src/main/java/com/evolveum/midpoint/testing/model/client/sample/Main.java index bcb72a1cfdc..09fc2c5383e 100644 --- a/samples/model-client-sample/src/main/java/com/evolveum/midpoint/testing/model/client/sample/Main.java +++ b/samples/model-client-sample/src/main/java/com/evolveum/midpoint/testing/model/client/sample/Main.java @@ -48,6 +48,7 @@ import com.evolveum.midpoint.xml.ns._public.common.common_2a.OperationResultType; import com.evolveum.midpoint.xml.ns._public.common.common_2a.PasswordType; import com.evolveum.midpoint.xml.ns._public.common.common_2a.ProtectedStringType; +import com.evolveum.midpoint.xml.ns._public.common.common_2a.ResourceType; import com.evolveum.midpoint.xml.ns._public.common.common_2a.RoleType; import com.evolveum.midpoint.xml.ns._public.common.common_2a.SystemConfigurationType; import com.evolveum.midpoint.xml.ns._public.common.common_2a.SystemObjectsType; @@ -55,6 +56,7 @@ import com.evolveum.midpoint.xml.ns._public.common.fault_1_wsdl.FaultMessage; import com.evolveum.midpoint.xml.ns._public.model.model_1_wsdl.ModelPortType; import com.evolveum.midpoint.xml.ns._public.model.model_1_wsdl.ModelService; +import com.evolveum.prism.xml.ns._public.query_2.PagingType; import com.evolveum.prism.xml.ns._public.query_2.QueryType; import com.evolveum.prism.xml.ns._public.types_2.ItemDeltaType; import com.evolveum.prism.xml.ns._public.types_2.ModificationTypeType; @@ -109,6 +111,10 @@ public static void main(String[] args) { RoleType sailorRole = searchRoleByName(modelPort, "Sailor"); System.out.println("Got Sailor role"); System.out.println(sailorRole); + + Collection resouces = listResources(modelPort); + System.out.println("Resources"); + System.out.println(resouces); String userGuybrushoid = createUserGuybrush(modelPort, sailorRole); System.out.println("Created user, OID: "+userGuybrushoid); @@ -148,6 +154,18 @@ private static SystemConfigurationType getConfiguration(ModelPortType modelPort) return (SystemConfigurationType) objectHolder.value; } + + private static Collection listResources(ModelPortType modelPort) throws SAXException, IOException, FaultMessage { + OperationOptionsType options = new OperationOptionsType(); + Holder objectListHolder = new Holder(); + Holder resultHolder = new Holder(); + PagingType paging = new PagingType(); + + modelPort.listObjects(getTypeUri(ResourceType.class), paging, options, objectListHolder, resultHolder); + + ObjectListType objectList = objectListHolder.value; + return (Collection) objectList.getObject(); + } private static String createUserGuybrush(ModelPortType modelPort, RoleType role) throws FaultMessage { Document doc = getDocumnent(); diff --git a/testing/sanity/src/test/java/com/evolveum/midpoint/testing/sanity/TestSanity.java b/testing/sanity/src/test/java/com/evolveum/midpoint/testing/sanity/TestSanity.java index 5cc8ace2611..a4099ededf4 100644 --- a/testing/sanity/src/test/java/com/evolveum/midpoint/testing/sanity/TestSanity.java +++ b/testing/sanity/src/test/java/com/evolveum/midpoint/testing/sanity/TestSanity.java @@ -70,6 +70,7 @@ import com.evolveum.midpoint.xml.ns._public.model.model_1_wsdl.ModelPortType; import com.evolveum.midpoint.xml.ns._public.resource.capabilities_2.ActivationCapabilityType; import com.evolveum.midpoint.xml.ns._public.resource.capabilities_2.CredentialsCapabilityType; +import com.evolveum.prism.xml.ns._public.query_2.PagingType; import com.evolveum.prism.xml.ns._public.query_2.QueryType; import com.evolveum.prism.xml.ns._public.types_2.ItemDeltaType; import com.evolveum.prism.xml.ns._public.types_2.ModificationTypeType; @@ -694,9 +695,9 @@ public void test004Capabilities() throws ObjectNotFoundException, CommunicationE * it is in the repository after the operation. */ @Test - public void test010AddUser() throws FileNotFoundException, JAXBException, FaultMessage, - ObjectNotFoundException, SchemaException, EncryptionException { - displayTestTile("test010AddUser"); + public void test010AddUser() throws Exception { + final String TEST_NAME = "test010AddUser"; + displayTestTile(TEST_NAME); // GIVEN checkRepoOpenDjResource(); @@ -3245,6 +3246,35 @@ public void timeout() { checkAllShadows(); } + + @Test + public void test400ListResources() throws Exception { + final String TEST_NAME = "test400ListResources"; + displayTestTile(TEST_NAME); + // GIVEN + OperationResultType result = new OperationResultType(); + Holder resultHolder = new Holder(result); + + Holder objectListHolder = new Holder(); + OperationOptionsType options = new OperationOptionsType(); + PagingType paging = new PagingType(); + + // WHEN + modelWeb.listObjects(ObjectTypes.RESOURCE.getObjectTypeUri(), paging, options, objectListHolder , resultHolder); + + // THEN + + display("Resources", objectListHolder.value); + assertEquals("Unexpected number of resources", 3, objectListHolder.value.getObject().size()); + // TODO + + for(ObjectType object: objectListHolder.value.getObject()) { + // Marshalling may fail even though the Java object is OK so test for it + String xml = PrismTestUtil.marshalToString(object); + } + + } + @Test