Return-Path: Delivered-To: apmail-ws-tuscany-commits-archive@locus.apache.org Received: (qmail 84236 invoked from network); 9 Feb 2008 02:29:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Feb 2008 02:29:58 -0000 Received: (qmail 45788 invoked by uid 500); 9 Feb 2008 02:29:51 -0000 Delivered-To: apmail-ws-tuscany-commits-archive@ws.apache.org Received: (qmail 45752 invoked by uid 500); 9 Feb 2008 02:29:51 -0000 Mailing-List: contact tuscany-commits-help@ws.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: tuscany-dev@ws.apache.org Delivered-To: mailing list tuscany-commits@ws.apache.org Received: (qmail 45743 invoked by uid 99); 9 Feb 2008 02:29:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Feb 2008 18:29:51 -0800 X-ASF-Spam-Status: No, hits=-1999.1 required=10.0 tests=ALL_TRUSTED,NORMAL_HTTP_TO_IP,URIBL_RHS_DOB X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Feb 2008 02:29:19 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 697C21A9832; Fri, 8 Feb 2008 18:29:27 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r620064 - in /incubator/tuscany/java/sca/itest: build-was-integration.xml pom.xml wasAdmin.py Date: Sat, 09 Feb 2008 02:29:26 -0000 To: tuscany-commits@ws.apache.org From: lresende@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080209022927.697C21A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: lresende Date: Fri Feb 8 18:29:25 2008 New Revision: 620064 URL: http://svn.apache.org/viewvc?rev=620064&view=rev Log: Test Automation integration for Websphere host environment Added: incubator/tuscany/java/sca/itest/build-was-integration.xml (with props) incubator/tuscany/java/sca/itest/wasAdmin.py (with props) Modified: incubator/tuscany/java/sca/itest/pom.xml Added: incubator/tuscany/java/sca/itest/build-was-integration.xml URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/build-was-integration.xml?rev=620064&view=auto ============================================================================== --- incubator/tuscany/java/sca/itest/build-was-integration.xml (added) +++ incubator/tuscany/java/sca/itest/build-was-integration.xml Fri Feb 8 18:29:25 2008 @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + Installing war ${application.war} on ${application.server} using name ${application.name} and context root ${application.contextRoot} + + + + + + + Uninstalling ${application.name} + + + + + + + Propchange: incubator/tuscany/java/sca/itest/build-was-integration.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/tuscany/java/sca/itest/build-was-integration.xml ------------------------------------------------------------------------------ svn:keywords = Rev Date Propchange: incubator/tuscany/java/sca/itest/build-was-integration.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Modified: incubator/tuscany/java/sca/itest/pom.xml URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/pom.xml?rev=620064&r1=620063&r2=620064&view=diff ============================================================================== --- incubator/tuscany/java/sca/itest/pom.xml (original) +++ incubator/tuscany/java/sca/itest/pom.xml Fri Feb 8 18:29:25 2008 @@ -176,6 +176,7 @@ scopes + @@ -551,6 +552,119 @@ + + + websphere + + false + + + 8080 + http://127.0.0.1:${http.port} + ${env.WAS_HOME} + + + + + + + org.apache.tuscany.sca + tuscany-maven-web-junit + 1.2-incubating-SNAPSHOT + + + generate-web-xml + process-resources + + generate + + + + web-junit-test + integration-test + + test + + + ${http.base}/${project.build.finalName}/junit + + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + 1.1 + + + + start-container + pre-integration-test + + run + + + + + + + + + + deploy-war + pre-integration-test + + run + + + + + + + + + + + + + + + undeploy-war + post-integration-test + + run + + + + + + + + + + + + stop-container + post-integration-test + + run + + + + + + + + + + + + + + + Added: incubator/tuscany/java/sca/itest/wasAdmin.py URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/wasAdmin.py?rev=620064&view=auto ============================================================================== --- incubator/tuscany/java/sca/itest/wasAdmin.py (added) +++ incubator/tuscany/java/sca/itest/wasAdmin.py Fri Feb 8 18:29:25 2008 @@ -0,0 +1,91 @@ +""" + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. +""" +import sys + +def getCellName(): + """Return the name of the cell connected to""" + return AdminControl.getCell() + +def getNodeName(): + """Return the name of the node connected to""" + return AdminControl.getNode() + +def startApplicationOnServer(appName,serverName): + """Start the named application on one server""" + print "startApplicationOnServer: Entry. appname=%s servername=%s" % ( appName,serverName ) + cellName = getCellName() + nodeName = getNodeName() + # Get the application manager + appManager = AdminControl.queryNames('cell=%s,node=%s,type=ApplicationManager,process=%s,*' %(cellName,nodeName,serverName)) + print "startApplicationOnServer: appManager=%s" % ( repr(appManager) ) + # start it + rc = AdminControl.invoke(appManager, 'startApplication', appName) + print "startApplicationOnServer: Exit. rc=%s" % ( repr(rc) ) + +def stopApplicationOnServer(appName,serverName): + """Stop the named application on one server""" + print "stopApplicationOnServer: Entry. appname=%s servername=%s" % ( appName,serverName ) + cellName = getCellName() + nodeName = getNodeName() + # Get the application manager + appManager = AdminControl.queryNames('cell=%s,node=%s,type=ApplicationManager,process=%s,*' %(cellName,nodeName,serverName)) + print "stopApplicationOnServer: appManager=%s" % ( repr(appManager) ) + # start it + rc = AdminControl.invoke(appManager, 'stopApplication', appName) + print "stopApplicationOnServer: Exit. rc=%s" % ( repr(rc) ) + +def installApplicationOnServer( fileName, appName, contextRoot, serverName ): + """Install given application on the named server using given context root""" + print "installApplicationOnServer: fileName=%s appName=%s contextRoot=%s ServerName=%s" % ( fileName, appName,contextRoot,serverName ) + AdminApp.install(fileName,'[-appname ' + appName + ' -contextroot ' + contextRoot + ' -server ' + serverName + ' -usedefaultbindings ]') + AdminConfig.save() + """modify classloader model for application""" + deploymentID = AdminConfig.getid('/Deployment:' + appName + '/') + deploymentObject = AdminConfig.showAttribute(deploymentID, 'deployedObject') + classldr = AdminConfig.showAttribute(deploymentObject, 'classloader') + print AdminConfig.showall(classldr) + AdminConfig.modify(classldr, [['mode', 'PARENT_LAST']]) + """Modify WAR class loader model""" + AdminConfig.show(deploymentObject, 'warClassLoaderPolicy') + AdminConfig.modify(deploymentObject, [['warClassLoaderPolicy', 'SINGLE']]) + AdminConfig.save() + +def uninstallApplicationOnServer( appName ): + """Delete the named application from the cell""" + AdminApp.uninstall( appName ) + AdminConfig.save() + + + +"""----------------------------------------------------------- + Phyton script to interface with WAS Admin/Management Tools +-----------------------------------------------------------""" + +if len(sys.argv) < 1: + print "wasAdmin.py : need parameters : functionName [args]" + sys.exit(0) +if(sys.argv[0] == 'installApplicationOnServer'): + installApplicationOnServer(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4]) +elif(sys.argv[0] == 'startApplicationOnServer'): + installApplicationOnServer(sys.argv[1], sys.argv[2]) +elif(sys.argv[0] == 'uninstallApplicationOnServer'): + uninstallApplicationOnServer(sys.argv[1]) +else: + print "Exiting without doing anything" + Propchange: incubator/tuscany/java/sca/itest/wasAdmin.py ------------------------------------------------------------------------------ svn:eol-style = native --------------------------------------------------------------------- To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org For additional commands, e-mail: tuscany-commits-help@ws.apache.org