Ejemplo n.º 1
0
  @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");
  }
Ejemplo n.º 2
0
  @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");
  }