01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */package org.apache.geronimo.testsuite.console;
19:
20: import org.testng.annotations.Test;
21: import org.apache.geronimo.testsupport.console.ConsoleTestSupport;
22:
23: @Test
24: public class JMSServerTest extends ConsoleTestSupport {
25: @Test
26: public void testNewListener() throws Exception {
27: try {
28: login();
29:
30: selenium.click("link=JMS Server");
31: selenium.waitForPageToLoad("30000");
32: selenium.click("link=Add new tcp listener");
33: selenium.waitForPageToLoad("30000");
34: selenium.type("name", "uniquename");
35: selenium.type("host", "0.0.0.0");
36: selenium.type("port", "2097");
37: selenium.click("submit");
38: selenium.waitForPageToLoad("30000");
39: assertTrue(selenium.isTextPresent("uniquename"));
40: //selenium.click("link=delete");
41: selenium
42: .click("//a[@onclick=\"return confirm('Are you sure you want to delete uniquename?');\"]");
43: selenium.waitForPageToLoad("30000");
44: assertTrue(selenium
45: .getConfirmation()
46: .matches(
47: "^Are you sure you want to delete uniquename[\\s\\S]$"));
48: } finally {
49: logout();
50: }
51: }
52:
53: @Test
54: public void testStartStopListener() throws Exception {
55: try {
56: login();
57:
58: selenium.click("link=JMS Server");
59: selenium.waitForPageToLoad("30000");
60: selenium.click("//tr[4]/td[6]/a[1]");
61: selenium.waitForPageToLoad("30000");
62: assertEquals("stopped", selenium.getText("//tr[4]/td[5]"));
63: selenium.click("//tr[4]/td[6]/a[1]");
64: selenium.waitForPageToLoad("30000");
65: assertEquals("running", selenium.getText("//tr[4]/td[5]"));
66: } finally {
67: logout();
68: }
69: }
70:
71: @Test
72: public void testEditNetworkListener() throws Exception {
73: try {
74: login();
75:
76: selenium.click("link=JMS Server");
77: selenium.waitForPageToLoad("30000");
78: assertTrue(selenium.isTextPresent("61613"));
79: selenium.click("link=edit");
80: selenium.waitForPageToLoad("30000");
81: selenium.type("port", "6161");
82: selenium.click("submit");
83: selenium.waitForPageToLoad("30000");
84: assertTrue(selenium.isTextPresent("6161"));
85: selenium.click("link=edit");
86: selenium.waitForPageToLoad("30000");
87: selenium.type("port", "61612");
88: selenium.click("submit");
89: selenium.waitForPageToLoad("30000");
90: assertTrue(selenium.isTextPresent("61612"));
91: } finally {
92: logout();
93: }
94: }
95: }
|