From: Steve L. <st...@us...> - 2006-05-15 15:19:01
|
Update of /cvsroot/smartfrog/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/api/informative In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv10617/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/api/informative Modified Files: Api_12_resource_id_unique_Test.java Api_35_get_multiple_portal_properties_Test.java Api_36_get_multiple_system_properties_Test.java Log Message: A week's worth of changes to the deployapi Index: Api_12_resource_id_unique_Test.java =================================================================== RCS file: /cvsroot/smartfrog/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/api/informative/Api_12_resource_id_unique_Test.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Api_12_resource_id_unique_Test.java 4 May 2006 15:18:35 -0000 1.1 --- Api_12_resource_id_unique_Test.java 15 May 2006 15:18:57 -0000 1.2 *************** *** 20,24 **** package org.smartfrog.services.deployapi.test.system.alpine.deployapi.api.informative; ! import org.smartfrog.services.deployapi.test.system.alpine.deployapi.api.UnimplementedTestBase; /** --- 20,26 ---- package org.smartfrog.services.deployapi.test.system.alpine.deployapi.api.informative; ! import org.ggf.cddlm.generated.api.CddlmConstants; ! import org.smartfrog.services.deployapi.alpineclient.model.SystemSession; ! import org.smartfrog.services.deployapi.test.system.alpine.deployapi.api.StandardTestBase; /** *************** *** 26,33 **** */ ! public class Api_12_resource_id_unique_Test extends UnimplementedTestBase { public Api_12_resource_id_unique_Test(String name) { super(name); } } --- 28,51 ---- */ ! public class Api_12_resource_id_unique_Test extends StandardTestBase { public Api_12_resource_id_unique_Test(String name) { super(name); } + + public void testTwoSystemsHaveDifferentIDs() throws Exception { + createSystem(null); + SystemSession system2 = getPortal().create(null); + try { + String resid1 = getSystem().getResourcePropertyValue(CddlmConstants.PROPERTY_MUWS_RESOURCEID); + assertNotNull(resid1); + String resid2 = system2.getResourcePropertyValue(CddlmConstants.PROPERTY_MUWS_RESOURCEID); + assertNotNull(resid2); + assertFalse("Resource IDs are not unique",resid1.equals(resid2)); + } finally { + system2.destroy(); + //system1 takes care of itself in tearDown. + } + } } + Index: Api_36_get_multiple_system_properties_Test.java =================================================================== RCS file: /cvsroot/smartfrog/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/api/informative/Api_36_get_multiple_system_properties_Test.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Api_36_get_multiple_system_properties_Test.java 4 May 2006 15:18:35 -0000 1.1 --- Api_36_get_multiple_system_properties_Test.java 15 May 2006 15:18:57 -0000 1.2 *************** *** 20,24 **** package org.smartfrog.services.deployapi.test.system.alpine.deployapi.api.informative; ! import org.smartfrog.services.deployapi.test.system.alpine.deployapi.api.UnimplementedTestBase; /** --- 20,30 ---- package org.smartfrog.services.deployapi.test.system.alpine.deployapi.api.informative; ! import org.ggf.cddlm.generated.api.CddlmConstants; ! import org.smartfrog.services.deployapi.test.system.alpine.deployapi.api.StandardTestBase; ! import org.smartfrog.projects.alpine.faults.AlpineRuntimeException; ! ! import javax.xml.namespace.QName; ! import java.util.ArrayList; ! import java.util.List; /** *************** *** 26,33 **** */ ! public class Api_36_get_multiple_system_properties_Test extends UnimplementedTestBase { public Api_36_get_multiple_system_properties_Test(String name) { super(name); } } --- 32,74 ---- */ ! public class Api_36_get_multiple_system_properties_Test extends StandardTestBase { public Api_36_get_multiple_system_properties_Test(String name) { super(name); } + + private List<QName> properties = new ArrayList<QName>(); + + /** + * Sets up the fixture, for example, open a network connection. + * This method is called before a test is executed. + */ + protected void setUp() throws Exception { + super.setUp(); + createSystem(null); + } + + public void testGetMuwsProperties() throws Exception { + properties.add(CddlmConstants.PROPERTY_MUWS_RESOURCEID); + properties.add(CddlmConstants.PROPERTY_MUWS_MANAGEABILITY_CAPABILITY); + assertGetMultiplePropertiesWorked(getSystem(), properties); + } + + public void testGetsystemProperties() throws Exception { + properties.add(CddlmConstants.PROPERTY_SYSTEM_CREATED_TIME); + properties.add(CddlmConstants.PROPERTY_SYSTEM_SYSTEM_STATE); + assertGetMultiplePropertiesWorked(getSystem(), properties); + } + + public void testGetUnknownPropertyFaults() throws Exception { + properties.add(CddlmConstants.PROPERTY_MUWS_RESOURCEID); + properties.add(CddlmConstants.PROPERTY_MUWS_MANAGEABILITY_CAPABILITY); + properties.add(CddlmConstants.FAULT_DEPLOYMENT_FAILURE); + try { + getSystem().getMultipleResourceProperties(properties); + fail("Should have thrown a fault here"); + } catch (AlpineRuntimeException e) { + log.debug("caught exception", e); + } + } } Index: Api_35_get_multiple_portal_properties_Test.java =================================================================== RCS file: /cvsroot/smartfrog/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/api/informative/Api_35_get_multiple_portal_properties_Test.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Api_35_get_multiple_portal_properties_Test.java 4 May 2006 15:18:35 -0000 1.1 --- Api_35_get_multiple_portal_properties_Test.java 15 May 2006 15:18:57 -0000 1.2 *************** *** 20,24 **** package org.smartfrog.services.deployapi.test.system.alpine.deployapi.api.informative; ! import org.smartfrog.services.deployapi.test.system.alpine.deployapi.api.UnimplementedTestBase; /** --- 20,33 ---- package org.smartfrog.services.deployapi.test.system.alpine.deployapi.api.informative; ! import org.ggf.cddlm.generated.api.CddlmConstants; ! import org.smartfrog.services.deployapi.test.system.alpine.deployapi.api.StandardTestBase; ! import org.smartfrog.projects.alpine.faults.AlpineRuntimeException; ! ! import javax.xml.namespace.QName; ! import java.util.ArrayList; ! import java.util.List; ! ! import nu.xom.Element; ! import nu.xom.Elements; /** *************** *** 26,33 **** */ ! public class Api_35_get_multiple_portal_properties_Test extends UnimplementedTestBase { public Api_35_get_multiple_portal_properties_Test(String name) { super(name); } } --- 35,81 ---- */ ! public class Api_35_get_multiple_portal_properties_Test extends StandardTestBase { ! ! ! public Api_35_get_multiple_portal_properties_Test(String name) { super(name); } + + List<QName> properties = new ArrayList<QName>(); + + + public void testGetMuwsProperties() throws Exception { + properties.add(CddlmConstants.PROPERTY_MUWS_RESOURCEID); + properties.add(CddlmConstants.PROPERTY_MUWS_MANAGEABILITY_CAPABILITY); + assertGetMultiplePropertiesWorked(getPortal(), properties); + } + + public void testGetPortalProperties() throws Exception { + properties.add(CddlmConstants.PROPERTY_PORTAL_STATIC_PORTAL_STATUS); + properties.add(CddlmConstants.PROPERTY_PORTAL_ACTIVE_SYSTEMS); + assertGetMultiplePropertiesWorked(getPortal(), properties); + } + + public void testDuplicateProperties() throws Exception { + properties.add(CddlmConstants.PROPERTY_PORTAL_STATIC_PORTAL_STATUS); + properties.add(CddlmConstants.PROPERTY_PORTAL_STATIC_PORTAL_STATUS); + assertGetMultiplePropertiesWorked(getPortal(), properties); + } + + + public void testGetUnknownPropertyFaults() throws Exception { + properties.add(CddlmConstants.PROPERTY_MUWS_RESOURCEID); + properties.add(CddlmConstants.PROPERTY_MUWS_MANAGEABILITY_CHARACTERISTICS); + properties.add(CddlmConstants.FAULT_DEPLOYMENT_FAILURE); + try { + getPortal().getMultipleResourceProperties(properties); + fail("Should have thrown a fault here"); + } catch (AlpineRuntimeException e) { + log.debug("caught exception",e); + } + } + + } |