@Test public void testAddingDestinationResources() throws Exception { final String resourceName = "JMSDestination" + generateRandomString(); final String description = "Test Destination - " + resourceName; StandaloneTest standaloneTest = new StandaloneTest(); ClusterTest clusterTest = new ClusterTest(); standaloneTest.deleteAllStandaloneInstances(); clusterTest.deleteAllClusters(); clickAndWait( "treeForm:tree:resources:jmsResources:jmsDestinationResources:jmsDestinationResources_link", TRIGGER_JMS_DESTINATION_RESOURCES); sleep(1000); clickAndWait( "propertyForm:resourcesTable:topActionsGroup1:newButton", TRIGGER_NEW_JMS_DEST_RES); setFieldValue( "form:propertyContentPage:propertySheet:propertSectionTextField:jndiProp:jndi", resourceName); setFieldValue( "form:propertyContentPage:propertySheet:propertSectionTextField:nameProp:name", "somePhysicalDestination"); setFieldValue( "form:propertyContentPage:propertySheet:propertSectionTextField:descProp:desc", description); clickAndWait( "form:propertyContentPage:topButtons:newButton", TRIGGER_JMS_DESTINATION_RESOURCES); assertTrue(isTextPresent(resourceName) && isTextPresent(description)); // This can't currently use testDisableButton/testEnableButton because the table is different // from the others // The table should be fixed to be like the others (in terms of IDs) so the standard test API // can be used here. selectTableRowByValue("propertyForm:resourcesTable", resourceName, "colSelect", "colName"); waitForButtonEnabled("propertyForm:resourcesTable:topActionsGroup1:disableButton"); pressButton("propertyForm:resourcesTable:topActionsGroup1:disableButton"); waitForButtonDisabled("propertyForm:resourcesTable:topActionsGroup1:disableButton"); selectTableRowByValue("propertyForm:resourcesTable", resourceName, "colSelect", "colName"); waitForButtonEnabled("propertyForm:resourcesTable:topActionsGroup1:enableButton"); pressButton("propertyForm:resourcesTable:topActionsGroup1:enableButton"); waitForButtonDisabled("propertyForm:resourcesTable:topActionsGroup1:enableButton"); deleteRow( "propertyForm:resourcesTable:topActionsGroup1:deleteDestButton", "propertyForm:resourcesTable", resourceName, "colSelect", "colName"); }
@Test public void testAddingConnectionFactories() throws Exception { final String poolName = "JMSConnFactory" + generateRandomString(); final String description = "Test Pool - " + poolName; StandaloneTest standaloneTest = new StandaloneTest(); ClusterTest clusterTest = new ClusterTest(); standaloneTest.deleteAllStandaloneInstances(); clusterTest.deleteAllClusters(); clickAndWait( "treeForm:tree:resources:jmsResources:jmsConnectionFactories:jmsConnectionFactories_link", TRIGGER_JMS_CONNECTION_FACTORIES); clickAndWait( "propertyForm:resourcesTable:topActionsGroup1:newButton", TRIGGER_NEW_JMS_CONN_FACT); setFieldValue("form:propertySheet:generalPropertySheet:jndiProp:jndiProp", poolName); selectDropdownOption( "form:propertySheet:generalPropertySheet:resType:resType", "javax.jms.TopicConnectionFactory"); setFieldValue("form:propertySheet:generalPropertySheet:descProp:descProp", description); selectDropdownOption( "form:propertySheet:poolPropertySheet:transprop:trans", "LocalTransaction"); clickAndWait("form:propertyContentPage:topButtons:newButton", TRIGGER_JMS_CONNECTION_FACTORIES); assertTrue(isTextPresent(poolName)); // This can't currently use testDisableButton/testEnableButton because the table is different // from the others // The table should be fixed to be like the others (in terms of IDs) so the standard test API // can be used here. selectTableRowByValue("propertyForm:resourcesTable", poolName, "colSelect", "colPoolName"); waitForButtonEnabled("propertyForm:resourcesTable:topActionsGroup1:disableButton"); pressButton("propertyForm:resourcesTable:topActionsGroup1:disableButton"); waitForButtonDisabled("propertyForm:resourcesTable:topActionsGroup1:disableButton"); selectTableRowByValue("propertyForm:resourcesTable", poolName, "colSelect", "colPoolName"); waitForButtonEnabled("propertyForm:resourcesTable:topActionsGroup1:enableButton"); pressButton("propertyForm:resourcesTable:topActionsGroup1:enableButton"); waitForButtonDisabled("propertyForm:resourcesTable:topActionsGroup1:enableButton"); deleteRow( "propertyForm:resourcesTable:topActionsGroup1:deleteConnButton", "propertyForm:resourcesTable", poolName, "colSelect", "colPoolName"); }
@Test public void testAddingDestinationResourcesWithTargets() throws Exception { final String resourceName = "JMSDestination" + generateRandomString(); final String instanceName = "standalone" + generateRandomString(); final String description = "Test Destination - " + resourceName; StandaloneTest instanceTest = new StandaloneTest(); instanceTest.createStandAloneInstance(instanceName); clickAndWait( "treeForm:tree:resources:jmsResources:jmsDestinationResources:jmsDestinationResources_link", TRIGGER_JMS_DESTINATION_RESOURCES); sleep(1000); clickAndWait( "propertyForm:resourcesTable:topActionsGroup1:newButton", TRIGGER_NEW_JMS_DEST_RES); setFieldValue( "form:propertyContentPage:propertySheet:propertSectionTextField:jndiProp:jndi", resourceName); setFieldValue( "form:propertyContentPage:propertySheet:propertSectionTextField:nameProp:name", "somePhysicalDestination"); setFieldValue( "form:propertyContentPage:propertySheet:propertSectionTextField:descProp:desc", description); addSelectSelection( "form:targetSection:targetSectionId:addRemoveProp:commonAddRemove_available", instanceName); addSelectSelection( "form:targetSection:targetSectionId:addRemoveProp:commonAddRemove_available", "server"); pressButton( "form:targetSection:targetSectionId:addRemoveProp:commonAddRemove:commonAddRemove_addButton"); clickAndWait( "form:propertyContentPage:topButtons:newButton", TRIGGER_JMS_DESTINATION_RESOURCES); assertTrue(isTextPresent(resourceName) && isTextPresent(description)); // This can't currently use testDisableButton/testEnableButton because the table is different // from the others // The table should be fixed to be like the others (in terms of IDs) so the standard test API // can be used here. selectTableRowByValue("propertyForm:resourcesTable", resourceName, "colSelect", "colName"); waitForButtonEnabled("propertyForm:resourcesTable:topActionsGroup1:disableButton"); pressButton("propertyForm:resourcesTable:topActionsGroup1:disableButton"); waitForButtonDisabled("propertyForm:resourcesTable:topActionsGroup1:disableButton"); selectTableRowByValue("propertyForm:resourcesTable", resourceName, "colSelect", "colName"); waitForButtonEnabled("propertyForm:resourcesTable:topActionsGroup1:enableButton"); pressButton("propertyForm:resourcesTable:topActionsGroup1:enableButton"); waitForButtonDisabled("propertyForm:resourcesTable:topActionsGroup1:enableButton"); testManageTargets( "treeForm:tree:resources:jmsResources:jmsDestinationResources:jmsDestinationResources_link", "propertyForm:resourcesTable", "propertyForm:targetTable:topActionsGroup1:button2", "propertyForm:targetTable:topActionsGroup1:button3", "propertyForm:propertySheet:propertSectionTextField:statusProp2:enabledStr", "propertyForm:resEditTabs:general", "propertyForm:resEditTabs:targetTab", TRIGGER_JMS_DESTINATION_RESOURCES, TRIGGER_EDIT_JMS_DEST_RES, resourceName, instanceName); deleteRow( "propertyForm:resourcesTable:topActionsGroup1:deleteDestButton", "propertyForm:resourcesTable", resourceName, "colSelect", "colName"); // Delete the instance clickAndWait( "treeForm:tree:standaloneTreeNode:standaloneTreeNode_link", instanceTest.TRIGGER_INSTANCES_PAGE); deleteRow( "propertyForm:instancesTable:topActionsGroup1:button1", "propertyForm:instancesTable", instanceName); assertFalse(tableContainsRow("propertyForm:instancesTable", "col0", instanceName)); }
@Test public void testAddingConnectionFactoriesWithTargets() throws Exception { final String poolName = "JMSConnFactory" + generateRandomString(); final String description = "Test Pool - " + poolName; final String instanceName = "standalone" + generateRandomString(); StandaloneTest instanceTest = new StandaloneTest(); instanceTest.createStandAloneInstance(instanceName); clickAndWait( "treeForm:tree:resources:jmsResources:jmsConnectionFactories:jmsConnectionFactories_link", TRIGGER_JMS_CONNECTION_FACTORIES); clickAndWait( "propertyForm:resourcesTable:topActionsGroup1:newButton", TRIGGER_NEW_JMS_CONN_FACT); setFieldValue("form:propertySheet:generalPropertySheet:jndiProp:jndiProp", poolName); selectDropdownOption( "form:propertySheet:generalPropertySheet:resType:resType", "javax.jms.TopicConnectionFactory"); // i18n? setFieldValue("form:propertySheet:generalPropertySheet:descProp:descProp", description); selectDropdownOption( "form:propertySheet:poolPropertySheet:transprop:trans", "LocalTransaction"); // i18n addSelectSelection( "form:targetSection:targetSectionId:addRemoveProp:commonAddRemove_available", instanceName); addSelectSelection( "form:targetSection:targetSectionId:addRemoveProp:commonAddRemove_available", "server"); pressButton( "form:targetSection:targetSectionId:addRemoveProp:commonAddRemove:commonAddRemove_addButton"); clickAndWait("form:propertyContentPage:topButtons:newButton", TRIGGER_JMS_CONNECTION_FACTORIES); assertTrue(isTextPresent(poolName)); // This can't currently use testDisableButton/testEnableButton because the table is different // from the others // The table should be fixed to be like the others (in terms of IDs) so the standard test API // can be used here. selectTableRowByValue("propertyForm:resourcesTable", poolName, "colSelect", "colPoolName"); waitForButtonEnabled("propertyForm:resourcesTable:topActionsGroup1:disableButton"); pressButton("propertyForm:resourcesTable:topActionsGroup1:disableButton"); waitForButtonDisabled("propertyForm:resourcesTable:topActionsGroup1:disableButton"); selectTableRowByValue("propertyForm:resourcesTable", poolName, "colSelect", "colPoolName"); waitForButtonEnabled("propertyForm:resourcesTable:topActionsGroup1:enableButton"); pressButton("propertyForm:resourcesTable:topActionsGroup1:enableButton"); waitForButtonDisabled("propertyForm:resourcesTable:topActionsGroup1:enableButton"); testManageTargets( "treeForm:tree:resources:jmsResources:jmsConnectionFactories:jmsConnectionFactories_link", "propertyForm:resourcesTable", "propertyForm:targetTable:topActionsGroup1:button2", "propertyForm:targetTable:topActionsGroup1:button3", "propertyForm:propertyContentPage:propertySheet:generalPropertySheet:statusProp2:enabledStr", "propertyForm:resEditTabs:general", "propertyForm:resEditTabs:targetTab", TRIGGER_JMS_CONNECTION_FACTORIES, TRIGGER_EDIT_JMS_CONN_FACT, poolName, instanceName); deleteRow( "propertyForm:resourcesTable:topActionsGroup1:deleteConnButton", "propertyForm:resourcesTable", poolName, "colSelect", "colPoolName"); // Delete the instance clickAndWait( "treeForm:tree:standaloneTreeNode:standaloneTreeNode_link", instanceTest.TRIGGER_INSTANCES_PAGE); deleteRow( "propertyForm:instancesTable:topActionsGroup1:button1", "propertyForm:instancesTable", instanceName); assertFalse(tableContainsRow("propertyForm:instancesTable", "col0", instanceName)); }