Source Code Cross Referenced for JBIClusterTest.java in  » ESB » open-esb » com » sun » jbi » jsf » test » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » ESB » open esb » com.sun.jbi.jsf.test 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


0001:        /*
0002:         * The contents of this file are subject to the terms
0003:         * of the Common Development and Distribution License
0004:         * (the License).  You may not use this file except in
0005:         * compliance with the License.
0006:         *
0007:         * You can obtain a copy of the license at
0008:         * https://glassfish.dev.java.net/public/CDDLv1.0.html or
0009:         * glassfish/bootstrap/legal/CDDLv1.0.txt.
0010:         * See the License for the specific language governing
0011:         * permissions and limitations under the License.
0012:         *
0013:         * When distributing Covered Code, include this CDDL
0014:         * Header Notice in each file and include the License file
0015:         * at glassfish/bootstrap/legal/CDDLv1.0.txt.
0016:         * If applicable, add the following below the CDDL Header,
0017:         * with the fields enclosed by brackets [] replaced by
0018:         * you own identifying information:
0019:         * "Portions Copyrighted [year] [name of copyright owner]"
0020:         *
0021:         * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
0022:         */
0023:
0024:        package com.sun.jbi.jsf.test;
0025:
0026:        import com.thoughtworks.selenium.*;
0027:
0028:        import java.util.regex.Pattern;
0029:        import junit.framework.TestCase;
0030:        import org.testng.annotations.*;
0031:
0032:        /*  
0033:         * Before running the test, please ensure that your Selenium Remote Server
0034:         * is up and running. Server can be started using the java -jar selenium-server.jar
0035:         */
0036:
0037:        public class JBIClusterTest extends SeleneseTestCase {
0038:            private DefaultSelenium selenium;
0039:
0040:            private static final String ADMINGUI_URL = "http://localhost:4848";
0041:            private static final String LOGIN_USERNAME_VALUE = "admin";
0042:            private static final String LOGIN_PASSWD_VALUE = "adminadmin";
0043:            private static final String JBI_LIB_VALID_SL_ONLY_TEST_ARCHIVE = "valid-sl-only.zip";
0044:            private static final String JBI_COMP_BC1_TEST_ARCHIVE = "bc1.zip";
0045:            private static final String JBI_COMP_BC2_TEST_ARCHIVE = "bc2.zip";
0046:            private static final String JBI_SA_FOR_BC1_BC2_TEST_ARCHIVE = "sa-for-bc1-and-bc2.zip";
0047:            private static final String JBI_CORRUPT_ARCHIVE = "corrupted-archive.zip";
0048:            private static final String JBI_EMPTY_ARCHIVE = "empty.zip";
0049:            private static final String JBI_MISSING_JBI_XML_ARCHIVE = "missing-jbi-xml.zip";
0050:            private static final String JBI_NOT_WELL_FORMED_JBI_XML_ARCHIVE = "not-well-formed-jbi-xml.zip";
0051:
0052:            //Timeout value for most of the commands which needs page to load completely.
0053:            private static String TIMEOUT_PERIOD = "10000";
0054:
0055:            //Constant IDs of Login Page Components
0056:            private final static String LOGIN_PASSWORD_INPUT_ID = "Login.password";
0057:            private final static String LOGIN_USERNAME_INPUT_ID = "Login.username";
0058:
0059:            @BeforeSuite(alwaysRun=true)
0060:            private void configure() {
0061:                /*Uncomment the following line when chrome url does not work. It will not handle upload use cases well.
0062:                Please modify the location of firefox binary on local hard drive before launching the test*/
0063:                //selenium = new DefaultSelenium("localhost", 4444, "*firefox //space0/firefox/firefox/firefox-bin", ADMINGUI_URL);
0064:                //selenium = new DefaultSelenium("localhost", 4444, "*firefox", ADMINGUI_URL);
0065:                /*Uncomment the following line to use secure chrome url and test upload use cases. Please modify the location of firefox binary on your hard-disk*/
0066:                //selenium = new DefaultSelenium("localhost", 4444, "*chrome", ADMINGUI_URL);
0067:                //Spacify the path in the following way when the firefox binary is not located at default location
0068:                selenium = new DefaultSelenium(
0069:                        "localhost",
0070:                        4444,
0071:                        "*chrome /home/pt145033/Priti_data/firefox/firefox/firefox-bin",
0072:                        ADMINGUI_URL);
0073:
0074:                /* Uncomment the line below if you want to run the test on Internet Explorer.*/
0075:                //selenium = new DefaultSelenium("localhost", 4444, "*iexplore", ADMINGUI_URL);
0076:                selenium.start();
0077:                selenium.open(ADMINGUI_URL);
0078:            }
0079:
0080:            // Cleanup the selenium environment
0081:            @AfterSuite(alwaysRun=true)
0082:            private void stopTest() {
0083:                selenium.stop();
0084:            }
0085:
0086:            /*Logs into the console using default username and password before starting all tests*/
0087:            //@BeforeSuite(dependsOnMethods = { "configure" })
0088:            @BeforeClass(alwaysRun=true)
0089:            private void runLogin() {
0090:                try {
0091:                    selenium
0092:                            .type(LOGIN_USERNAME_INPUT_ID, LOGIN_USERNAME_VALUE);
0093:                    selenium.type(LOGIN_PASSWORD_INPUT_ID, LOGIN_PASSWD_VALUE);
0094:
0095:                    //Click the LoginButton
0096:                    selenium.click("loginButton");
0097:                    selenium.waitForCondition(
0098:                            "selenium.browserbot.isNewPageLoaded()",
0099:                            TIMEOUT_PERIOD);
0100:                } catch (Exception t) {
0101:                    t.printStackTrace();
0102:                    //ToDo Add Logging statements
0103:                    System.out.println("Login failed: " + t.getMessage());
0104:                }
0105:            }
0106:
0107:            /**********************************************************************************/
0108:            /*Test JBI Root Page and Presence of three links and two child elements of Components
0109:             ***********************************************************************************/
0110:            @Test(groups={"runJBIRoot"})
0111:            private void runJBIRootPageTest() {
0112:                navigateToListPage(JBIIdConstants.JBI_ROOT_PAGE_LINK);
0113:                //selenium.waitForCondition("selenium.browserbot.isNewPageLoaded()", TIMEOUT_PERIOD);
0114:
0115:                verifyTrue(selenium
0116:                        .isElementPresent(JBIIdConstants.JBI_ROOT_SA_LINK));
0117:                verifyTrue(selenium
0118:                        .isElementPresent(JBIIdConstants.JBI_ROOT_COMP_LINK));
0119:                verifyTrue(selenium
0120:                        .isTextPresent(JBIResourceConstants.JBI_ROOT_BC_NODE));
0121:                verifyTrue(selenium
0122:                        .isTextPresent(JBIResourceConstants.JBI_ROOT_SE_NODE));
0123:                verifyTrue(selenium
0124:                        .isElementPresent(JBIIdConstants.JBI_ROOT_SL_LINK));
0125:            }
0126:
0127:            /********************************************************************/
0128:            /*Test invalid archives for shared libary installation using copy path
0129:             ********************************************************************/
0130:            //@Test(groups = {"invalidCopySL"}, dependsOnGroups = {"runJBIRoot"})
0131:            @Test(groups={"invalidCopySL"})
0132:            private void runInvalidArchiveSLTest() {
0133:                navigateToListPage(JBIIdConstants.JBI_LIBRARY_NODE_ID);
0134:                clickNewButton(JBIIdConstants.JBI_EE_NEW_INSTALL_BUTTON_ID);
0135:                invalidSLTest();
0136:            }
0137:
0138:            /********************************************************************/
0139:
0140:            /*Test Installation of Shared Library works using the upload path*/
0141:            @Test(groups={"uploadSL"},dependsOnGroups={"invalidCopySL"})
0142:            private void runUploadShareLibraryTest() {
0143:                try {
0144:                    navigateToListPage(JBIIdConstants.JBI_LIBRARY_NODE_ID);
0145:
0146:                    //occassionaly the Shared Libraries link is not found and then we need to uncomment 
0147:                    //following statement
0148:                    clickNewButton(JBIIdConstants.JBI_EE_NEW_INSTALL_BUTTON_ID);
0149:                    installArchiveFirstStep(
0150:                            JBIIdConstants.JBI_LIBRARY_INSTALL_UPLOAD_FIELD_ID,
0151:                            JBI_LIB_VALID_SL_ONLY_TEST_ARCHIVE,
0152:                            JBIIdConstants.JBI_LIBRARY_INSTALL_NEXT_BUTTON_ID);
0153:                    selenium
0154:                            .click(JBIIdConstants.JBI_EE_LIBRARY_INSTALL_FINISH_BUTTON_ID);
0155:                    selenium.waitForCondition(
0156:                            "selenium.browserbot.isNewPageLoaded()",
0157:                            TIMEOUT_PERIOD);
0158:
0159:                    //Verify that the finish step brought back to the list Shared library page
0160:                    verifyTrue(selenium
0161:                            .isElementPresent(JBIIdConstants.JBI_NEW_INSTALL_BUTTON_ID));
0162:                } catch (Exception e) {
0163:                    e.printStackTrace();
0164:                    //ToDo Add Logging statements
0165:                    System.out.println("Uploading Shared library failed:"
0166:                            + e.getMessage());
0167:                }
0168:            }
0169:
0170:            /********************************************************************/
0171:            /*Test invalid archives for Component installation using copy path
0172:             ************************************Comp********************************/
0173:            @Test(groups={"invalidCopyComp"},dependsOnGroups={"uploadSL"})
0174:            private void runInvalidArchiveCompTest() {
0175:                navigateToListPage(JBIIdConstants.JBI_COMPONENT_NODE_ID);
0176:                clickNewButton(JBIIdConstants.JBI_EE_NEW_INSTALL_BUTTON_ID);
0177:                invalidCompTest();
0178:            }
0179:
0180:            /********************************************************************/
0181:            /*Data Provider which provides two component Archives for component installation
0182:             ********************************************************************/
0183:
0184:            @DataProvider
0185:            public Object[][] compInstallationData() {
0186:                return new Object[][] {
0187:                        new Object[] { JBI_COMP_BC1_TEST_ARCHIVE },
0188:                        new Object[] { JBI_COMP_BC2_TEST_ARCHIVE }, };
0189:            }
0190:
0191:            /********************************************************************/
0192:            /*********Install Component Using Upload Path************************/
0193:            /********************************************************************/
0194:
0195:            @Test(groups={"installComp"},dataProvider="compInstallationData",dependsOnGroups={"invalidCopyComp"})
0196:            public void runUploadComponentTest(String aCompName) {
0197:                try {
0198:                    navigateToListPage(JBIIdConstants.JBI_COMPONENT_NODE_ID);
0199:                    clickNewButton(JBIIdConstants.JBI_EE_NEW_INSTALL_BUTTON_ID);
0200:                    installArchiveFirstStep(
0201:                            JBIIdConstants.JBI_COMPONENT_INSTALL_UPLOAD_FIELD_ID,
0202:                            aCompName,
0203:                            JBIIdConstants.JBI_COMPONENT_INSTALL_NEXT_BUTTON_ID);
0204:
0205:                    //Verify that the second step of install wizard has the right heading text and two configuration table presence
0206:                    verifyTrue(selenium
0207:                            .isTextPresent(JBIResourceConstants.JBI_COMP_INSTALL_WIZ_STEP2_TITLE));
0208:                    verifyTrue(selenium
0209:                            .isTextPresent(JBIResourceConstants.JBI_COMP_INSTALL_CONF_PROP_TBL_TITLE));
0210:                    verifyTrue(selenium
0211:                            .isTextPresent(JBIResourceConstants.JBI_COMP_INSTALL_PROP_TBL_TITLE));
0212:
0213:                    selenium
0214:                            .click(JBIIdConstants.JBI_EE_COMPONENT_INSTALL_FINISH_BUTTON_ID);
0215:                } catch (Exception e) {
0216:                    e.printStackTrace();
0217:                    //ToDo Add Logging statements
0218:                    System.out.println("Uploading Components failed:"
0219:                            + e.getMessage());
0220:                }
0221:            }
0222:
0223:            /********************************************************************/
0224:            /*Test invalid archives for Component installation using copy path
0225:             ************************************Comp********************************/
0226:            @Test(groups={"invalidCopySA"},dependsOnGroups={"installComp"})
0227:            private void runInvalidArchiveSATest() {
0228:                navigateToListPage(JBIIdConstants.JBI_SERVICE_ASSEMBLY_NODE_ID);
0229:                clickNewButton(JBIIdConstants.JBI_EE_NEW_INSTALL_BUTTON_ID);
0230:                invalidSATest();
0231:            }
0232:
0233:            /********************************************************************/
0234:            /************Deploy Service Assembly using Upload Path****************/
0235:            /********************************************************************/
0236:
0237:            @Parameters({"saName"})
0238:            @Test(groups={"deploySA"},dependsOnGroups={"invalidCopySA"})
0239:            public void runUploadServiceAssemblyTest(String aDeploymentName) {
0240:                try {
0241:                    navigateToListPage(JBIIdConstants.JBI_SERVICE_ASSEMBLY_NODE_ID);
0242:                    //Deploy Service Assembly whose SU targets the previously installed two components
0243:                    //selenium.waitForCondition("selenium.browserbot.isNewPageLoaded()", TIMEOUT_PERIOD);
0244:                    //selenium.waitForPageToLoad("9000");
0245:                    clickNewButton(JBIIdConstants.JBI_EE_NEW_INSTALL_BUTTON_ID);
0246:                    installArchiveFirstStep(
0247:                            JBIIdConstants.JBI_SERVICE_ASSEMBLY_DEPLOY_UPLOAD_FIELD_ID,
0248:                            aDeploymentName,
0249:                            JBIIdConstants.JBI_SERVICE_ASSEMBLY_DEPLOY_NEXT_BUTTON_ID);
0250:
0251:                    verifyTrue(selenium
0252:                            .isTextPresent("Deploy JBI Service Assembly (Step 2 of 2)"));
0253:                    selenium
0254:                            .click(JBIIdConstants.JBI_EE_SERVICE_ASSEMBLY_DEPLOY_FINISH_BUTTON_ID);
0255:                    selenium.waitForCondition(
0256:                            "selenium.browserbot.isNewPageLoaded()",
0257:                            TIMEOUT_PERIOD);
0258:                    verifyTrue(selenium.isTextPresent("JBI Service Assemblies"));
0259:                } catch (Exception e) {
0260:                    e.printStackTrace();
0261:                    //ToDo Add Logging statements
0262:                    System.out.println("Deploying/Uploading SA failed:"
0263:                            + e.getMessage());
0264:                }
0265:            }
0266:
0267:            /********************************************************************/
0268:            /*Test the Table of the Library page shows up fine and has major components*/
0269:            /********************************************************************/
0270:
0271:            @Test(groups={"listSL"},dependsOnGroups={"deploySA"})
0272:            private void runListLibraryTest() {
0273:                try {
0274:                    navigateToListPage(JBIIdConstants.JBI_LIBRARY_NODE_ID);
0275:                    selenium.waitForCondition(
0276:                            "selenium.browserbot.isNewPageLoaded()",
0277:                            TIMEOUT_PERIOD);
0278:
0279:                    //Verify the presence of Heading, Inline Help Text, Tables Header, Column header and table Select/Deselect All
0280:                    //Components . Also check Install, Uninstall buttons presence.
0281:
0282:                    verifyTrue(selenium
0283:                            .isTextPresent(JBIResourceConstants.JBI_LIST_LIB_PAGE_TITLE));
0284:                    verifyTrue(selenium
0285:                            .isTextPresent(JBIResourceConstants.JBI_LIST_LIB_PAGE_INLINE_HELP));
0286:                    verifyTrue(selenium
0287:                            .isTextPresent(JBIResourceConstants.JBI_LIST_LIB_TABLE_TITLE_TEXT));
0288:                    runListCommonEE();
0289:                } catch (Exception e) {
0290:                    e.printStackTrace();
0291:                    //ToDo Add Logging statements
0292:                    System.out.println("Listing Table of Library failed:"
0293:                            + e.getMessage());
0294:                }
0295:            }
0296:
0297:            /**************************************************************************/
0298:            /*Test the Table of the Components page shows up fine and has major components*/
0299:            /**************************************************************************/
0300:
0301:            @Test(groups={"listComp"},dependsOnGroups={"listSL"})
0302:            private void runListComponentTest() {
0303:                try {
0304:                    navigateToListPage(JBIIdConstants.JBI_COMPONENT_NODE_ID);
0305:                    selenium.waitForCondition(
0306:                            "selenium.browserbot.isNewPageLoaded()",
0307:                            TIMEOUT_PERIOD);
0308:
0309:                    //Verify the presence of Heading, Inline Help Text, Tables Header, Column header and table Select/Deselect All
0310:                    //Components . Also check Install, Uninstall buttons, Operations DropDown, Filter by State/Type DropDown presence.
0311:
0312:                    verifyTrue(selenium
0313:                            .isTextPresent(JBIResourceConstants.JBI_LIST_COMP_PAGE_TITLE));
0314:                    verifyTrue(selenium
0315:                            .isTextPresent(JBIResourceConstants.JBI_LIST_COMP_PAGE_INLINE_HELP));
0316:                    verifyTrue(selenium
0317:                            .isTextPresent(JBIResourceConstants.JBI_LIST_COMP_TABLE_TITLE_TEXT));
0318:                    verifyTrue(selenium
0319:                            .isTextPresent(JBIResourceConstants.JBI_LIST_TABLE_NAME_HEADER));
0320:                    verifyTrue(selenium
0321:                            .isElementPresent("sharedTableEEForm:sharedTableEE:topActionsGroup1:filterByComponentStateDropDown_list"));
0322:                    verifyTrue(selenium
0323:                            .isElementPresent("sharedTableEEForm:sharedTableEE:topActionsGroup1:filterActionDropDown_list"));
0324:                    runListCommonEE();
0325:                } catch (Exception e) {
0326:                    e.printStackTrace();
0327:                    //ToDo Add Logging statements
0328:                    System.out.println("Listing Table of Components failed:"
0329:                            + e.getMessage());
0330:                }
0331:            }
0332:
0333:            /**************************************************************************/
0334:            /*Test the Table of the Components page shows up fine and has major components*/
0335:            /**************************************************************************/
0336:
0337:            @Test(groups={"listServiceAssembly"},dependsOnGroups={"listComp"})
0338:            private void runListServiceAssemblyTest() {
0339:                try {
0340:                    navigateToListPage(JBIIdConstants.JBI_SERVICE_ASSEMBLY_NODE_ID);
0341:                    selenium.waitForCondition(
0342:                            "selenium.browserbot.isNewPageLoaded()",
0343:                            TIMEOUT_PERIOD);
0344:
0345:                    //Verify the presence of Heading, Inline Help Text, Tables Header, Column header and table Select/Deselect All
0346:                    //Components .
0347:
0348:                    verifyTrue(selenium
0349:                            .isTextPresent(JBIResourceConstants.JBI_LIST_SA_PAGE_TITLE));
0350:                    verifyTrue(selenium
0351:                            .isTextPresent(JBIResourceConstants.JBI_LIST_SA_PAGE_INLINE_HELP));
0352:                    verifyTrue(selenium
0353:                            .isTextPresent(JBIResourceConstants.JBI_LIST_SA_TABLE_TITLE_TEXT));
0354:                    verifyTrue(selenium
0355:                            .isTextPresent(JBIResourceConstants.JBI_LIST_TABLE_NAME_HEADER));
0356:
0357:                    // Also check Install, Uninstall buttons, Operations DropDown, Filter by State/Type DropDown presence.
0358:                    verifyTrue(selenium
0359:                            .isElementPresent("sharedTableEEForm:sharedTableEE:topActionsGroup1:filterByAssemblyStateDropDown_list"));
0360:                    runListCommonEE();
0361:                } catch (Exception e) {
0362:                    e.printStackTrace();
0363:                    //ToDo Add Logging statements
0364:                    System.out
0365:                            .println("Listing Table of Service Assembly failed:"
0366:                                    + e.getMessage());
0367:                }
0368:            }
0369:
0370:            /**************************************************************************/
0371:            /*Test Show pages of Shared Library works and has two tabs (General, Descriptor)*/
0372:            /**************************************************************************/
0373:
0374:            @Test(groups={"showSL"},dependsOnGroups={"listServiceAssembly"})
0375:            private void runShowShareLibraryTest() {
0376:                try {
0377:                    navigateToListPage(JBIIdConstants.JBI_LIBRARY_NODE_ID);
0378:                    //occassionaly the Shared Libraries link is not found and then we need to uncomment 
0379:                    //following statement
0380:                    clickNameHyperLink(JBIIdConstants.JBI_EE_LIST_PAGE_FIRST_ELEM_NAME_LINK_ID);
0381:                    runShowShareLibraryCommonTest();
0382:                } catch (Exception e) {
0383:                    e.printStackTrace();
0384:                    System.out.println("Show tabs  Shared library failed:"
0385:                            + e.getMessage());
0386:                }
0387:            }
0388:
0389:            /**************************************************************************/
0390:            /*Click Name link in List Components page to see the details of each component 
0391:            Verify that Components have 5 tabs */
0392:            /**************************************************************************/
0393:
0394:            @Test(groups={"showComp"},dependsOnGroups={"showSL"})
0395:            private void runShowComponentTest() {
0396:                try {
0397:                    navigateToListPage(JBIIdConstants.JBI_COMPONENT_NODE_ID);
0398:
0399:                    //Choose the first elements name which is a hyperlink in the list table.
0400:                    clickNameHyperLink(JBIIdConstants.JBI_EE_LIST_PAGE_FIRST_ELEM_NAME_LINK_ID);
0401:                    runShowComponentCommonTest();
0402:                } catch (Exception e) {
0403:                    //e.printStackTrace();
0404:                    //ToDo Add Logging statements
0405:                    System.out.println("Show Components test case failure:"
0406:                            + e.getMessage());
0407:                }
0408:            }
0409:
0410:            /**************************************************************************/
0411:            /*Tests the show detail pages of Service Assemblies in developer-profile */
0412:            /**************************************************************************/
0413:
0414:            @Test(groups={"showSA"},dependsOnGroups={"showComp"})
0415:            private void runShowServiceAssemblyTest() {
0416:                //Testing JBI Deployments Show pages which have 2 tabs General and Descriptor tab
0417:                try {
0418:                    navigateToListPage(JBIIdConstants.JBI_SERVICE_ASSEMBLY_NODE_ID);
0419:                    //Click the name of the first element in the Service assembly list table which is a hyperlink
0420:                    clickNameHyperLink(JBIIdConstants.JBI_EE_LIST_PAGE_FIRST_ELEM_NAME_LINK_ID);
0421:                    runShowServiceAssemblyCommonTest();
0422:                } catch (Exception e) {
0423:                    e.printStackTrace();
0424:                    //ToDo Add Logging statements
0425:                    System.out.println("Show Deployments test case failure "
0426:                            + e.getMessage());
0427:                }
0428:            }
0429:
0430:            /**************************************************************************/
0431:            /*******Filter Listed Components by Binding then Engine. This test *******/
0432:            /** needs at least one Binding Component and one Service Engine to pass****/
0433:            /** needs at least one Enabled and one Disabled Component to pass**********/
0434:            /**************************************************************************/
0435:
0436:            @Test(groups={"filterComp"},dependsOnGroups={"showSA"})
0437:            private void runFilterComponents() {
0438:                navigateToListPage(JBIIdConstants.JBI_COMPONENT_NODE_ID);
0439:                selenium
0440:                        .waitForCondition(
0441:                                "selenium.browserbot.isNewPageLoaded()",
0442:                                TIMEOUT_PERIOD);
0443:
0444:                //Disable One Component So that Disable DropDown Filter by State has at least one element
0445:                operateCheckedElement(
0446:                        JBIIdConstants.JBI_EE_LIST_PAGE_FIRST_ELEM_CB_ID,
0447:                        JBIIdConstants.JBI_EE_DISABLE_BUTTON_ID,
0448:                        JBIResourceConstants.JBI_EE_STATUS_DISABLED_ON_ALL_TARGETS,
0449:                        JBIIdConstants.JBI_EE_LIST_PAGE_FIRST_ELEM_STATUS_ID);
0450:
0451:                //Filter By State
0452:                selectDropDownNoCBAndVerifyResult(
0453:                        JBIIdConstants.JBI_EE_COMPONENT_STATE_FILTER_DROPDOWN_ID,
0454:                        JBIResourceConstants.JBI_EE_STATE_ENABLED_DROPDOWN,
0455:                        JBIResourceConstants.JBI_EE_STATUS_ENABLED_ON_ALL_TARGETS,
0456:                        JBIIdConstants.JBI_EE_LIST_PAGE_FIRST_ELEM_STATUS_ID);
0457:                //        selenium.waitForCondition("selenium.browserbot.isNewPageLoaded()", TIMEOUT_PERIOD);
0458:
0459:                selectDropDownNoCBAndVerifyResult(
0460:                        JBIIdConstants.JBI_EE_COMPONENT_STATE_FILTER_DROPDOWN_ID,
0461:                        JBIResourceConstants.JBI_EE_STATE_DISABLED_DROPDOWN,
0462:                        JBIResourceConstants.JBI_EE_STATUS_DISABLED_ON_ALL_TARGETS,
0463:                        JBIIdConstants.JBI_EE_LIST_PAGE_FIRST_ELEM_STATUS_ID);
0464:
0465:                //selenium.select(JBIIdConstants.JBI_EE_COMPONENT_STATE_FILTER_DROPDOWN_ID, "label= No Targets");
0466:                selenium
0467:                        .select(
0468:                                JBIIdConstants.JBI_EE_COMPONENT_STATE_FILTER_DROPDOWN_ID,
0469:                                "label=Show All");
0470:
0471:                selenium
0472:                        .waitForCondition(
0473:                                "selenium.browserbot.isNewPageLoaded()",
0474:                                TIMEOUT_PERIOD);
0475:
0476:                ///Filter By Type
0477:                selectDropDownNoCBAndVerifyResult(
0478:                        JBIIdConstants.JBI_EE_COMPONENT_TYPE_FILTER_DROPDOWN_ID,
0479:                        JBIResourceConstants.JBI_LIST_BC_TYPE_TEXT,
0480:                        JBIResourceConstants.JBI_LIST_BC_TYPE_TEXT,
0481:                        JBIIdConstants.JBI_EE_COMPONENT_LIST_PAGE_FIRST_BC_TYPE_ID);
0482:
0483:                selenium
0484:                        .select(
0485:                                JBIIdConstants.JBI_EE_COMPONENT_TYPE_FILTER_DROPDOWN_ID,
0486:                                "label=Show All");
0487:                selenium
0488:                        .waitForCondition(
0489:                                "selenium.browserbot.isNewPageLoaded()",
0490:                                TIMEOUT_PERIOD);
0491:
0492:                selectDropDownNoCBAndVerifyResult(
0493:                        JBIIdConstants.JBI_EE_COMPONENT_TYPE_FILTER_DROPDOWN_ID,
0494:                        JBIResourceConstants.JBI_LIST_SE_TYPE_TEXT,
0495:                        JBIResourceConstants.JBI_LIST_SE_TYPE_TEXT,
0496:                        JBIIdConstants.JBI_EE_COMPONENT_LIST_PAGE_FIRST_SE_TYPE_ID);
0497:            }
0498:
0499:            /**************************************************************************/
0500:            /***************Operate on the component : Tested transitions*************/
0501:            /*************a) Enable->Disable->Enable On all Targets*******************/
0502:            /**************************************************************************/
0503:
0504:            @Test(groups={"operateComp"},dependsOnGroups={"filterComp"})
0505:            private void runOperateComponentTest() {
0506:                try {
0507:                    //Operate Components using Enable/Disable Buttons
0508:                    navigateToListPage(JBIIdConstants.JBI_COMPONENT_NODE_ID);
0509:                    selenium.waitForCondition(
0510:                            "selenium.browserbot.isNewPageLoaded()",
0511:                            TIMEOUT_PERIOD);
0512:                    runOperateCompSAEE();
0513:                } catch (Exception e) {
0514:                    e.printStackTrace();
0515:                    //ToDo Add Logging statements
0516:                    System.out.println("Operating Components failed:"
0517:                            + e.getMessage());
0518:                }
0519:            }
0520:
0521:            /**************************************************************************/
0522:            /******Operate the service assembly : Tested transitions******************/
0523:            /**********a) Enable->Disable->Enable************************************/
0524:            /**************************************************************************/
0525:
0526:            @Test(groups={"operateSA"},dependsOnGroups={"operateComp"})
0527:            private void runOperateServiceAssemblyTest() {
0528:                //Testing JBI Deployments lifecycle operations 
0529:                try {
0530:                    //Enable/Disable the Service Assembly 
0531:                    navigateToListPage(JBIIdConstants.JBI_SERVICE_ASSEMBLY_NODE_ID);
0532:                    selenium.waitForCondition(
0533:                            "selenium.browserbot.isNewPageLoaded()",
0534:                            TIMEOUT_PERIOD);
0535:                    runOperateCompSAEE();
0536:                } catch (Exception e) {
0537:                    e.printStackTrace();
0538:                    //ToDo Add Logging statements
0539:                    System.out
0540:                            .println("Operation Service Assembly test case failure "
0541:                                    + e.getMessage());
0542:                }
0543:            }
0544:
0545:            /**************************************************************************/
0546:            /***********Tests Uninstallation of JBI Shared Library works *************/
0547:            /**************************************************************************/
0548:
0549:            @Test(groups={"uninstallSL"},dependsOnGroups={"operateSA"})
0550:            private void runUninstallShareLibraryTest() {
0551:                try {
0552:                    navigateToListPage(JBIIdConstants.JBI_LIBRARY_NODE_ID);
0553:                    selenium.waitForCondition(
0554:                            "selenium.browserbot.isNewPageLoaded()",
0555:                            TIMEOUT_PERIOD);
0556:                    //Assuming that first element is Sun Wsdl library and second is valid-sl-only 
0557:                    //selecting the second element in the table for uninstallation
0558:                    uninstallChecked(
0559:                            JBIIdConstants.JBI_EE_LIST_PAGE_SECOND_ELEM_CB_ID,
0560:                            JBIResourceConstants.JBI_EE_LIB_DELETION_MSG);
0561:                } catch (Exception e) {
0562:                    e.printStackTrace();
0563:                    //ToDo Add Logging statements
0564:                    System.out.println("Uninstalling Shared library failed:"
0565:                            + e.getMessage());
0566:                }
0567:            }
0568:
0569:            /**************************************************************************/
0570:            /*Uninstall Component*/
0571:            //This test cannot pass if the first component has a dependenet Service Assembly deployed to it
0572:            /**************************************************************************/
0573:            @Test(groups={"uninstallComp"},dependsOnGroups={"undeploySA"})
0574:            private void runUninstallComponentTest() {
0575:                try {
0576:                    //Change the state of the components to shutdown, as components in started state cannot be uninstalled
0577:                    operateCheckedElement(
0578:                            JBIIdConstants.JBI_EE_LIST_PAGE_FIRST_ELEM_CB_ID,
0579:                            JBIIdConstants.JBI_EE_DISABLE_BUTTON_ID,
0580:                            JBIResourceConstants.JBI_EE_STATUS_DISABLED_ON_ALL_TARGETS,
0581:                            JBIIdConstants.JBI_EE_LIST_PAGE_FIRST_ELEM_STATUS_ID);
0582:
0583:                    uninstallChecked(
0584:                            JBIIdConstants.JBI_EE_LIST_PAGE_FIRST_ELEM_CB_ID,
0585:                            JBIResourceConstants.JBI_EE_COMP_DELETION_MSG);
0586:                } catch (Exception e) {
0587:                    e.printStackTrace();
0588:                    //ToDo Add Logging statements
0589:                    System.out
0590:                            .println("Uninstalling components test case failure:"
0591:                                    + e.getMessage());
0592:                }
0593:            }
0594:
0595:            /**************************************************************************/
0596:            /*Tests uninstallation of SA and components. Service Assembly and components  have to be in shutdown
0597:            state before uninstalling. This tests change their states to shutdown before deleting them*/
0598:            /**************************************************************************/
0599:
0600:            @Test(groups={"undeploySA"},dependsOnGroups={"uninstallSL"})
0601:            private void runUndeployServiceAssemblyTest() {
0602:                try {
0603:                    navigateToListPage(JBIIdConstants.JBI_SERVICE_ASSEMBLY_NODE_ID);
0604:
0605:                    //Select the first element in the Service Assembly table . Assuming that this is the only installed
0606:                    //SA and in shutdown state.
0607:                    selenium.waitForCondition(
0608:                            "selenium.browserbot.isNewPageLoaded()",
0609:                            TIMEOUT_PERIOD);
0610:
0611:                    operateCheckedElement(
0612:                            JBIIdConstants.JBI_EE_LIST_PAGE_FIRST_ELEM_CB_ID,
0613:                            JBIIdConstants.JBI_EE_DISABLE_BUTTON_ID,
0614:                            JBIResourceConstants.JBI_EE_STATUS_DISABLED_ON_ALL_TARGETS,
0615:                            JBIIdConstants.JBI_EE_LIST_PAGE_FIRST_ELEM_STATUS_ID);
0616:
0617:                    uninstallChecked(
0618:                            JBIIdConstants.JBI_EE_LIST_PAGE_FIRST_ELEM_CB_ID,
0619:                            JBIResourceConstants.JBI_EE_SA_DELETION_MSG);
0620:
0621:                    //Choose the components for uninstallation. 
0622:                    navigateToListPage(JBIIdConstants.JBI_COMPONENT_NODE_ID);
0623:                    selenium.waitForCondition(
0624:                            "selenium.browserbot.isNewPageLoaded()",
0625:                            TIMEOUT_PERIOD);
0626:
0627:                    //sort the Components by Name so that the top two are manage-binding 1 and 2 which are
0628:                    //target components for  undeployed SA's SU's.
0629:
0630:                    selenium.click(JBIIdConstants.JBI_EE_SORT_BUTTON_ID);
0631:                    selenium.waitForCondition(
0632:                            "selenium.browserbot.isNewPageLoaded()",
0633:                            TIMEOUT_PERIOD);
0634:                    runUninstallComponentTest();
0635:                    runUninstallComponentTest();
0636:                    //Verify that after uninstallation the user is still on the list components page
0637:                    verifyTrue(selenium
0638:                            .isElementPresent(JBIIdConstants.JBI_EE_NEW_INSTALL_BUTTON_ID));
0639:                } catch (Exception e) {
0640:                    e.printStackTrace();
0641:                    //ToDo Add Logging statements
0642:                    System.out
0643:                            .println("Undeploying SA/Target components failed:"
0644:                                    + e.getMessage());
0645:                }
0646:            }
0647:
0648:            /*********************************************************************/
0649:            /*************Cluster Profile ->StandAlone Instancens Test Cases*****/
0650:            /*********************************************************************/
0651:
0652:            /********************************************************************/
0653:            /*Test invalid archives for shared libary installation using copy path
0654:             ********************************************************************/
0655:
0656:            //@Test(groups = {"invalidCopySLSvr"}, dependsOnGroups = {"undeploySA"})  
0657:            @Test(groups={"invalidCopySLSvr"})
0658:            private void runInvalidArchiveSLServerTest() {
0659:                navigateToSvrListPage(JBIIdConstants.JBI_EE_SERVER_SL_LIST_PAGE_ID);
0660:                clickNewButton(JBIIdConstants.JBI_EE_SERVER_CLUSTER_NEW_INSTALL_BUTTON_ID);
0661:                selenium
0662:                        .waitForCondition(
0663:                                "selenium.browserbot.isNewPageLoaded()",
0664:                                TIMEOUT_PERIOD);
0665:                invalidSLTest();
0666:            }
0667:
0668:            /********************************************************************/
0669:
0670:            /*Test Installation of Shared Library works using the upload path*/
0671:            @Test(groups={"uploadSLSvr"},dependsOnGroups={"invalidCopySLSvr"})
0672:            private void runUploadShareLibraryServerTest() {
0673:                try {
0674:                    navigateToSvrListPage(JBIIdConstants.JBI_EE_SERVER_SL_LIST_PAGE_ID);
0675:
0676:                    //occassionaly the Shared Libraries link is not found and then we need to uncomment 
0677:                    //following statement
0678:                    clickNewButton(JBIIdConstants.JBI_EE_SERVER_CLUSTER_NEW_INSTALL_BUTTON_ID);
0679:                    installArchiveFirstStep(
0680:                            JBIIdConstants.JBI_LIBRARY_INSTALL_UPLOAD_FIELD_ID,
0681:                            JBI_LIB_VALID_SL_ONLY_TEST_ARCHIVE,
0682:                            JBIIdConstants.JBI_LIBRARY_INSTALL_NEXT_BUTTON_ID);
0683:                    selenium
0684:                            .click(JBIIdConstants.JBI_EE_SERVER_CLUSTER_LIBRARY_INSTALL_FINISH_BUTTON_ID);
0685:                    selenium.waitForCondition(
0686:                            "selenium.browserbot.isNewPageLoaded()",
0687:                            TIMEOUT_PERIOD);
0688:
0689:                    //Verify that the finish step brought back to the list Shared library page
0690:                    verifyTrue(selenium
0691:                            .isElementPresent(JBIIdConstants.JBI_EE_SERVER_CLUSTER_NEW_INSTALL_BUTTON_ID));
0692:                } catch (Exception e) {
0693:                    e.printStackTrace();
0694:                    //ToDo Add Logging statements
0695:                    System.out
0696:                            .println("Uploading Shared library failed for Server:"
0697:                                    + e.getMessage());
0698:                }
0699:            }
0700:
0701:            /********************************************************************/
0702:            /*Test invalid archives for Component installation using copy path 
0703:             *For Cluster profile Server instances***************************/
0704:            /********************************************************************/
0705:            @Test(groups={"invalidCopyCompSvr"},dependsOnGroups={"uploadSLSvr"})
0706:            private void runInvalidArchiveCompServerTest() {
0707:                navigateToSvrListPage(JBIIdConstants.JBI_EE_SERVER_COMP_LIST_PAGE_ID);
0708:                clickNewButton(JBIIdConstants.JBI_EE_SERVER_CLUSTER_NEW_INSTALL_BUTTON_ID);
0709:                invalidCompTest();
0710:            }
0711:
0712:            /********************************************************************/
0713:            /*********Install Component Using Upload Path for Cluster**************/
0714:            /********************************************************************/
0715:
0716:            @Test(groups={"installCompSvr"},dataProvider="compInstallationData",dependsOnGroups={"invalidCopyCompSvr"})
0717:            public void runUploadComponentServerTest(String aCompName) {
0718:                try {
0719:                    navigateToSvrListPage(JBIIdConstants.JBI_EE_SERVER_COMP_LIST_PAGE_ID);
0720:                    clickNewButton(JBIIdConstants.JBI_EE_SERVER_CLUSTER_NEW_INSTALL_BUTTON_ID);
0721:                    installArchiveFirstStep(
0722:                            JBIIdConstants.JBI_COMPONENT_INSTALL_UPLOAD_FIELD_ID,
0723:                            aCompName,
0724:                            JBIIdConstants.JBI_COMPONENT_INSTALL_NEXT_BUTTON_ID);
0725:
0726:                    //Verify that the second step of install wizard has the right heading text and two configuration table presence
0727:                    //              verifyTrue(selenium.isTextPresent(JBIResourceConstants.JBI_COMP_INSTALL_WIZ_STEP2_TITLE));
0728:                    //              verifyTrue(selenium.isTextPresent(JBIResourceConstants.JBI_COMP_INSTALL_CONF_PROP_TBL_TITLE));
0729:                    //              verifyTrue(selenium.isTextPresent(JBIResourceConstants.JBI_COMP_INSTALL_PROP_TBL_TITLE));
0730:
0731:                    selenium
0732:                            .click(JBIIdConstants.JBI_EE_SERVER_CLUSTER_COMPONENT_INSTALL_FINISH_BUTTON_ID);
0733:                } catch (Exception e) {
0734:                    e.printStackTrace();
0735:                    //ToDo Add Logging statements
0736:                    System.out
0737:                            .println("Uploading Components failed for Server:"
0738:                                    + e.getMessage());
0739:                }
0740:            }
0741:
0742:            /********************************************************************/
0743:            /*Test invalid archives for SA Deployment using copy path
0744:             ********************************************************************/
0745:            @Test(groups={"invalidCopySASvr"},dependsOnGroups={"installCompSvr"})
0746:            private void runInvalidArchiveServiceAssemblyServerTest() {
0747:                navigateToSvrListPage(JBIIdConstants.JBI_EE_SERVER_COMP_LIST_PAGE_ID);
0748:                //workaround to use common function, SA page is first page displayed
0749:                //No clicking of tab is required which navigate does..
0750:                selenium
0751:                        .waitForCondition(
0752:                                "selenium.browserbot.isNewPageLoaded()",
0753:                                TIMEOUT_PERIOD);
0754:                selenium.click(JBIIdConstants.JBI_EE_SERVER_SA_LIST_PAGE_ID);
0755:
0756:                clickNewButton(JBIIdConstants.JBI_EE_SERVER_CLUSTER_NEW_INSTALL_BUTTON_ID);
0757:                invalidSATest();
0758:            }
0759:
0760:            /********************************************************************/
0761:            /************Deploy Service Assembly for Servers using Upload Path***/
0762:            /********************************************************************/
0763:
0764:            @Parameters({"saName"})
0765:            @Test(groups={"deploySASvr"},dependsOnGroups={"invalidCopySASvr"})
0766:            public void runUploadServiceAssemblyServerTest(
0767:                    String aDeploymentName) {
0768:                try {
0769:                    navigateToSvrListPage(JBIIdConstants.JBI_EE_SERVER_COMP_LIST_PAGE_ID);
0770:                    //workaround to use common function, SA page is first page displayed
0771:                    //No clicking of tab is required which navigate does..
0772:                    selenium.waitForCondition(
0773:                            "selenium.browserbot.isNewPageLoaded()",
0774:                            TIMEOUT_PERIOD);
0775:                    selenium
0776:                            .click(JBIIdConstants.JBI_EE_SERVER_SA_LIST_PAGE_ID);
0777:
0778:                    //Deploy Service Assembly whose SU targets the previously installed two components
0779:                    //selenium.waitForCondition("selenium.browserbot.isNewPageLoaded()", TIMEOUT_PERIOD);
0780:                    //selenium.waitForPageToLoad("9000");
0781:                    uploadSAServerCluster(aDeploymentName);
0782:                } catch (Exception e) {
0783:                    e.printStackTrace();
0784:                    //ToDo Add Logging statements
0785:                    System.out
0786:                            .println("Deploying/Uploading SA failed for Server path:"
0787:                                    + e.getMessage());
0788:                }
0789:            }
0790:
0791:            /********************************************************************/
0792:            /*Test the Table of the Library page shows up fine and has major components*/
0793:            /********************************************************************/
0794:
0795:            @Test(groups={"listSLSvr"},dependsOnGroups={"deploySASvr"})
0796:            private void runListLibraryServerTest() {
0797:                try {
0798:                    navigateToSvrListPage(JBIIdConstants.JBI_EE_SERVER_SL_LIST_PAGE_ID);
0799:                    selenium.waitForCondition(
0800:                            "selenium.browserbot.isNewPageLoaded()",
0801:                            TIMEOUT_PERIOD);
0802:
0803:                    //Verify the presence of Heading, Inline Help Text, Tables Header, Column header and table Select/Deselect All
0804:                    //Components . Also check Install, Uninstall buttons presence.
0805:                    verifyTrue(selenium
0806:                            .isTextPresent(JBIResourceConstants.JBI_EE_SERVER_LIST_LIB_PAGE_INLINE_HELP));
0807:                    verifyTrue(selenium
0808:                            .isTextPresent(JBIResourceConstants.JBI_LIST_LIB_PAGE_TITLE)); //Tests Page Title & Table Title
0809:                    runListCommonServerCluster();
0810:                } catch (Exception e) {
0811:                    e.printStackTrace();
0812:                    //ToDo Add Logging statements
0813:                    System.out
0814:                            .println("Listing Table of Library failed Server:"
0815:                                    + e.getMessage());
0816:                }
0817:            }
0818:
0819:            /**************************************************************************/
0820:            /*Test the Table of the Components page shows up fine and has major components*/
0821:            /**************************************************************************/
0822:
0823:            @Test(groups={"listCompSvr"},dependsOnGroups={"listSLSvr"})
0824:            private void runListComponentServerTest() {
0825:                try {
0826:                    navigateToSvrListPage(JBIIdConstants.JBI_EE_SERVER_COMP_LIST_PAGE_ID);
0827:                    selenium.waitForCondition(
0828:                            "selenium.browserbot.isNewPageLoaded()",
0829:                            TIMEOUT_PERIOD);
0830:
0831:                    //Verify the presence of Heading, Inline Help Text, Tables Header, Column header and table Select/Deselect All
0832:                    //Components . Also check Install, Uninstall buttons, Enable/Disable Buttons presence.
0833:
0834:                    verifyTrue(selenium
0835:                            .isTextPresent(JBIResourceConstants.JBI_LIST_COMP_PAGE_TITLE));
0836:                    verifyTrue(selenium
0837:                            .isTextPresent(JBIResourceConstants.JBI_EE_SERVER_LIST_COMP_PAGE_INLINE_HELP));
0838:                    verifyTrue(selenium
0839:                            .isTextPresent(JBIResourceConstants.JBI_EE_SERVER_CLUSTER_LIST_COMP_TABLE_TITLE_TEXT));
0840:                    verifyTrue(selenium
0841:                            .isTextPresent(JBIResourceConstants.JBI_LIST_TABLE_TYPE_HEADER));
0842:                    verifyTrue(selenium
0843:                            .isTextPresent(JBIResourceConstants.JBI_LIST_TABLE_ACTION_HEADER));
0844:                    runListCompSAServerCluster();
0845:                } catch (Exception e) {
0846:                    e.printStackTrace();
0847:                    //ToDo Add Logging statements
0848:                    System.out
0849:                            .println("Listing Table of Components failed Server:"
0850:                                    + e.getMessage());
0851:                }
0852:            }
0853:
0854:            /**************************************************************************/
0855:            /*Test the Table of the Components page shows up fine and has major components*/
0856:            /**************************************************************************/
0857:
0858:            @Test(groups={"listServiceAssemblySvr"},dependsOnGroups={"listCompSvr"})
0859:            private void runListServiceAssemblyServerTest() {
0860:                try {
0861:                    navigateToSvrListPage(JBIIdConstants.JBI_EE_SERVER_COMP_LIST_PAGE_ID);
0862:                    //workaround to use common function, SA page is first page displayed
0863:                    //No clicking of tab is required which navigate does..
0864:                    selenium.waitForCondition(
0865:                            "selenium.browserbot.isNewPageLoaded()",
0866:                            TIMEOUT_PERIOD);
0867:                    selenium
0868:                            .click(JBIIdConstants.JBI_EE_SERVER_SA_LIST_PAGE_ID);
0869:                    selenium.waitForCondition(
0870:                            "selenium.browserbot.isNewPageLoaded()",
0871:                            TIMEOUT_PERIOD);
0872:
0873:                    //Verify the presence of Heading, Inline Help Text, Tables Header, Column header and table Select/Deselect All
0874:                    //Components .
0875:                    verifyTrue(selenium
0876:                            .isTextPresent(JBIResourceConstants.JBI_LIST_SA_PAGE_TITLE));//Page & Table Title
0877:                    verifyTrue(selenium
0878:                            .isTextPresent(JBIResourceConstants.JBI_EE_SERVER_LIST_SA_PAGE_INLINE_HELP));
0879:                    runListCompSAServerCluster();
0880:                } catch (Exception e) {
0881:                    e.printStackTrace();
0882:                    //ToDo Add Logging statements
0883:                    System.out
0884:                            .println("Listing Table of Service Assembly faile Server:"
0885:                                    + e.getMessage());
0886:                }
0887:            }
0888:
0889:            /**************************************************************************/
0890:            /*Test Show pages of Shared Library works and has two tabs (General, Descriptor)*/
0891:            /**************************************************************************/
0892:
0893:            @Test(groups={"showSLSvr"},dependsOnGroups={"listServiceAssemblySvr"})
0894:            private void runShowShareLibraryServerTest() {
0895:                try {
0896:                    navigateToSvrListPage(JBIIdConstants.JBI_EE_SERVER_SL_LIST_PAGE_ID);
0897:                    clickNameHyperLink(JBIIdConstants.JBI_EE_SERVER_CLUSTER_LIST_PAGE_FIRST_ELEM_NAME_LINK_ID);
0898:                    runShowShareLibraryCommonTest();
0899:                } catch (Exception e) {
0900:                    e.printStackTrace();
0901:                    System.out
0902:                            .println("Show tabs  Shared library failed Server:"
0903:                                    + e.getMessage());
0904:                }
0905:            }
0906:
0907:            /**************************************************************************/
0908:            /*Click Name link in List Components page to see the details of each component 
0909:            Verify that Components have 5 tabs */
0910:            /**************************************************************************/
0911:
0912:            @Test(groups={"showCompSvr"},dependsOnGroups={"showSLSvr"})
0913:            private void runShowComponentServerTest() {
0914:                try {
0915:                    navigateToSvrListPage(JBIIdConstants.JBI_EE_SERVER_COMP_LIST_PAGE_ID);
0916:                    //occassionaly the Shared Libraries link is not found and then we need to uncomment 
0917:                    //following statement
0918:                    clickNameHyperLink(JBIIdConstants.JBI_EE_SERVER_CLUSTER_LIST_PAGE_FIRST_ELEM_NAME_LINK_ID);
0919:                    runShowComponentCommonTest();
0920:                } catch (Exception e) {
0921:                    //e.printStackTrace();
0922:                    //ToDo Add Logging statements
0923:                    System.out
0924:                            .println("Show Components test case failure Server:"
0925:                                    + e.getMessage());
0926:                }
0927:            }
0928:
0929:            /**************************************************************************/
0930:            /*Tests the show detail pages of Service Assemblies in developer-profile */
0931:            /**************************************************************************/
0932:
0933:            @Test(groups={"showSASvr"},dependsOnGroups={"showCompSvr"})
0934:            private void runShowServiceAssemblyServerTest() {
0935:                //Testing JBI Deployments Show pages which have 2 tabs General and Descriptor tab
0936:                try {
0937:                    navigateToSvrListPage(JBIIdConstants.JBI_EE_SERVER_COMP_LIST_PAGE_ID);
0938:                    //workaround to use common function, SA page is first page displayed
0939:                    //No clicking of tab is required which navigate does..
0940:                    selenium.waitForCondition(
0941:                            "selenium.browserbot.isNewPageLoaded()",
0942:                            TIMEOUT_PERIOD);
0943:                    selenium
0944:                            .click(JBIIdConstants.JBI_EE_SERVER_SA_LIST_PAGE_ID);
0945:                    clickNameHyperLink(JBIIdConstants.JBI_EE_SERVER_CLUSTER_LIST_PAGE_FIRST_ELEM_NAME_LINK_ID);
0946:                    runShowServiceAssemblyCommonTest();
0947:                } catch (Exception e) {
0948:                    e.printStackTrace();
0949:                    //ToDo Add Logging statements
0950:                    System.out
0951:                            .println("Show Deployments test case failure Server "
0952:                                    + e.getMessage());
0953:                }
0954:            }
0955:
0956:            /**************************************************************************/
0957:            /***************Operate on the component : Tested transitions*************/
0958:            /*************a) Enable->Disable->Enable On all Targets*******************/
0959:            /**************************************************************************/
0960:
0961:            @Test(groups={"operateCompSvr"},dependsOnGroups={"showSASvr"})
0962:            private void runOperateComponentServerTest() {
0963:                try {
0964:                    //Operate Components using Enable/Disable Buttons
0965:                    navigateToSvrListPage(JBIIdConstants.JBI_EE_SERVER_COMP_LIST_PAGE_ID);
0966:                    selenium.waitForCondition(
0967:                            "selenium.browserbot.isNewPageLoaded()",
0968:                            TIMEOUT_PERIOD);
0969:                    runOperateCompSAServerCluster();
0970:                } catch (Exception e) {
0971:                    e.printStackTrace();
0972:                    //ToDo Add Logging statements
0973:                    System.out.println("Operating Components failed Server:"
0974:                            + e.getMessage());
0975:                }
0976:            }
0977:
0978:            /**************************************************************************/
0979:            /******Operate the service assembly : Tested transitions******************/
0980:            /**********a) Enable->Disable->Enable************************************/
0981:            /**************************************************************************/
0982:
0983:            @Test(groups={"operateSASvr"},dependsOnGroups={"operateCompSvr"})
0984:            private void runOperateServiceAssemblyServerTest() {
0985:                //Testing JBI Deployments lifecycle operations 
0986:                try {
0987:                    navigateToSvrListPage(JBIIdConstants.JBI_EE_SERVER_COMP_LIST_PAGE_ID);
0988:                    //workaround to use common function, SA page is first page displayed
0989:                    //No clicking of tab is required which navigate does..
0990:                    selenium.waitForCondition(
0991:                            "selenium.browserbot.isNewPageLoaded()",
0992:                            TIMEOUT_PERIOD);
0993:                    selenium
0994:                            .click(JBIIdConstants.JBI_EE_SERVER_SA_LIST_PAGE_ID);
0995:                    //Enable/Disable the Service Assembly 
0996:                    selenium.waitForCondition(
0997:                            "selenium.browserbot.isNewPageLoaded()",
0998:                            TIMEOUT_PERIOD);
0999:
1000:                    runOperateCompSAServerCluster();
1001:                } catch (Exception e) {
1002:                    e.printStackTrace();
1003:                    //ToDo Add Logging statements
1004:                    System.out
1005:                            .println("Operation Service Assembly test case failure Server"
1006:                                    + e.getMessage());
1007:                }
1008:            }
1009:
1010:            /**************************************************************************/
1011:            /***********Tests Uninstallation of JBI Shared Library works *************/
1012:            /**************************************************************************/
1013:
1014:            @Test(groups={"uninstallSLSvr"},dependsOnGroups={"operateSASvr"})
1015:            private void runUninstallShareLibraryServerTest() {
1016:                try {
1017:                    navigateToSvrListPage(JBIIdConstants.JBI_EE_SERVER_SL_LIST_PAGE_ID);
1018:                    selenium.waitForCondition(
1019:                            "selenium.browserbot.isNewPageLoaded()",
1020:                            TIMEOUT_PERIOD);
1021:                    //Assuming that first element is Sun Wsdl library and second is valid-sl-only 
1022:                    //selecting the second element in the table for uninstallation
1023:                    uninstallChecked(
1024:                            JBIIdConstants.JBI_EE_SERVER_CLUSTER_LIST_PAGE_SECOND_ELEM_CB_ID,
1025:                            JBIResourceConstants.JBI_EE_LIB_DELETION_MSG);
1026:                } catch (Exception e) {
1027:                    e.printStackTrace();
1028:                    //ToDo Add Logging statements
1029:                    System.out
1030:                            .println("Uninstalling Shared library failed Server:"
1031:                                    + e.getMessage());
1032:                }
1033:            }
1034:
1035:            /**************************************************************************/
1036:            /*Tests uninstallation of SA and components. Service Assembly and components  have to be in shutdown
1037:            state before uninstalling. This tests change their states to shutdown before deleting them*/
1038:            /**************************************************************************/
1039:
1040:            @Test(groups={"undeploySASvr"},dependsOnGroups={"uninstallSLSvr"})
1041:            private void runUndeployServiceAssemblyServerTest() {
1042:                try {
1043:                    //Navigate to SA Tab after visiting Components Tab..
1044:                    navigateToSvrListPage(JBIIdConstants.JBI_EE_SERVER_COMP_LIST_PAGE_ID);
1045:                    selenium.waitForCondition(
1046:                            "selenium.browserbot.isNewPageLoaded()",
1047:                            TIMEOUT_PERIOD);
1048:                    selenium
1049:                            .click(JBIIdConstants.JBI_EE_SERVER_SA_LIST_PAGE_ID);
1050:
1051:                    selenium.waitForCondition(
1052:                            "selenium.browserbot.isNewPageLoaded()",
1053:                            TIMEOUT_PERIOD);
1054:                    runUndeploySAServerClusterTest();
1055:
1056:                    //Choose the components for uninstallation. 
1057:                    navigateToSvrListPage(JBIIdConstants.JBI_EE_SERVER_COMP_LIST_PAGE_ID);
1058:                    selenium.waitForCondition(
1059:                            "selenium.browserbot.isNewPageLoaded()",
1060:                            TIMEOUT_PERIOD);
1061:
1062:                    //sort the Components by Name so that the top two are manage-binding 1 and 2 which are
1063:                    //target components for  undeployed SA's SU's.
1064:                    selenium
1065:                            .click(JBIIdConstants.JBI_EE_SERVER_CLUSTER_SORT_NAME_BUTTON_ID);
1066:                    runUninstallComponentServerClusterTest();
1067:                    runUninstallComponentServerClusterTest();
1068:                    //Verify that after uninstallation the user is still on the list components page
1069:                    verifyTrue(selenium
1070:                            .isElementPresent(JBIIdConstants.JBI_EE_SERVER_CLUSTER_NEW_INSTALL_BUTTON_ID));
1071:                } catch (Exception e) {
1072:                    e.printStackTrace();
1073:                    //ToDo Add Logging statements
1074:                    System.out
1075:                            .println("Undeploying SA/Target components failed CLuster:"
1076:                                    + e.getMessage());
1077:                }
1078:            }
1079:
1080:            /*********************************************************************/
1081:            /*************Cluster Profile ->Clusters Tests ***********************/
1082:            /*********************************************************************/
1083:
1084:            /**************Pre-Condition*****************************************/
1085:            /****Have a Running CLuster with at least one running instance *****/
1086:
1087:            //Use the following dependency when You want to Chain the Server tests 
1088:            //followed by Cluster tests
1089:            //@Test(groups = {"invalidCopySLClstr"}, dependsOnGroups = {"undeploySASvr"})  
1090:            //Run only Cluster Node's ->JBI Tab tests 
1091:            @Test(groups={"invalidCopySLClstr"})
1092:            private void runInvalidArchiveSLClusterTest() {
1093:                navigateToClstrListPage(JBIIdConstants.JBI_EE_CLUSTER_SL_LIST_PAGE_ID);
1094:                clickNewButton(JBIIdConstants.JBI_EE_SERVER_CLUSTER_NEW_INSTALL_BUTTON_ID);
1095:                selenium
1096:                        .waitForCondition(
1097:                                "selenium.browserbot.isNewPageLoaded()",
1098:                                TIMEOUT_PERIOD);
1099:                invalidSLTest();
1100:            }
1101:
1102:            /********************************************************************/
1103:            /*Test Installation of Shared Library works using the upload path*/
1104:            /********************************************************************/
1105:
1106:            @Test(groups={"uploadSLClstr"},dependsOnGroups={"invalidCopySLClstr"})
1107:            private void runUploadShareLibraryClusterTest() {
1108:                navigateToClstrListPage(JBIIdConstants.JBI_EE_CLUSTER_SL_LIST_PAGE_ID);
1109:
1110:                //occassionaly the Shared Libraries link is not found and then we need to uncomment 
1111:                //following statement
1112:                clickNewButton(JBIIdConstants.JBI_EE_SERVER_CLUSTER_NEW_INSTALL_BUTTON_ID);
1113:                installArchiveFirstStep(
1114:                        JBIIdConstants.JBI_LIBRARY_INSTALL_UPLOAD_FIELD_ID,
1115:                        JBI_LIB_VALID_SL_ONLY_TEST_ARCHIVE,
1116:                        JBIIdConstants.JBI_LIBRARY_INSTALL_NEXT_BUTTON_ID);
1117:                selenium
1118:                        .click(JBIIdConstants.JBI_EE_SERVER_CLUSTER_LIBRARY_INSTALL_FINISH_BUTTON_ID);
1119:                selenium
1120:                        .waitForCondition(
1121:                                "selenium.browserbot.isNewPageLoaded()",
1122:                                TIMEOUT_PERIOD);
1123:
1124:                //Verify that the finish step brought back to the list Shared library page
1125:                verifyTrue(selenium
1126:                        .isElementPresent(JBIIdConstants.JBI_EE_SERVER_CLUSTER_NEW_INSTALL_BUTTON_ID));
1127:            }
1128:
1129:            /********************************************************************/
1130:            /*Test invalid archives for Component installation using copy path*/
1131:            /********************************************************************/
1132:
1133:            @Test(groups={"invalidCopyCompClstr"},dependsOnGroups={"uploadSLClstr"})
1134:            private void runInvalidArchiveComponentClusterTest() {
1135:                navigateToClstrListPage(JBIIdConstants.JBI_EE_CLUSTER_COMP_LIST_PAGE_ID);
1136:                clickNewButton(JBIIdConstants.JBI_EE_SERVER_CLUSTER_NEW_INSTALL_BUTTON_ID);
1137:                invalidCompTest();
1138:            }
1139:
1140:            /********************************************************************/
1141:            /*********Install Component Using Upload Path for Cluster**************/
1142:            /********************************************************************/
1143:
1144:            @Test(groups={"installCompClstr"},dataProvider="compInstallationData",dependsOnGroups={"invalidCopyCompClstr"})
1145:            public void runUploadComponentClusterTest(String aCompName) {
1146:                navigateToClstrListPage(JBIIdConstants.JBI_EE_CLUSTER_COMP_LIST_PAGE_ID);
1147:                clickNewButton(JBIIdConstants.JBI_EE_SERVER_CLUSTER_NEW_INSTALL_BUTTON_ID);
1148:                installArchiveFirstStep(
1149:                        JBIIdConstants.JBI_COMPONENT_INSTALL_UPLOAD_FIELD_ID,
1150:                        aCompName,
1151:                        JBIIdConstants.JBI_COMPONENT_INSTALL_NEXT_BUTTON_ID);
1152:
1153:                //Verify that the second step of install wizard has the right heading text and two configuration table presence
1154:                //              verifyTrue(selenium.isTextPresent(JBIResourceConstants.JBI_COMP_INSTALL_WIZ_STEP2_TITLE));
1155:                //              verifyTrue(selenium.isTextPresent(JBIResourceConstants.JBI_COMP_INSTALL_CONF_PROP_TBL_TITLE));
1156:                //              verifyTrue(selenium.isTextPresent(JBIResourceConstants.JBI_COMP_INSTALL_PROP_TBL_TITLE));
1157:
1158:                selenium
1159:                        .click(JBIIdConstants.JBI_EE_SERVER_CLUSTER_COMPONENT_INSTALL_FINISH_BUTTON_ID);
1160:            }
1161:
1162:            /********************************************************************/
1163:            /*Test invalid archives for SA Deployment using copy path
1164:             ********************************************************************/
1165:            @Test(groups={"invalidCopySAClstr"},dependsOnGroups={"installCompClstr"})
1166:            private void runInvalidArchiveSAClusterTest() {
1167:                navigateToClstrListPage(JBIIdConstants.JBI_EE_CLUSTER_COMP_LIST_PAGE_ID);
1168:                selenium
1169:                        .waitForCondition(
1170:                                "selenium.browserbot.isNewPageLoaded()",
1171:                                TIMEOUT_PERIOD);
1172:                selenium.click(JBIIdConstants.JBI_EE_CLUSTER_SA_LIST_PAGE_ID);
1173:                clickNewButton(JBIIdConstants.JBI_EE_SERVER_CLUSTER_NEW_INSTALL_BUTTON_ID);
1174:                invalidSATest();
1175:            }
1176:
1177:            /********************************************************************/
1178:            /************Deploy Service Assembly for Clusters using Upload Path***/
1179:            /********************************************************************/
1180:
1181:            @Parameters({"saName"})
1182:            @Test(groups={"deploySAClstr"},dependsOnGroups={"invalidCopySAClstr"})
1183:            public void runUploadServiceAssemblyClusterTest(
1184:                    String aDeploymentName) {
1185:                navigateToClstrListPage(JBIIdConstants.JBI_EE_CLUSTER_COMP_LIST_PAGE_ID);
1186:                selenium
1187:                        .waitForCondition(
1188:                                "selenium.browserbot.isNewPageLoaded()",
1189:                                TIMEOUT_PERIOD);
1190:                selenium.click(JBIIdConstants.JBI_EE_CLUSTER_SA_LIST_PAGE_ID);
1191:
1192:                //Deploy Service Assembly whose SU targets the previously installed two components
1193:                //selenium.waitForCondition("selenium.browserbot.isNewPageLoaded()", TIMEOUT_PERIOD);
1194:                //selenium.waitForPageToLoad("9000");
1195:                uploadSAServerCluster(aDeploymentName);
1196:            }
1197:
1198:            /********************************************************************/
1199:            /*Test the Table of the Library page shows up fine and has major components*/
1200:            /********************************************************************/
1201:
1202:            @Test(groups={"listSLClstr"},dependsOnGroups={"deploySAClstr"})
1203:            private void runListLibraryClusterTest() {
1204:                navigateToClstrListPage(JBIIdConstants.JBI_EE_CLUSTER_SL_LIST_PAGE_ID);
1205:                selenium
1206:                        .waitForCondition(
1207:                                "selenium.browserbot.isNewPageLoaded()",
1208:                                TIMEOUT_PERIOD);
1209:
1210:                //Verify the presence of Heading, Inline Help Text, Tables Header, Column header and table Select/Deselect All
1211:                //Components . Also check presence of Install, Uninstall buttons
1212:                verifyTrue(selenium
1213:                        .isTextPresent(JBIResourceConstants.JBI_EE_CLUSTER_LIST_LIB_PAGE_INLINE_HELP));
1214:                verifyTrue(selenium
1215:                        .isTextPresent(JBIResourceConstants.JBI_LIST_LIB_PAGE_TITLE)); //Tests Page Title & Table Title
1216:                runListCommonServerCluster();
1217:            }
1218:
1219:            /**************************************************************************/
1220:            /*Test the Table of the Components page shows up fine and has major components*/
1221:            /**************************************************************************/
1222:
1223:            @Test(groups={"listCompClstr"},dependsOnGroups={"listSLClstr"})
1224:            private void runListComponentClusterTest() {
1225:                navigateToClstrListPage(JBIIdConstants.JBI_EE_CLUSTER_SL_LIST_PAGE_ID);
1226:                selenium
1227:                        .waitForCondition(
1228:                                "selenium.browserbot.isNewPageLoaded()",
1229:                                TIMEOUT_PERIOD);
1230:
1231:                //Verify the presence of Heading, Inline Help Text, Tables Header, Column header and table Select/Deselect All
1232:                //Components . Also check Install, Uninstall buttons, Operations DropDown, Filter by State/Type DropDown presence.
1233:                verifyTrue(selenium
1234:                        .isTextPresent(JBIResourceConstants.JBI_LIST_COMP_PAGE_TITLE));
1235:                verifyTrue(selenium
1236:                        .isTextPresent(JBIResourceConstants.JBI_EE_CLUSTER_LIST_COMP_PAGE_INLINE_HELP));
1237:                verifyTrue(selenium
1238:                        .isTextPresent(JBIResourceConstants.JBI_EE_SERVER_CLUSTER_LIST_COMP_TABLE_TITLE_TEXT));
1239:                verifyTrue(selenium
1240:                        .isTextPresent(JBIResourceConstants.JBI_LIST_TABLE_TYPE_HEADER));
1241:                runListCompSAServerCluster();
1242:            }
1243:
1244:            /**************************************************************************/
1245:            /*Test the Table of the Components page shows up fine and has major components*/
1246:            /**************************************************************************/
1247:
1248:            @Test(groups={"listServiceAssemblyClstr"},dependsOnGroups={"listCompClstr"})
1249:            private void runListServiceAssemblyClusterTest() {
1250:                navigateToClstrListPage(JBIIdConstants.JBI_EE_CLUSTER_COMP_LIST_PAGE_ID);
1251:                selenium
1252:                        .waitForCondition(
1253:                                "selenium.browserbot.isNewPageLoaded()",
1254:                                TIMEOUT_PERIOD);
1255:
1256:                //Verify the presence of Heading, Inline Help Text, Tables Header, Column header and table
1257:                //Select/Deselect All Components .
1258:                verifyTrue(selenium
1259:                        .isTextPresent(JBIResourceConstants.JBI_LIST_SA_PAGE_TITLE));//Page & Table Title
1260:                verifyTrue(selenium
1261:                        .isTextPresent(JBIResourceConstants.JBI_EE_CLUSTER_LIST_SA_PAGE_INLINE_HELP));
1262:                runListCompSAServerCluster();
1263:            }
1264:
1265:            /**************************************************************************/
1266:            /*Test Show pages of Shared Library works and has two tabs (General, Descriptor)*/
1267:            /**************************************************************************/
1268:
1269:            @Test(groups={"showSLClstr"},dependsOnGroups={"listServiceAssemblyClstr"})
1270:            private void runShowShareLibraryClusterTest() {
1271:                navigateToClstrListPage(JBIIdConstants.JBI_EE_CLUSTER_SL_LIST_PAGE_ID);
1272:                clickNameHyperLink(JBIIdConstants.JBI_EE_SERVER_CLUSTER_LIST_PAGE_FIRST_ELEM_NAME_LINK_ID);
1273:                runShowShareLibraryCommonTest();
1274:            }
1275:
1276:            /**************************************************************************/
1277:            /*Click Name link in List Components page to see the details of each component 
1278:            Verify that Components have 5 tabs */
1279:            /**************************************************************************/
1280:
1281:            @Test(groups={"showCompClstr"},dependsOnGroups={"showSLClstr"})
1282:            private void runShowComponentClusterTest() {
1283:                navigateToClstrListPage(JBIIdConstants.JBI_EE_CLUSTER_COMP_LIST_PAGE_ID);
1284:                //occassionaly the Shared Libraries link is not found and then we need to uncomment 
1285:                //following statement
1286:                clickNameHyperLink(JBIIdConstants.JBI_EE_SERVER_CLUSTER_LIST_PAGE_FIRST_ELEM_NAME_LINK_ID);
1287:                runShowComponentCommonTest();
1288:            }
1289:
1290:            /**************************************************************************/
1291:            /*Tests the show detail pages of Service Assemblies in developer-profile */
1292:            /**************************************************************************/
1293:
1294:            @Test(groups={"showSAClstr"},dependsOnGroups={"showCompClstr"})
1295:            private void runShowServiceAssemblyClusterTest() {
1296:                navigateToClstrListPage(JBIIdConstants.JBI_EE_CLUSTER_COMP_LIST_PAGE_ID);
1297:                selenium
1298:                        .waitForCondition(
1299:                                "selenium.browserbot.isNewPageLoaded()",
1300:                                TIMEOUT_PERIOD);
1301:                selenium.click(JBIIdConstants.JBI_EE_CLUSTER_SA_LIST_PAGE_ID);
1302:                clickNameHyperLink(JBIIdConstants.JBI_EE_SERVER_CLUSTER_LIST_PAGE_FIRST_ELEM_NAME_LINK_ID);
1303:                runShowServiceAssemblyCommonTest();
1304:            }
1305:
1306:            /**************************************************************************/
1307:            /***************Operate on the component : Tested transitions*************/
1308:            /*************a) Enable->Disable->Enable On all Targets*******************/
1309:            /**************************************************************************/
1310:
1311:            @Test(groups={"operateCompClstr"},dependsOnGroups={"showSAClstr"})
1312:            private void runOperateComponentClusterTest() {
1313:                //Operate Components using Enable/Disable Buttons
1314:                navigateToClstrListPage(JBIIdConstants.JBI_EE_CLUSTER_COMP_LIST_PAGE_ID);
1315:                selenium
1316:                        .waitForCondition(
1317:                                "selenium.browserbot.isNewPageLoaded()",
1318:                                TIMEOUT_PERIOD);
1319:                runOperateCompSAServerCluster();
1320:            }
1321:
1322:            /**************************************************************************/
1323:            /******Operate the service assembly : Tested transitions******************/
1324:            /**********a) Enable->Disable->Enable************************************/
1325:            /**************************************************************************/
1326:
1327:            @Test(groups={"operateSAClstr"},dependsOnGroups={"operateCompClstr"})
1328:            private void runOperateServiceAssemblyClusterTest() {
1329:                navigateToClstrListPage(JBIIdConstants.JBI_EE_CLUSTER_COMP_LIST_PAGE_ID);
1330:                //Enable/Disable the Service Assembly 
1331:                selenium
1332:                        .waitForCondition(
1333:                                "selenium.browserbot.isNewPageLoaded()",
1334:                                TIMEOUT_PERIOD);
1335:                runOperateCompSAServerCluster();
1336:            }
1337:
1338:            /**************************************************************************/
1339:            /***********Tests Uninstallation of JBI Shared Library works *************/
1340:            /**************************************************************************/
1341:
1342:            @Test(groups={"uninstallSLClstr"},dependsOnGroups={"operateSAClstr"})
1343:            private void runUninstallShareLibraryClusterTest() {
1344:                navigateToClstrListPage(JBIIdConstants.JBI_EE_CLUSTER_SL_LIST_PAGE_ID);
1345:                selenium
1346:                        .waitForCondition(
1347:                                "selenium.browserbot.isNewPageLoaded()",
1348:                                TIMEOUT_PERIOD);
1349:                //Assuming that first element is Sun Wsdl library and second is valid-sl-only 
1350:                //selecting the second element in the table for uninstallation
1351:                uninstallChecked(
1352:                        JBIIdConstants.JBI_EE_SERVER_CLUSTER_LIST_PAGE_SECOND_ELEM_CB_ID,
1353:                        JBIResourceConstants.JBI_EE_SERVER_CLUSTER_LIB_DELETION_MSG);
1354:            }
1355:
1356:            /**************************************************************************/
1357:            /*Tests uninstallation of SA and components. Service Assembly and components  have to be in shutdown
1358:            state before uninstalling. This tests change their states to shutdown before deleting them*/
1359:            /**************************************************************************/
1360:
1361:            @Test(groups={"undeploySAClstr"},dependsOnGroups={"uninstallSLClstr"})
1362:            private void runUndeployServiceAssemblyClusterTest() {
1363:                navigateToClstrListPage(JBIIdConstants.JBI_EE_CLUSTER_COMP_LIST_PAGE_ID);
1364:                selenium
1365:                        .waitForCondition(
1366:                                "selenium.browserbot.isNewPageLoaded()",
1367:                                TIMEOUT_PERIOD);
1368:                selenium.click(JBIIdConstants.JBI_EE_CLUSTER_SA_LIST_PAGE_ID);
1369:
1370:                //Select the first element in the Service Assembly table . Assuming that this is the only installed
1371:                //SA and in shutdown state.
1372:                selenium
1373:                        .waitForCondition(
1374:                                "selenium.browserbot.isNewPageLoaded()",
1375:                                TIMEOUT_PERIOD);
1376:                runUndeploySAServerClusterTest();
1377:                //Choose the components for uninstallation. 
1378:                navigateToClstrListPage(JBIIdConstants.JBI_EE_CLUSTER_COMP_LIST_PAGE_ID);
1379:                selenium
1380:                        .waitForCondition(
1381:                                "selenium.browserbot.isNewPageLoaded()",
1382:                                TIMEOUT_PERIOD);
1383:
1384:                selenium
1385:                        .click(JBIIdConstants.JBI_EE_SERVER_CLUSTER_SORT_NAME_BUTTON_ID);
1386:                //Navigate to the Components page and uninstall the top two sorted components after disabling them
1387:                runUninstallComponentServerClusterTest();
1388:                runUninstallComponentServerClusterTest();
1389:
1390:                //Verify that after uninstallation the user is still on the list components page
1391:                verifyTrue(selenium
1392:                        .isElementPresent(JBIIdConstants.JBI_EE_SERVER_CLUSTER_NEW_INSTALL_BUTTON_ID));
1393:            }
1394:
1395:            /************************************************************************/
1396:            /*****************Common Functions***************************************/
1397:            /************************************************************************/
1398:
1399:            /**************Commmon Methods for JBI Node Tests*********************/
1400:
1401:            //JBI Node List pages common widgets
1402:            private void runListCommonEE() {
1403:                verifyTrue(selenium
1404:                        .isTextPresent(JBIResourceConstants.JBI_LIST_TABLE_NAME_HEADER));
1405:                verifyTrue(selenium
1406:                        .isElementPresent(JBIIdConstants.JBI_EE_SELECT_MULTIPLE_BUTTON_ID));
1407:                verifyTrue(selenium
1408:                        .isElementPresent(JBIIdConstants.JBI_EE_DESELECT_MULTIPLE_BUTTON_ID));
1409:                verifyTrue(selenium
1410:                        .isElementPresent(JBIIdConstants.JBI_EE_NEW_INSTALL_BUTTON_ID));
1411:                verifyTrue(selenium
1412:                        .isElementPresent(JBIIdConstants.JBI_EE_LIST_PAGE_FIRST_ELEM_CB_ID));
1413:
1414:                selenium
1415:                        .click(JBIIdConstants.JBI_EE_LIST_PAGE_FIRST_ELEM_CB_ID);
1416:                verifyTrue(selenium
1417:                        .isElementPresent(JBIIdConstants.JBI_EE_UNINSTALL_BUTTON_ID));
1418:            }
1419:
1420:            private void runOperateCompSAEE() {
1421:                operateCheckedElement(
1422:                        JBIIdConstants.JBI_EE_LIST_PAGE_FIRST_ELEM_CB_ID,
1423:                        JBIIdConstants.JBI_EE_ENABLE_BUTTON_ID,
1424:                        JBIResourceConstants.JBI_EE_STATUS_ENABLED_ON_ALL_TARGETS,
1425:                        JBIIdConstants.JBI_EE_LIST_PAGE_FIRST_ELEM_STATUS_ID);
1426:
1427:                operateCheckedElement(
1428:                        JBIIdConstants.JBI_EE_LIST_PAGE_FIRST_ELEM_CB_ID,
1429:                        JBIIdConstants.JBI_EE_DISABLE_BUTTON_ID,
1430:                        JBIResourceConstants.JBI_EE_STATUS_DISABLED_ON_ALL_TARGETS,
1431:                        JBIIdConstants.JBI_EE_LIST_PAGE_FIRST_ELEM_STATUS_ID);
1432:
1433:                operateCheckedElement(
1434:                        JBIIdConstants.JBI_EE_LIST_PAGE_FIRST_ELEM_CB_ID,
1435:                        JBIIdConstants.JBI_EE_ENABLE_BUTTON_ID,
1436:                        JBIResourceConstants.JBI_EE_STATUS_ENABLED_ON_ALL_TARGETS,
1437:                        JBIIdConstants.JBI_EE_LIST_PAGE_FIRST_ELEM_STATUS_ID);
1438:            }
1439:
1440:            /**************Commmon Methods for Stand Alone Instances/Cluster Node Tests*********************/
1441:            private void uploadSAServerCluster(String aDeploymentName) {
1442:                clickNewButton(JBIIdConstants.JBI_EE_SERVER_CLUSTER_NEW_INSTALL_BUTTON_ID);
1443:                installArchiveFirstStep(
1444:                        JBIIdConstants.JBI_SERVICE_ASSEMBLY_DEPLOY_UPLOAD_FIELD_ID,
1445:                        aDeploymentName,
1446:                        JBIIdConstants.JBI_SERVICE_ASSEMBLY_DEPLOY_NEXT_BUTTON_ID);
1447:                verifyTrue(selenium
1448:                        .isTextPresent("Deploy JBI Service Assembly (Step 2 of 2)"));
1449:                selenium
1450:                        .click(JBIIdConstants.JBI_EE_SERVER_CLUSTER_SERVICE_ASSEMBLY_DEPLOY_FINISH_BUTTON_ID);
1451:                selenium
1452:                        .waitForCondition(
1453:                                "selenium.browserbot.isNewPageLoaded()",
1454:                                TIMEOUT_PERIOD);
1455:                verifyTrue(selenium.isTextPresent("JBI Service Assemblies"));
1456:            }
1457:
1458:            //Checking Common Elements in Cluster Profile List Pages Of Components/Service Assemblies  
1459:            private void runListCompSAServerCluster() {
1460:                //Components/SA's List Page
1461:                verifyTrue(selenium
1462:                        .isTextPresent(JBIResourceConstants.JBI_EE_SERVER_CLUSTER_LIST_TABLE_HEADER_STATUS_ENABLED));
1463:                runListCommonServerCluster();
1464:                verifyTrue(selenium
1465:                        .isElementPresent(JBIIdConstants.JBI_EE_SERVER_CLUSTER_ENABLE_BUTTON_ID));
1466:                verifyTrue(selenium
1467:                        .isElementPresent(JBIIdConstants.JBI_EE_SERVER_CLUSTER_DISABLE_BUTTON_ID));
1468:            }
1469:
1470:            //Checking Common ELements in Cluster Profile List Pages of SL/Comp/SA
1471:            private void runListCommonServerCluster() {
1472:                verifyTrue(selenium
1473:                        .isTextPresent(JBIResourceConstants.JBI_LIST_TABLE_NAME_HEADER));
1474:                // Also check Install, Remove/Delete buttons,Enable/Disable Buttons, Select/Deselect button image presence.
1475:
1476:                verifyTrue(selenium
1477:                        .isElementPresent(JBIIdConstants.JBI_EE_SERVER_CLUSTER_SELECT_MULTIPLE_BUTTON_ID));
1478:                verifyTrue(selenium
1479:                        .isElementPresent(JBIIdConstants.JBI_EE_SERVER_CLUSTER_DESELECT_MULTIPLE_BUTTON_ID));
1480:                verifyTrue(selenium
1481:                        .isElementPresent(JBIIdConstants.JBI_EE_SERVER_CLUSTER_LIST_PAGE_FIRST_ELEM_CB_ID));
1482:
1483:                selenium
1484:                        .click(JBIIdConstants.JBI_EE_SERVER_CLUSTER_LIST_PAGE_FIRST_ELEM_CB_ID);
1485:                verifyTrue(selenium
1486:                        .isElementPresent(JBIIdConstants.JBI_EE_SERVER_CLUSTER_UNINSTALL_BUTTON_ID));
1487:            }
1488:
1489:            //Cluster and Stand Alone Instances share the same ID for Component Operate widgets
1490:            private void runOperateCompSAServerCluster() {
1491:                operateCheckedElement(
1492:                        JBIIdConstants.JBI_EE_SERVER_CLUSTER_LIST_PAGE_FIRST_ELEM_CB_ID,
1493:                        JBIIdConstants.JBI_EE_SERVER_CLUSTER_ENABLE_BUTTON_ID,
1494:                        JBIResourceConstants.JBI_EE_STATUS_ENABLED_ON_SERVER_CLUSTER,
1495:                        JBIIdConstants.JBI_EE_SERVER_CLUSTER_LIST_PAGE_FIRST_ELEM_STATE_ID);
1496:
1497:                operateCheckedElement(
1498:                        JBIIdConstants.JBI_EE_SERVER_CLUSTER_LIST_PAGE_FIRST_ELEM_CB_ID,
1499:                        JBIIdConstants.JBI_EE_SERVER_CLUSTER_DISABLE_BUTTON_ID,
1500:                        JBIResourceConstants.JBI_EE_STATUS_DISABLED_ON_SERVER_CLUSTER,
1501:                        JBIIdConstants.JBI_EE_SERVER_CLUSTER_LIST_PAGE_FIRST_ELEM_STATE_ID);
1502:
1503:                operateCheckedElement(
1504:                        JBIIdConstants.JBI_EE_SERVER_CLUSTER_LIST_PAGE_FIRST_ELEM_CB_ID,
1505:                        JBIIdConstants.JBI_EE_SERVER_CLUSTER_ENABLE_BUTTON_ID,
1506:                        JBIResourceConstants.JBI_EE_STATUS_ENABLED_ON_SERVER_CLUSTER,
1507:                        JBIIdConstants.JBI_EE_SERVER_CLUSTER_LIST_PAGE_FIRST_ELEM_STATE_ID);
1508:            }
1509:
1510:            private void runUninstallComponentServerClusterTest() {
1511:                //Change the state of the components to shutdown, as components in started state cannot be uninstalled
1512:                operateCheckedElement(
1513:                        JBIIdConstants.JBI_EE_SERVER_CLUSTER_LIST_PAGE_FIRST_ELEM_CB_ID,
1514:                        JBIIdConstants.JBI_EE_SERVER_CLUSTER_DISABLE_BUTTON_ID,
1515:                        JBIResourceConstants.JBI_EE_STATUS_DISABLED_ON_SERVER_CLUSTER,
1516:                        JBIIdConstants.JBI_EE_SERVER_CLUSTER_LIST_PAGE_FIRST_ELEM_STATE_ID);
1517:
1518:                uninstallChecked(
1519:                        JBIIdConstants.JBI_EE_SERVER_CLUSTER_LIST_PAGE_FIRST_ELEM_CB_ID,
1520:                        JBIResourceConstants.JBI_EE_SERVER_CLUSTER_COMP_DELETION_MSG);
1521:            }
1522:
1523:            private void runUndeploySAServerClusterTest() {
1524:                //Disable The Service Assembly as Enabled SA cannot be undeployed
1525:                operateCheckedElement(
1526:                        JBIIdConstants.JBI_EE_SERVER_CLUSTER_LIST_PAGE_FIRST_ELEM_CB_ID,
1527:                        JBIIdConstants.JBI_EE_SERVER_CLUSTER_DISABLE_BUTTON_ID,
1528:                        JBIResourceConstants.JBI_EE_STATUS_DISABLED_ON_SERVER_CLUSTER,
1529:                        JBIIdConstants.JBI_EE_SERVER_CLUSTER_LIST_PAGE_FIRST_ELEM_STATE_ID);
1530:
1531:                uninstallChecked(
1532:                        JBIIdConstants.JBI_EE_SERVER_CLUSTER_LIST_PAGE_FIRST_ELEM_CB_ID,
1533:                        JBIResourceConstants.JBI_EE_SERVER_CLUSTER_SA_DELETION_MSG);
1534:            }
1535:
1536:            private void runShowShareLibraryCommonTest() {
1537:                verifyTrue(selenium
1538:                        .isTextPresent(JBIResourceConstants.JBI_SHOW_GENERAL_TAB));
1539:                verifyTrue(selenium
1540:                        .isTextPresent(JBIResourceConstants.JBI_SHOW_SL_INLINE_HELP));
1541:                verifyTrue(selenium.isTextPresent("Description:"));
1542:                verifyTrue(selenium
1543:                        .isTextPresent(JBIResourceConstants.JBI_SHOW_LIBRARIES_GEN_PAGE_TITLE));
1544:
1545:                selenium.click(JBIIdConstants.JBI_SHOW_EE_DESCRIPTOR_TAB_ID);
1546:                selenium
1547:                        .waitForCondition(
1548:                                "selenium.browserbot.isNewPageLoaded()",
1549:                                TIMEOUT_PERIOD);
1550:                verifyTrue(selenium
1551:                        .isTextPresent(JBIResourceConstants.JBI_SHOW_DESCRIPTOR_TAB));
1552:                verifyTrue(selenium
1553:                        .isTextPresent(JBIResourceConstants.JBI_SHOW_DESCRIPTOR_INLINE_HELP));
1554:
1555:                //Click the Targets tab and verify the inline help's contents
1556:                selenium.click(JBIIdConstants.JBI_SHOW_EE_TARGETS_TAB_ID);
1557:                selenium
1558:                        .waitForCondition(
1559:                                "selenium.browserbot.isNewPageLoaded()",
1560:                                TIMEOUT_PERIOD);
1561:                verifyTrue(selenium
1562:                        .isTextPresent(JBIResourceConstants.JBI_SHOW_TARGETS_TAB));
1563:                verifyTrue(selenium
1564:                        .isTextPresent(JBIResourceConstants.JBI_SHOW_TARGETS_SL_INLINE_HELP));
1565:                verifyTrue(selenium
1566:                        .isElementPresent(JBIIdConstants.JBI_EE_SERVER_CLUSTER_MANAGE_TARGETS_BUTTON_ID));
1567:
1568:                selenium.click(JBIIdConstants.JBI_SHOW_EE_SL_COMPONENTS_TAB_ID);
1569:                selenium
1570:                        .waitForCondition(
1571:                                "selenium.browserbot.isNewPageLoaded()",
1572:                                TIMEOUT_PERIOD);
1573:                verifyTrue(selenium
1574:                        .isTextPresent(JBIResourceConstants.JBI_SHOW_COMPONENTS_TAB));
1575:                verifyTrue(selenium
1576:                        .isTextPresent(JBIResourceConstants.JBI_SHOW_SL_COMP_PAGE_TITLE));
1577:                verifyTrue(selenium
1578:                        .isTextPresent(JBIResourceConstants.JBI_SHOW_SL_COMP_TABLE_TITLE));
1579:                verifyTrue(selenium
1580:                        .isTextPresent(JBIResourceConstants.JBI_SHOW_SL_COMP_PAGE_INLINE_HELP));
1581:                verifyTrue(selenium
1582:                        .isTextPresent(JBIResourceConstants.JBI_LIST_TABLE_DESC_HEADER));
1583:                verifyTrue(selenium
1584:                        .isTextPresent(JBIResourceConstants.JBI_LIST_TABLE_TYPE_HEADER));
1585:                verifyTrue(selenium
1586:                        .isTextPresent(JBIResourceConstants.JBI_LIST_TABLE_NAME_HEADER));
1587:
1588:            }
1589:
1590:            //Show Pages for Component are same for JBI Node, StandAlone Instances and Clusters
1591:            private void runShowComponentCommonTest() {
1592:                //Verify that the General Tab is the tab open by default
1593:                assertTrue(selenium
1594:                        .isTextPresent(JBIResourceConstants.JBI_SHOW_GENERAL_TAB));
1595:
1596:                //Click the Configuration Tab 
1597:                selenium.click(JBIIdConstants.JBI_SHOW_EE_CONFIGURATION_TAB_ID);
1598:                selenium
1599:                        .waitForCondition(
1600:                                "selenium.browserbot.isNewPageLoaded()",
1601:                                TIMEOUT_PERIOD);
1602:                verifyTrue(selenium
1603:                        .isTextPresent(JBIResourceConstants.JBI_SHOW_CONFIGURATION_TAB));
1604:
1605:                //Click the Descriptor Tab
1606:                selenium.click(JBIIdConstants.JBI_SHOW_EE_DESCRIPTOR_TAB_ID);
1607:                selenium
1608:                        .waitForCondition(
1609:                                "selenium.browserbot.isNewPageLoaded()",
1610:                                TIMEOUT_PERIOD);
1611:                assertTrue(selenium
1612:                        .isTextPresent(JBIResourceConstants.JBI_SHOW_DESCRIPTOR_TAB));
1613:
1614:                //Click the Loggers Tab and check for the presence of Load Deafults and Save Button
1615:                selenium.click(JBIIdConstants.JBI_SHOW_EE_LOGGERS_TAB_ID);
1616:                selenium
1617:                        .waitForCondition(
1618:                                "selenium.browserbot.isNewPageLoaded()",
1619:                                TIMEOUT_PERIOD);
1620:                assertTrue(selenium
1621:                        .isTextPresent(JBIResourceConstants.JBI_SHOW_LOGGERS_TAB));
1622:
1623:                verifyTrue(selenium
1624:                        .isElementPresent("jbiShowPropertiesForm:propertyContentPage:loadDefaults"));
1625:                verifyTrue(selenium
1626:                        .isElementPresent("jbiShowPropertiesForm:propertyContentPage:topButtons:saveButton"));
1627:
1628:                //Click the Targets Tab and check for presence of "Manage Targets" Button
1629:                selenium.click(JBIIdConstants.JBI_SHOW_EE_TARGETS_TAB_ID);
1630:                selenium
1631:                        .waitForCondition(
1632:                                "selenium.browserbot.isNewPageLoaded()",
1633:                                TIMEOUT_PERIOD);
1634:                assertTrue(selenium
1635:                        .isTextPresent(JBIResourceConstants.JBI_SHOW_TARGETS_TAB));
1636:                verifyTrue(selenium
1637:                        .isElementPresent(JBIIdConstants.JBI_EE_SERVER_CLUSTER_MANAGE_TARGETS_BUTTON_ID));
1638:
1639:                //Click Monitoring Tab and check for presence of Tables n Columns
1640:
1641:                selenium.click(JBIIdConstants.JBI_SHOW_EE_MONITORING_TAB_ID);
1642:                selenium
1643:                        .waitForCondition(
1644:                                "selenium.browserbot.isNewPageLoaded()",
1645:                                TIMEOUT_PERIOD);
1646:                assertTrue(selenium
1647:                        .isTextPresent(JBIResourceConstants.JBI_SHOW_MONITORING_TAB));
1648:                verifyTrue(selenium
1649:                        .isTextPresent(JBIResourceConstants.JBI_SHOW_COMP_MONITORING_PAGE_TITLE));
1650:                verifyTrue(selenium
1651:                        .isTextPresent(JBIResourceConstants.JBI_SHOW_COMP_MONITORING_PAGE_INLINE_HELP));
1652:                verifyTrue(selenium
1653:                        .isTextPresent(JBIResourceConstants.JBI_SHOW_COMP_MONITORING_TABLE_TITLE));
1654:                verifyTrue(selenium
1655:                        .isTextPresent(JBIResourceConstants.JBI_SHOW_COMP_MONITORING_TBL_ENDP));
1656:                verifyTrue(selenium
1657:                        .isTextPresent(JBIResourceConstants.JBI_SHOW_COMP_MONITORING_TBL_PRO_ENDP));
1658:                verifyTrue(selenium
1659:                        .isTextPresent(JBIResourceConstants.JBI_SHOW_COMP_MONITORING_TBL_CONS_ENDP));
1660:                verifyTrue(selenium
1661:                        .isTextPresent(JBIResourceConstants.JBI_SHOW_COMP_MONITORING_TBL_TTL));
1662:                //Click Libraries Tab and check for presence of Tables n Columns
1663:
1664:                selenium
1665:                        .click(JBIIdConstants.JBI_SHOW_EE_COMP_LIBRARIES_TAB_ID);
1666:                selenium
1667:                        .waitForCondition(
1668:                                "selenium.browserbot.isNewPageLoaded()",
1669:                                TIMEOUT_PERIOD);
1670:                assertTrue(selenium
1671:                        .isTextPresent(JBIResourceConstants.JBI_SHOW_COMP_LIBRARIES_TAB));
1672:                verifyTrue(selenium
1673:                        .isTextPresent(JBIResourceConstants.JBI_SHOW_COMP_LIBRARIES_PAGE_TITLE));
1674:                verifyTrue(selenium
1675:                        .isTextPresent(JBIResourceConstants.JBI_SHOW_COMP_LIBRARIES_INLINE_HELP));
1676:                verifyTrue(selenium
1677:                        .isTextPresent(JBIResourceConstants.JBI_SHOW_COMP_LIBRARIES_TABLE_TITLE));
1678:            }
1679:
1680:            //Show Pages for Component are same for JBI Node, StandAlone Instances and Clusters
1681:            private void runShowServiceAssemblyCommonTest() {
1682:                //Check whether the first and default page is General tab
1683:                assertTrue(selenium
1684:                        .isTextPresent(JBIResourceConstants.JBI_SHOW_GENERAL_TAB));
1685:                verifyTrue(selenium
1686:                        .isTextPresent(JBIResourceConstants.JBI_SHOW_SA_INLINE_HELP));
1687:
1688:                //Click the Descriptor tab and verify the Inline help's contents
1689:                selenium.click(JBIIdConstants.JBI_SHOW_EE_DESCRIPTOR_TAB_ID);
1690:                selenium
1691:                        .waitForCondition(
1692:                                "selenium.browserbot.isNewPageLoaded()",
1693:                                TIMEOUT_PERIOD);
1694:                assertTrue(selenium
1695:                        .isTextPresent(JBIResourceConstants.JBI_SHOW_DESCRIPTOR_TAB));
1696:                assertTrue(selenium
1697:                        .isTextPresent(JBIResourceConstants.JBI_SHOW_DESCRIPTOR_INLINE_HELP));
1698:
1699:                //Click the Targets tab and verify the inline help's contents
1700:                selenium.click(JBIIdConstants.JBI_SHOW_EE_TARGETS_TAB_ID);
1701:                selenium
1702:                        .waitForCondition(
1703:                                "selenium.browserbot.isNewPageLoaded()",
1704:                                TIMEOUT_PERIOD);
1705:                assertTrue(selenium
1706:                        .isTextPresent(JBIResourceConstants.JBI_SHOW_TARGETS_TAB));
1707:                verifyTrue(selenium
1708:                        .isTextPresent(JBIResourceConstants.JBI_SHOW_TARGETS_SA_INLINE_HELP));
1709:                verifyTrue(selenium
1710:                        .isElementPresent(JBIIdConstants.JBI_EE_SERVER_CLUSTER_MANAGE_TARGETS_BUTTON_ID));
1711:            }
1712:
1713:            //All the invalid SL Archives are tested for right validation error messages in Installation wizard 
1714:            private void invalidSLTest() {
1715:
1716:                String radioId = JBIIdConstants.JBI_LIBRARY_INSTALL_FILECHOOSER_RADIO_ID;
1717:                String fieldId = JBIIdConstants.JBI_LIBRARY_INSTALL_FILECHOOSER_FIELD_ID;
1718:                String nextBtnId = JBIIdConstants.JBI_LIBRARY_INSTALL_NEXT_BUTTON_ID;
1719:
1720:                //selenium.waitForCondition("selenium.browserbot.isNewPageLoaded()", TIMEOUT_PERIOD);
1721:                invalidArchiveTest(radioId, fieldId, nextBtnId);
1722:
1723:                /*Testing  Wrong  Archive type (Component/Service Assembly)and asserting the right
1724:                 alert message is displayed*/
1725:                copyArchive(radioId, fieldId, JBI_COMP_BC1_TEST_ARCHIVE,
1726:                        nextBtnId);
1727:                assertTrue(selenium
1728:                        .isTextPresent(JBIResourceConstants.JBI_MISMATCHING_ARCHIVE_MSG));
1729:
1730:                copyArchive(radioId, fieldId, JBI_SA_FOR_BC1_BC2_TEST_ARCHIVE,
1731:                        nextBtnId);
1732:                assertTrue(selenium
1733:                        .isTextPresent(JBIResourceConstants.JBI_MISMATCHING_ARCHIVE_MSG));
1734:            }
1735:
1736:            //All the invalid Comp Archives are tested for right validation error messages in Installation wizard 
1737:            private void invalidCompTest() {
1738:                String radioId = JBIIdConstants.JBI_COMPONENT_INSTALL_FILECHOOSER_RADIO_ID;
1739:                String fieldId = JBIIdConstants.JBI_COMPONENT_INSTALL_FILECHOOSER_FIELD_ID;
1740:                String nextBtnId = JBIIdConstants.JBI_COMPONENT_INSTALL_NEXT_BUTTON_ID;
1741:                selenium
1742:                        .waitForCondition(
1743:                                "selenium.browserbot.isNewPageLoaded()",
1744:                                TIMEOUT_PERIOD);
1745:
1746:                invalidArchiveTest(radioId, fieldId, nextBtnId);
1747:
1748:                /*Testing  Wrong  Archive (Library/Service Assembly) type and asserting the right
1749:                 alert message is displayed*/
1750:                copyArchive(radioId, fieldId,
1751:                        JBI_LIB_VALID_SL_ONLY_TEST_ARCHIVE, nextBtnId);
1752:                assertTrue(selenium
1753:                        .isTextPresent(JBIResourceConstants.JBI_MISMATCHING_ARCHIVE_MSG));
1754:
1755:                copyArchive(radioId, fieldId, JBI_SA_FOR_BC1_BC2_TEST_ARCHIVE,
1756:                        nextBtnId);
1757:                assertTrue(selenium
1758:                        .isTextPresent(JBIResourceConstants.JBI_MISMATCHING_ARCHIVE_MSG));
1759:            }
1760:
1761:            //All the invalid SA Archives are tested for right validation error messages in Installation wizard 
1762:            private void invalidSATest() {
1763:                String radioId = JBIIdConstants.JBI_SERVICE_ASSEMBLY_DEPLOY_FILECHOOSER_RADIO_ID;
1764:                String fieldId = JBIIdConstants.JBI_SERVICE_ASSEMBLY_DEPLOY_FILECHOOSER_FIELD_ID;
1765:                String nextBtnId = JBIIdConstants.JBI_SERVICE_ASSEMBLY_DEPLOY_NEXT_BUTTON_ID;
1766:
1767:                invalidArchiveTest(radioId, fieldId, nextBtnId);
1768:
1769:                /*Testing  Wrong  Archive (Library/Binding Component )type and asserting the right alert
1770:                message is displayed*/
1771:                copyArchive(radioId, fieldId,
1772:                        JBI_LIB_VALID_SL_ONLY_TEST_ARCHIVE, nextBtnId);
1773:                assertTrue(selenium
1774:                        .isTextPresent(JBIResourceConstants.JBI_MISMATCHING_ARCHIVE_MSG));
1775:
1776:                copyArchive(radioId, fieldId, JBI_COMP_BC1_TEST_ARCHIVE,
1777:                        nextBtnId);
1778:                assertTrue(selenium
1779:                        .isTextPresent(JBIResourceConstants.JBI_MISMATCHING_ARCHIVE_MSG));
1780:
1781:            }
1782:
1783:            //Common set of negative archive test files which are tested for validation error messages
1784:            //On All (Shared Library/Component/Service Assembly) wizards 
1785:
1786:            private void invalidArchiveTest(String aRadioId, String aFieldId,
1787:                    String aNextBtnId) {
1788:                /*Testing No Archive and asserting the right alert message shows up*/
1789:                copyArchive(aRadioId, aFieldId, "", aNextBtnId);
1790:                assertTrue(selenium
1791:                        .isTextPresent(JBIResourceConstants.JBI_NO_ARCHIVE_MSG));
1792:
1793:                /*Testing Empty Archive and asserting the right alert message shows up*/
1794:                copyArchive(aRadioId, aFieldId, JBI_EMPTY_ARCHIVE, aNextBtnId);
1795:                assertTrue(selenium
1796:                        .isTextPresent(JBIResourceConstants.JBI_EMPTY_ARCHIVE_MSG));
1797:
1798:                /*Testing Corrupted Archive and asserting the right alert message is displayed*/
1799:                copyArchive(aRadioId, aFieldId, JBI_CORRUPT_ARCHIVE, aNextBtnId);
1800:                assertTrue(selenium
1801:                        .isTextPresent(JBIResourceConstants.JBI_CORRUPT_ARCHIVE_MSG));
1802:
1803:                /*Testing Not well formed JBI Xml Archive and asserting the right alert message is displayed*/
1804:                copyArchive(aRadioId, aFieldId,
1805:                        JBI_NOT_WELL_FORMED_JBI_XML_ARCHIVE, aNextBtnId);
1806:                assertTrue(selenium
1807:                        .isTextPresent(JBIResourceConstants.JBI_NOT_WELL_FORMED_JBI_XML_ARCHIVE_MSG));
1808:
1809:                /*Testing  Missing JBI XML Archive and asserting the right alert message is displayed*/
1810:                copyArchive(aRadioId, aFieldId, JBI_MISSING_JBI_XML_ARCHIVE,
1811:                        aNextBtnId);
1812:                assertTrue(selenium
1813:                        .isTextPresent(JBIResourceConstants.JBI_MISSING_JBI_XML_ARCHIVE_MSG));
1814:            }
1815:
1816:            /*Method to get the test data archive path , tested on windows*/
1817:            private String getTestFilePath(String aArchiveName) {
1818:                java.io.File f = new java.io.File("data", aArchiveName);
1819:                String result = f.getAbsolutePath();
1820:                return result;
1821:            }
1822:
1823:            /*Navigate to the page whose Id is passed*/
1824:            private void navigateToListPage(String aPageId) {
1825:                selenium.selectFrame("relative=up");
1826:                selenium.selectFrame("index");
1827:                selenium.click(aPageId);
1828:                selenium.selectFrame("relative=up");
1829:                selenium.selectFrame("main");
1830:            }
1831:
1832:            /*Navigate to the Cluster Profile Server's JBI page whose Id is passed*/
1833:            private void navigateToSvrListPage(String aPageId) {
1834:                selenium.selectFrame("relative=up");
1835:                selenium.selectFrame("index");
1836:                selenium
1837:                        .click(JBIIdConstants.JBI_EE_STANDALONE_INSTANCES_NODE_ID);
1838:                selenium.click(JBIIdConstants.JBI_EE_SERVER_NODE_ID);
1839:                selenium.selectFrame("relative=up");
1840:                selenium.selectFrame("main");
1841:                selenium
1842:                        .waitForCondition(
1843:                                "selenium.browserbot.isNewPageLoaded()",
1844:                                TIMEOUT_PERIOD);
1845:                selenium.click(JBIIdConstants.JBI_EE_SERVER_JBI_TAB_ID);
1846:                selenium
1847:                        .waitForCondition(
1848:                                "selenium.browserbot.isNewPageLoaded()",
1849:                                TIMEOUT_PERIOD);
1850:                selenium.click(aPageId);
1851:            }
1852:
1853:            /*Navigate to the Cluster Profile Cluster's JBI page whose Id is passed*/
1854:            private void navigateToClstrListPage(String aPageId) {
1855:                selenium.selectFrame("relative=up");
1856:                selenium.selectFrame("index");
1857:                selenium.click(JBIIdConstants.JBI_EE_CLUSTERS_NODE_ID);
1858:                selenium.click(JBIIdConstants.JBI_EE_CLUSTER_NODE_ID);
1859:                selenium.selectFrame("relative=up");
1860:                selenium.selectFrame("main");
1861:                selenium
1862:                        .waitForCondition(
1863:                                "selenium.browserbot.isNewPageLoaded()",
1864:                                TIMEOUT_PERIOD);
1865:                selenium.click(JBIIdConstants.JBI_EE_CLUSTER_JBI_TAB_ID);
1866:                selenium
1867:                        .waitForCondition(
1868:                                "selenium.browserbot.isNewPageLoaded()",
1869:                                TIMEOUT_PERIOD);
1870:                selenium.click(aPageId);
1871:            }
1872:
1873:            /*Click the Install/Deply Button From List Page*/
1874:            private void clickNewButton(String aButtonId) {
1875:                selenium
1876:                        .waitForCondition(
1877:                                "selenium.browserbot.isNewPageLoaded()",
1878:                                TIMEOUT_PERIOD);
1879:                selenium.click(aButtonId);
1880:                selenium
1881:                        .waitForCondition(
1882:                                "selenium.browserbot.isNewPageLoaded()",
1883:                                TIMEOUT_PERIOD);
1884:            }
1885:
1886:            /*Try Installing passed Empty archive at the passed text field in installation wizard*/
1887:            private void copyArchive(String aRadioId, String aTextFieldId,
1888:                    String aArchiveId, String aButtonId) {
1889:                selenium.click(aRadioId);
1890:                installArchiveFirstStep(aTextFieldId, aArchiveId, aButtonId);
1891:            }
1892:
1893:            private void installArchiveFirstStep(String aTextFieldId,
1894:                    String aArchiveId, String aButtonId) {
1895:                selenium.type(aTextFieldId, getTestFilePath(aArchiveId));
1896:                selenium.click(aButtonId);
1897:                selenium
1898:                        .waitForCondition(
1899:                                "selenium.browserbot.isNewPageLoaded()",
1900:                                TIMEOUT_PERIOD);
1901:            }
1902:
1903:            /*Click the Name hyperlink in first Row of List Tables */
1904:            private void clickNameHyperLink(String aLinkId) {
1905:                selenium
1906:                        .waitForCondition(
1907:                                "selenium.browserbot.isNewPageLoaded()",
1908:                                TIMEOUT_PERIOD);
1909:                selenium.click(aLinkId);
1910:                selenium
1911:                        .waitForCondition(
1912:                                "selenium.browserbot.isNewPageLoaded()",
1913:                                TIMEOUT_PERIOD);
1914:            }
1915:
1916:            /*Select a value from DropDown after checking one row and verify the Expected Result */
1917:            private void selectDropDownAndVerifyResult(String aCheckBoxId, //Which row is to be targeted
1918:                    String aDropDownComponentId, //Dropdown component's id
1919:                    String aLabelVal, //Which label to chose
1920:                    String aExpectedValue, //What is the final expected value
1921:                    String aTargetCompId) //Which components value is expected to change
1922:            {
1923:                selenium.click(aCheckBoxId);
1924:                selectDropDownNoCBAndVerifyResult(aDropDownComponentId,
1925:                        aLabelVal, aExpectedValue, aTargetCompId);
1926:            }
1927:
1928:            /*Select a value from DropDown without checking any row and verify the Expected Result */
1929:            private void selectDropDownNoCBAndVerifyResult(
1930:                    String aDropDownComponentId, //Dropdown component's id
1931:                    String aLabelVal, //Which label to chose
1932:                    String aExpectedValue, //What is the final expected value
1933:                    String aTargetCompId) //Which components value is expected to change
1934:            {
1935:                String selectIndex = "label=" + aLabelVal;
1936:                selenium.select(aDropDownComponentId, selectIndex);
1937:                selenium
1938:                        .waitForCondition(
1939:                                "selenium.browserbot.isNewPageLoaded()",
1940:                                TIMEOUT_PERIOD);
1941:                verifyEquals(aExpectedValue, selenium.getText(aTargetCompId));
1942:            }
1943:
1944:            /* Select the Component/Assembly top operate and Click the operation (Enable/Disable)button */
1945:            private void operateCheckedElement(String aCheckBoxId, //CheckBoxId of any row which needs to be operated on
1946:                    String aButtonId, //Operate(Enable/Disable) Button's Id 
1947:                    String aExpectedValue, //Expected value of any clomun after successful completion of operation
1948:                    String aColumnId) //Columns element Id
1949:            {
1950:                selenium.click(aCheckBoxId);
1951:                selenium.click(aButtonId);
1952:                selenium
1953:                        .waitForCondition(
1954:                                "selenium.browserbot.isNewPageLoaded()",
1955:                                TIMEOUT_PERIOD);
1956:                verifyEquals(aExpectedValue, selenium.getText(aColumnId));
1957:            }
1958:
1959:            /*Click the Uninstall button after selecting passed checkbox ID and Confirm the Alert MessageS */
1960:            private void uninstallChecked(String aCheckBoxId,
1961:                    String aAlertMessage) {
1962:                uninstallCheckedElement(aCheckBoxId);
1963:                selenium.getConfirmation().matches(aAlertMessage);
1964:            }
1965:
1966:            private void uninstallCheckedElement(String aCheckBoxId)//Select which Row needs to be uninstalled
1967:            {
1968:                selenium.click(aCheckBoxId);
1969:                //selenium.waitForCondition("selenium.browserbot.isNewPageLoaded()", TIMEOUT_PERIOD);
1970:
1971:                //If not called from Server/Cluster Page 
1972:                if (aCheckBoxId.indexOf("Target") != -1) {
1973:                    selenium
1974:                            .click(JBIIdConstants.JBI_EE_SERVER_CLUSTER_UNINSTALL_BUTTON_ID);
1975:                } else {
1976:                    selenium.click(JBIIdConstants.JBI_EE_UNINSTALL_BUTTON_ID);
1977:                }
1978:                selenium
1979:                        .waitForCondition(
1980:                                "selenium.browserbot.isNewPageLoaded()",
1981:                                TIMEOUT_PERIOD);
1982:            }
1983:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.