Return-Path: Delivered-To: apmail-geronimo-dev-archive@www.apache.org Received: (qmail 29021 invoked from network); 11 Jun 2008 20:05:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Jun 2008 20:05:17 -0000 Received: (qmail 3619 invoked by uid 500); 11 Jun 2008 20:05:17 -0000 Delivered-To: apmail-geronimo-dev-archive@geronimo.apache.org Received: (qmail 3571 invoked by uid 500); 11 Jun 2008 20:05:17 -0000 Mailing-List: contact dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list dev@geronimo.apache.org Received: (qmail 3557 invoked by uid 99); 11 Jun 2008 20:05:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Jun 2008 13:05:17 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jason.dillon@gmail.com designates 209.85.142.187 as permitted sender) Received: from [209.85.142.187] (HELO ti-out-0910.google.com) (209.85.142.187) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Jun 2008 20:04:24 +0000 Received: by ti-out-0910.google.com with SMTP id b6so1000678tic.1 for ; Wed, 11 Jun 2008 13:04:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer:sender; bh=30fNr/FDiwM7iePNFOw9giDkPJjwPjiSdE/WUgsfewQ=; b=KYSR0YsiZC3WZDBvFqCdZyBMVDCwc7lDiOSWu4exFoCgPaYJOxss9P15WDCtndOx2p BRvDoSHeaPXqXONwR6cvV1SIcAsgQRvnsgYduo4aGO6VfmhKtlaJtSP3c9+QntCD3wzp thxvPKm73dtqXSSiAyj0nXPvzfMr6uyN4nT+o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer:sender; b=e4NHJwt/2arsWhWDullYhwMLUNwxIc8tj/4y1MlY/Tp/mKa8dWEQfSw5InQD3RLUXp 3Y6tSq3n45KrxIvgqiftcf5ru32LbKCmF6WBuqIMmzsjpnTTnHybsumW3Mk9wn+z/iic 24rT/2UWH4hECbohkWIyhNFeflygeQ3rmsicc= Received: by 10.110.15.9 with SMTP id 9mr117947tio.44.1213214680797; Wed, 11 Jun 2008 13:04:40 -0700 (PDT) Received: from ?10.0.1.97? ( [58.8.1.125]) by mx.google.com with ESMTPS id u8sm292186tia.6.2008.06.11.13.04.32 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 11 Jun 2008 13:04:34 -0700 (PDT) Message-Id: <6DFC6BA8-7A3B-4EDB-82B6-8C64F425120E@planet57.com> From: Jason Dillon To: dev@geronimo.apache.org In-Reply-To: <5eb405c70806111251t23f4e71albef788f56703d9cb@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v924) Subject: Re: svn commit: r666781 - in /geronimo/server/trunk: testsuite/commands-testsuite/ testsuite/commands-testsuite/deploy/ testsuite/commands-testsuite/deploy/src/ testsuite/commands-testsuite/deploy/src/test/ testsuite/commands-testsuite/deploy/src/tes Date: Thu, 12 Jun 2008 03:04:31 +0700 References: <5eb405c70806111251t23f4e71albef788f56703d9cb@mail.gmail.com> X-Mailer: Apple Mail (2.924) Sender: Jason Dillon X-Virus-Checked: Checked by ClamAV on apache.org The testsuite framework much for trunk and 2.1 has also change significantly, might be a pita the port it back... --jason On Jun 12, 2008, at 2:51 AM, Jarek Gawor wrote: > I wasn't planning to. But I can port it if necessary. At this point I > think we need to add more tests to the commands-testsuite for it to be > more useful. > > Jarek > > On Wed, Jun 11, 2008 at 3:37 PM, Donald Woods > wrote: >> Any plans to pull this into branches/2.1? >> >> >> -Donald >> >> >> gawor@apache.org wrote: >>> >>> Author: gawor >>> Date: Wed Jun 11 11:50:45 2008 >>> New Revision: 666781 >>> >>> URL: http://svn.apache.org/viewvc?rev=666781&view=rev >>> Log: >>> Initial testsuite for command line tools. Patch from YunFeng Ma >>> but with >>> bunch of modifications (GERONIMO-4074) >>> >>> Added: >>> geronimo/server/trunk/testsuite/commands-testsuite/ >>> geronimo/server/trunk/testsuite/commands-testsuite/deploy/ >>> geronimo/server/trunk/testsuite/commands-testsuite/deploy/ >>> goals.txt >>> (with props) >>> geronimo/server/trunk/testsuite/commands-testsuite/deploy/pom.xml >>> (with props) >>> geronimo/server/trunk/testsuite/commands-testsuite/deploy/src/ >>> geronimo/server/trunk/testsuite/commands-testsuite/deploy/src/ >>> test/ >>> >>> geronimo/server/trunk/testsuite/commands-testsuite/deploy/src/test/ >>> java/ >>> >>> geronimo/server/trunk/testsuite/commands-testsuite/deploy/src/test/ >>> java/org/ >>> >>> geronimo/server/trunk/testsuite/commands-testsuite/deploy/src/test/ >>> java/org/apache/ >>> >>> geronimo/server/trunk/testsuite/commands-testsuite/deploy/src/test/ >>> java/org/apache/geronimo/ >>> >>> geronimo/server/trunk/testsuite/commands-testsuite/deploy/src/test/ >>> java/org/apache/geronimo/testsuite/ >>> >>> geronimo/server/trunk/testsuite/commands-testsuite/deploy/src/test/ >>> java/org/apache/geronimo/testsuite/deploy/ >>> >>> geronimo/server/trunk/testsuite/commands-testsuite/deploy/src/test/ >>> java/org/apache/geronimo/testsuite/deploy/DeployerTest.java >>> (with props) >>> >>> geronimo/server/trunk/testsuite/commands-testsuite/deploy/src/test/ >>> resources/ >>> >>> geronimo/server/trunk/testsuite/commands-testsuite/deploy/src/test/ >>> resources/testng.xml >>> (with props) >>> geronimo/server/trunk/testsuite/commands-testsuite/gshell/ >>> geronimo/server/trunk/testsuite/commands-testsuite/gshell/ >>> goals.txt >>> (with props) >>> geronimo/server/trunk/testsuite/commands-testsuite/gshell/pom.xml >>> (with props) >>> geronimo/server/trunk/testsuite/commands-testsuite/gshell/src/ >>> geronimo/server/trunk/testsuite/commands-testsuite/gshell/src/ >>> test/ >>> >>> geronimo/server/trunk/testsuite/commands-testsuite/gshell/src/test/ >>> java/ >>> >>> geronimo/server/trunk/testsuite/commands-testsuite/gshell/src/test/ >>> java/org/ >>> >>> geronimo/server/trunk/testsuite/commands-testsuite/gshell/src/test/ >>> java/org/apache/ >>> >>> geronimo/server/trunk/testsuite/commands-testsuite/gshell/src/test/ >>> java/org/apache/geronimo/ >>> >>> geronimo/server/trunk/testsuite/commands-testsuite/gshell/src/test/ >>> java/org/apache/geronimo/testsuite/ >>> >>> geronimo/server/trunk/testsuite/commands-testsuite/gshell/src/test/ >>> java/org/apache/geronimo/testsuite/gshell/ >>> >>> geronimo/server/trunk/testsuite/commands-testsuite/gshell/src/test/ >>> java/org/apache/geronimo/testsuite/gshell/deploy/ >>> >>> geronimo/server/trunk/testsuite/commands-testsuite/gshell/src/test/ >>> java/org/apache/geronimo/testsuite/gshell/deploy/DeployTest.java >>> (with props) >>> >>> geronimo/server/trunk/testsuite/commands-testsuite/gshell/src/test/ >>> resources/ >>> >>> geronimo/server/trunk/testsuite/commands-testsuite/gshell/src/test/ >>> resources/testng.xml >>> (with props) >>> geronimo/server/trunk/testsuite/commands-testsuite/pom.xml (with >>> props) >>> geronimo/server/trunk/testsupport/testsupport-commands/ >>> geronimo/server/trunk/testsupport/testsupport-commands/pom.xml >>> (with >>> props) >>> geronimo/server/trunk/testsupport/testsupport-commands/src/ >>> geronimo/server/trunk/testsupport/testsupport-commands/src/main/ >>> geronimo/server/trunk/testsupport/testsupport-commands/src/main/ >>> java/ >>> >>> geronimo/server/trunk/testsupport/testsupport-commands/src/main/ >>> java/org/ >>> >>> geronimo/server/trunk/testsupport/testsupport-commands/src/main/ >>> java/org/apache/ >>> >>> geronimo/server/trunk/testsupport/testsupport-commands/src/main/ >>> java/org/apache/geronimo/ >>> >>> geronimo/server/trunk/testsupport/testsupport-commands/src/main/ >>> java/org/apache/geronimo/testsupport/ >>> >>> geronimo/server/trunk/testsupport/testsupport-commands/src/main/ >>> java/org/apache/geronimo/testsupport/commands/ >>> >>> geronimo/server/trunk/testsupport/testsupport-commands/src/main/ >>> java/org/apache/geronimo/testsupport/commands/ >>> CommandTestSupport.java >>> (with props) >>> Modified: >>> geronimo/server/trunk/testsupport/pom.xml >>> >>> Added: geronimo/server/trunk/testsuite/commands-testsuite/deploy/ >>> goals.txt >>> URL: >>> http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/commands-testsuite/deploy/goals.txt?rev=666781&view=auto >>> >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> ==================================================================== >>> --- geronimo/server/trunk/testsuite/commands-testsuite/deploy/ >>> goals.txt >>> (added) >>> +++ geronimo/server/trunk/testsuite/commands-testsuite/deploy/ >>> goals.txt >>> Wed Jun 11 11:50:45 2008 >>> @@ -0,0 +1 @@ >>> +clean install >>> >>> Propchange: >>> geronimo/server/trunk/testsuite/commands-testsuite/deploy/goals.txt >>> >>> ------------------------------------------------------------------------------ >>> svn:eol-style = native >>> >>> Added: geronimo/server/trunk/testsuite/commands-testsuite/deploy/ >>> pom.xml >>> URL: >>> http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/commands-testsuite/deploy/pom.xml?rev=666781&view=auto >>> >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> ==================================================================== >>> --- geronimo/server/trunk/testsuite/commands-testsuite/deploy/ >>> pom.xml >>> (added) >>> +++ geronimo/server/trunk/testsuite/commands-testsuite/deploy/ >>> pom.xml Wed >>> Jun 11 11:50:45 2008 >>> @@ -0,0 +1,35 @@ >>> + >>> + >>> +>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >>> + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 >>> http://maven.apache.org/maven-v4_0_0.xsd"> >>> + 4.0.0 >>> + >>> + >>> + org.apache.geronimo.testsuite >>> + commands-testsuite >>> + 2.2-SNAPSHOT >>> + >>> + >>> + deployer-testsuite >>> + Geronimo TestSuite :: Commands Testsuite :: Deployer>> name> >>> + >>> + >>> + Test for the deploy.bat/sh >>> + >>> + >>> + >>> >>> Propchange: >>> geronimo/server/trunk/testsuite/commands-testsuite/deploy/pom.xml >>> >>> ------------------------------------------------------------------------------ >>> svn:eol-style = native >>> >>> Added: >>> geronimo/server/trunk/testsuite/commands-testsuite/deploy/src/test/ >>> java/org/apache/geronimo/testsuite/deploy/DeployerTest.java >>> URL: >>> http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/commands-testsuite/deploy/src/test/java/org/apache/geronimo/testsuite/deploy/DeployerTest.java?rev=666781&view=auto >>> >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> ==================================================================== >>> --- >>> geronimo/server/trunk/testsuite/commands-testsuite/deploy/src/test/ >>> java/org/apache/geronimo/testsuite/deploy/DeployerTest.java >>> (added) >>> +++ >>> geronimo/server/trunk/testsuite/commands-testsuite/deploy/src/test/ >>> java/org/apache/geronimo/testsuite/deploy/DeployerTest.java >>> Wed Jun 11 11:50:45 2008 >>> @@ -0,0 +1,102 @@ >>> +/** >>> + * 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. >>> + */ >>> + >>> +package org.apache.geronimo.testsuite.deploy; >>> + >>> +import java.io.ByteArrayOutputStream; >>> +import java.util.ArrayList; >>> +import java.util.Arrays; >>> +import java.util.List; >>> + >>> +import org.apache.geronimo.testsupport.commands.CommandTestSupport; >>> +import org.testng.Assert; >>> +import org.testng.annotations.Test; >>> + >>> +@Test >>> +public class DeployerTest extends CommandTestSupport { >>> + >>> + protected String execute(String[] args) throws Exception { >>> + ByteArrayOutputStream baos = new ByteArrayOutputStream(); >>> + List cmd = new ArrayList(); >>> + cmd.addAll(Arrays.asList("--user", "system", "--password", >>> "manager")); >>> + if (args != null) { >>> + cmd.addAll(Arrays.asList(args)); >>> + } >>> + execute(CommandTestSupport.DEPLOY, cmd, null, baos); >>> + return baos.toString(); >>> + } >>> + + @Test >>> + public void testListAllModules() throws Exception { >>> + String[] args = new String[]{ "list-modules" }; >>> + + String output = execute(args); >>> + >>> + if (output.indexOf("org.apache.geronimo.configs/activemq- >>> broker") >>> < 0) { >>> + Assert.fail("list-modules failed : " + output); >>> + } >>> + } >>> + + @Test >>> + public void testListStartedModules() throws Exception { >>> + String[] args = new String[]{ "list-modules", "-- >>> started" }; >>> + + String output = execute(args); >>> + >>> + if (output.indexOf("org.apache.geronimo.configs/activemq- >>> broker") >>> < 0) { >>> + Assert.fail("list-modules failed : " + output); >>> + } >>> + if >>> (output.indexOf("org.apache.geronimo.configs/client-corba-yoko") > >>> 0) { >>> + Assert.fail("list-modules failed : " + output); >>> + } >>> + } >>> + + @Test >>> + public void testListStoppedModules() throws Exception { >>> + String[] args = new String[]{ "list-modules", "-- >>> stopped" }; >>> + + String output = execute(args); >>> + >>> + if (output.indexOf("org.apache.geronimo.configs/activemq- >>> broker") >>>> 0) { >>> + Assert.fail("deploy/list-modules failed : " + output); >>> + } >>> + if >>> (output.indexOf("org.apache.geronimo.configs/client-corba-yoko") < >>> 0) { >>> + Assert.fail("deploy/list-modules failed : " + output); >>> + } >>> + } >>> + + @Test >>> + public void testOfflineDeployment() throws Exception { >>> + //todo doesn't work now >>> + /* >>> + String[] args = new String[]{ "--offline", "deploy", "" }; >>> + + ByteArrayOutputStream baos = new ByteArrayOutputStream(); >>> + execute( command, args, null, baos ); >>> + >>> + if >>> (baos.toString().indexOf("org.apache.geronimo.configs/activemq- >>> broker") > 0) >>> { >>> + Assert.fail("deploy/list-modules failed : " + >>> baos.toString()); >>> + } >>> + if >>> (baos.toString().indexOf("org.apache.geronimo.configs/client-corba- >>> yoko") < >>> 0) { >>> + Assert.fail("deploy/list-modules failed : " + >>> baos.toString()); >>> + } >>> + */ >>> + } >>> + +} >>> >>> Propchange: >>> geronimo/server/trunk/testsuite/commands-testsuite/deploy/src/test/ >>> java/org/apache/geronimo/testsuite/deploy/DeployerTest.java >>> >>> ------------------------------------------------------------------------------ >>> svn:eol-style = native >>> >>> Added: >>> geronimo/server/trunk/testsuite/commands-testsuite/deploy/src/test/ >>> resources/testng.xml >>> URL: >>> http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/commands-testsuite/deploy/src/test/resources/testng.xml?rev=666781&view=auto >>> >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> ==================================================================== >>> --- >>> geronimo/server/trunk/testsuite/commands-testsuite/deploy/src/test/ >>> resources/testng.xml >>> (added) >>> +++ >>> geronimo/server/trunk/testsuite/commands-testsuite/deploy/src/test/ >>> resources/testng.xml >>> Wed Jun 11 11:50:45 2008 >>> @@ -0,0 +1,32 @@ >>> + >>> + >>> + >>> + >>> + >>> + >>> + >>> + >>> + >>> + >>> + >>> + >>> + >>> + >>> + >>> >>> Propchange: >>> geronimo/server/trunk/testsuite/commands-testsuite/deploy/src/test/ >>> resources/testng.xml >>> >>> ------------------------------------------------------------------------------ >>> svn:eol-style = native >>> >>> Added: geronimo/server/trunk/testsuite/commands-testsuite/gshell/ >>> goals.txt >>> URL: >>> http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/commands-testsuite/gshell/goals.txt?rev=666781&view=auto >>> >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> ==================================================================== >>> --- geronimo/server/trunk/testsuite/commands-testsuite/gshell/ >>> goals.txt >>> (added) >>> +++ geronimo/server/trunk/testsuite/commands-testsuite/gshell/ >>> goals.txt >>> Wed Jun 11 11:50:45 2008 >>> @@ -0,0 +1 @@ >>> +clean install >>> >>> Propchange: >>> geronimo/server/trunk/testsuite/commands-testsuite/gshell/goals.txt >>> >>> ------------------------------------------------------------------------------ >>> svn:eol-style = native >>> >>> Added: geronimo/server/trunk/testsuite/commands-testsuite/gshell/ >>> pom.xml >>> URL: >>> http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/commands-testsuite/gshell/pom.xml?rev=666781&view=auto >>> >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> ==================================================================== >>> --- geronimo/server/trunk/testsuite/commands-testsuite/gshell/ >>> pom.xml >>> (added) >>> +++ geronimo/server/trunk/testsuite/commands-testsuite/gshell/ >>> pom.xml Wed >>> Jun 11 11:50:45 2008 >>> @@ -0,0 +1,36 @@ >>> + >>> + >>> +>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >>> + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 >>> http://maven.apache.org/maven-v4_0_0.xsd"> >>> + 4.0.0 >>> + >>> + >>> + org.apache.geronimo.testsuite >>> + commands-testsuite >>> + 2.2-SNAPSHOT >>> + ../pom.xml >>> + >>> + >>> + gshell-testsuite >>> + Geronimo TestSuite :: Commands Testsuite :: GShell >>> + >>> + >>> + Test for the gsh.bat/sh >>> + >>> + >>> + >>> >>> Propchange: >>> geronimo/server/trunk/testsuite/commands-testsuite/gshell/pom.xml >>> >>> ------------------------------------------------------------------------------ >>> svn:eol-style = native >>> >>> Added: >>> geronimo/server/trunk/testsuite/commands-testsuite/gshell/src/test/ >>> java/org/apache/geronimo/testsuite/gshell/deploy/DeployTest.java >>> URL: >>> http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/commands-testsuite/gshell/src/test/java/org/apache/geronimo/testsuite/gshell/deploy/DeployTest.java?rev=666781&view=auto >>> >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> ==================================================================== >>> --- >>> geronimo/server/trunk/testsuite/commands-testsuite/gshell/src/test/ >>> java/org/apache/geronimo/testsuite/gshell/deploy/DeployTest.java >>> (added) >>> +++ >>> geronimo/server/trunk/testsuite/commands-testsuite/gshell/src/test/ >>> java/org/apache/geronimo/testsuite/gshell/deploy/DeployTest.java >>> Wed Jun 11 11:50:45 2008 >>> @@ -0,0 +1,100 @@ >>> +/** >>> + * 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. >>> + */ >>> + >>> +package org.apache.geronimo.testsuite.gshell.deploy; >>> + >>> +import java.io.ByteArrayOutputStream; >>> +import java.util.ArrayList; >>> +import java.util.Arrays; >>> +import java.util.List; >>> + >>> +import org.apache.geronimo.testsupport.commands.CommandTestSupport; >>> +import org.testng.Assert; >>> +import org.testng.annotations.Test; >>> + >>> +@Test >>> +public class DeployTest extends CommandTestSupport { >>> + + private static final String UP = "-u system -w >>> manager"; >>> + + protected String execute(String[] args) throws Exception { >>> + ByteArrayOutputStream baos = new ByteArrayOutputStream(); >>> + List cmd = new ArrayList(); + >>> cmd.addAll(Arrays.asList("-c")); >>> + if (args != null) { >>> + cmd.addAll(Arrays.asList(args)); >>> + } >>> + execute(CommandTestSupport.GSH, cmd, null, baos); >>> + return baos.toString(); >>> + } >>> + + @Test >>> + public void testListAllModules() throws Exception { >>> + String[] args = new String[]{ "deploy/list-modules " + >>> UP }; >>> + + String output = execute(args); >>> + >>> + if (output.indexOf("org.apache.geronimo.configs/activemq- >>> broker") >>> < 0) { >>> + Assert.fail("deploy/list-modules failed : " + output); >>> + } >>> + } >>> + + @Test >>> + public void testListStartedModules() throws Exception { >>> + String[] args = new String[]{ "deploy/list-modules " + UP >>> + " >>> --started" }; >>> + + String output = execute(args); >>> + >>> + if (output.indexOf("org.apache.geronimo.configs/activemq- >>> broker") >>> < 0) { >>> + Assert.fail("deploy/list-modules failed : " + output); >>> + } >>> + if >>> (output.indexOf("org.apache.geronimo.configs/client-corba-yoko") > >>> 0) { >>> + Assert.fail("deploy/list-modules failed : " + output); >>> + } >>> + } >>> + + @Test >>> + public void testListStoppedModules() throws Exception { >>> + String[] args = new String[]{ "deploy/list-modules " + UP >>> + " >>> --stopped" }; >>> + + String output = execute(args); >>> + >>> + if (output.indexOf("org.apache.geronimo.configs/activemq- >>> broker") >>>> 0) { >>> + Assert.fail("deploy/list-modules failed : " + output); >>> + } >>> + if >>> (output.indexOf("org.apache.geronimo.configs/client-corba-yoko") < >>> 0) { >>> + Assert.fail("deploy/list-modules failed : " + output); >>> + } >>> + } >>> + + public void testListAllPlugins() throws Exception { >>> + //todo this testcase fails >>> + /* >>> + String[] args = new String[]{ "-c", "deploy/list-plugins -u >>> system -w manager" }; >>> + + ByteArrayOutputStream baos = new ByteArrayOutputStream(); >>> + execute( command, args, null, baos ); >>> + >>> + if >>> (baos.toString().indexOf("org.apache.geronimo.configs/activemq- >>> broker") < 0) >>> { >>> + Assert.fail("deploy/list-modules failed : " + >>> baos.toString()); >>> + } >>> + */ >>> + } >>> + >>> +} >>> >>> Propchange: >>> geronimo/server/trunk/testsuite/commands-testsuite/gshell/src/test/ >>> java/org/apache/geronimo/testsuite/gshell/deploy/DeployTest.java >>> >>> ------------------------------------------------------------------------------ >>> svn:eol-style = native >>> >>> Added: >>> geronimo/server/trunk/testsuite/commands-testsuite/gshell/src/test/ >>> resources/testng.xml >>> URL: >>> http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/commands-testsuite/gshell/src/test/resources/testng.xml?rev=666781&view=auto >>> >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> ==================================================================== >>> --- >>> geronimo/server/trunk/testsuite/commands-testsuite/gshell/src/test/ >>> resources/testng.xml >>> (added) >>> +++ >>> geronimo/server/trunk/testsuite/commands-testsuite/gshell/src/test/ >>> resources/testng.xml >>> Wed Jun 11 11:50:45 2008 >>> @@ -0,0 +1,32 @@ >>> + >>> + >>> + >>> + >>> + >>> + >>> + >>> + >>> + >>> + >>> + >> name="org.apache.geronimo.testsuite.gshell.deploy"/> >>> + >>> + >>> + >>> + >>> >>> Propchange: >>> geronimo/server/trunk/testsuite/commands-testsuite/gshell/src/test/ >>> resources/testng.xml >>> >>> ------------------------------------------------------------------------------ >>> svn:eol-style = native >>> >>> Added: geronimo/server/trunk/testsuite/commands-testsuite/pom.xml >>> URL: >>> http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/commands-testsuite/pom.xml?rev=666781&view=auto >>> >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> ==================================================================== >>> --- geronimo/server/trunk/testsuite/commands-testsuite/pom.xml >>> (added) >>> +++ geronimo/server/trunk/testsuite/commands-testsuite/pom.xml Wed >>> Jun 11 >>> 11:50:45 2008 >>> @@ -0,0 +1,85 @@ >>> + >>> + >>> + >>> +>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >>> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 >>> http://maven.apache.org/maven-v4_0_0.xsd"> >>> + >>> + 4.0.0 >>> + >>> + >>> + org.apache.geronimo.testsuite >>> + testsuite >>> + 2.2-SNAPSHOT >>> + >>> + >>> + commands-testsuite >>> + Geronimo TestSuite :: Commands TestSuite >>> + pom >>> + + >>> + Test Geronimo Commands Functions >>> + >>> + + >>> + >>> + org.apache.geronimo.testsupport >>> + testsupport-commands >>> + ${version} >>> + >>> + + + >>> + >>> + >>> + >>> + org.apache.maven.plugins >>> + maven-surefire-plugin >>> + >>> + >>> + >>> ${project.build.testOutputDirectory}/testng.xml>> suiteXmlFile> >>> + >>> + >>> + >>> + geronimoVersion >>> + ${version} >>> + >>> + >>> + >>> + >>> + >>> + >>> + + >>> + >>> + org.apache.geronimo.buildsupport >>> + testsuite-maven-plugin >>> + false >>> + >>> + >>> + install >>> + >>> + generate-surefire-xml >>> + >>> + >>> + >>> + >>> + >>> + >>> + >>> + >>> >>> Propchange: geronimo/server/trunk/testsuite/commands-testsuite/ >>> pom.xml >>> >>> ------------------------------------------------------------------------------ >>> svn:eol-style = native >>> >>> Modified: geronimo/server/trunk/testsupport/pom.xml >>> URL: >>> http://svn.apache.org/viewvc/geronimo/server/trunk/testsupport/pom.xml?rev=666781&r1=666780&r2=666781&view=diff >>> >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> ==================================================================== >>> --- geronimo/server/trunk/testsupport/pom.xml (original) >>> +++ geronimo/server/trunk/testsupport/pom.xml Wed Jun 11 11:50:45 >>> 2008 >>> @@ -42,6 +42,7 @@ >>> >>> testsupport-common >>> testsupport-selenium >>> + testsupport-commands >>> testsupport-packaging >>> test-deployment-j2ee_1.3 >>> test-deployment-j2ee_1.4 >>> >>> Added: geronimo/server/trunk/testsupport/testsupport-commands/ >>> pom.xml >>> URL: >>> http://svn.apache.org/viewvc/geronimo/server/trunk/testsupport/testsupport-commands/pom.xml?rev=666781&view=auto >>> >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> ==================================================================== >>> --- geronimo/server/trunk/testsupport/testsupport-commands/pom.xml >>> (added) >>> +++ geronimo/server/trunk/testsupport/testsupport-commands/pom.xml >>> Wed Jun >>> 11 11:50:45 2008 >>> @@ -0,0 +1,59 @@ >>> + >>> + >>> + >>> +>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >>> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 >>> http://maven.apache.org/maven-v4_0_0.xsd"> >>> + 4.0.0 >>> + + >>> + org.apache.geronimo.testsupport >>> + testsupport >>> + 2.2-SNAPSHOT >>> + >>> + + testsupport-commands >>> + Geronimo Test Support :: Commands >>> + + >>> + >>> + junit >>> + junit >>> + compile >>> + >>> + >>> + >>> + org.apache.geronimo.testsupport >>> + testsupport-common >>> + ${version} >>> + compile >>> + >>> + + >>> + org.apache.geronimo.buildsupport >>> + geronimo-maven-plugin >>> + ${version} >>> + >>> + + >>> + org.apache.ant >>> + ant >>> + >>> + >>> + >>> + >>> >>> Propchange: geronimo/server/trunk/testsupport/testsupport-commands/ >>> pom.xml >>> >>> ------------------------------------------------------------------------------ >>> svn:eol-style = native >>> >>> Added: >>> geronimo/server/trunk/testsupport/testsupport-commands/src/main/ >>> java/org/apache/geronimo/testsupport/commands/ >>> CommandTestSupport.java >>> URL: >>> http://svn.apache.org/viewvc/geronimo/server/trunk/testsupport/testsupport-commands/src/main/java/org/apache/geronimo/testsupport/commands/CommandTestSupport.java?rev=666781&view=auto >>> >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> ==================================================================== >>> --- >>> geronimo/server/trunk/testsupport/testsupport-commands/src/main/ >>> java/org/apache/geronimo/testsupport/commands/ >>> CommandTestSupport.java >>> (added) >>> +++ >>> geronimo/server/trunk/testsupport/testsupport-commands/src/main/ >>> java/org/apache/geronimo/testsupport/commands/ >>> CommandTestSupport.java >>> Wed Jun 11 11:50:45 2008 >>> @@ -0,0 +1,127 @@ >>> +/** >>> + * 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. >>> + */ >>> +package org.apache.geronimo.testsupport.commands; >>> + >>> +import java.io.InputStream; >>> +import java.io.OutputStream; >>> +import java.util.ArrayList; >>> +import java.util.Arrays; >>> +import java.util.Collections; >>> +import java.util.List; >>> + >>> +import org.apache.geronimo.mavenplugins.geronimo.ServerProxy; >>> +import org.apache.tools.ant.taskdefs.Execute; >>> +import org.apache.tools.ant.taskdefs.ExecuteStreamHandler; >>> +import org.apache.tools.ant.taskdefs.ExecuteWatchdog; >>> +import org.apache.tools.ant.taskdefs.PumpStreamHandler; >>> +import org.apache.tools.ant.taskdefs.condition.Os; >>> + >>> +public class CommandTestSupport { >>> + + public static final String GSH = "gsh"; >>> + public static final String DEPLOY = "deploy"; >>> + + protected static final long timeout = 30000; + >>> protected >>> static String geronimoHome; >>> + + static { >>> + geronimoHome = getGeronimoHome(); >>> + } >>> + + private static String getGeronimoHome() { >>> + ServerProxy server = null; >>> + try { >>> + server = new ServerProxy("localhost", 1099, "system", >>> "manager"); + } catch (Exception e) { >>> + throw new RuntimeException("Unable to setup >>> ServerProxy", e); >>> + } >>> + String home = server.getGeronimoHome(); >>> + if (server.getLastError() != null) { >>> + throw new RuntimeException("Failed to get Geronimo >>> home", >>> server.getLastError()); >>> + } else { >>> + return home; >>> + } >>> + } >>> + + public CommandTestSupport() { >>> + } >>> + + public void execute(String command, String[] args, >>> InputStream >>> in, OutputStream out) throws Exception { >>> + execute(command, (args == null) ? null : >>> Arrays.asList(args), in, >>> out); >>> + } >>> + + public void execute(String command, List args, >>> InputStream in, OutputStream out) throws Exception { >>> + List cmdLine = new ArrayList(); >>> + if (isWindows()) { >>> + cmdLine.add("cmd.exe"); >>> + cmdLine.add("/c"); >>> + } >>> + cmdLine.add(resolveCommandForOS(command)); >>> + // add command-specific arguments >>> + cmdLine.addAll(getCommandArguments(command)); >>> + // add user arguments >>> + if (args != null) { >>> + cmdLine.addAll(args); >>> + } >>> + + ExecuteWatchdog watchdog = new >>> ExecuteWatchdog( timeout >>> ); >>> + ExecuteStreamHandler streamHandler = new >>> PumpStreamHandler( out, >>> out, in ); >>> + Execute exec = new Execute( streamHandler, watchdog ); >>> + exec.setCommandline( cmdLine.toArray(new String[] {}) ); >>> + List env = getCommandEnvironment(command); >>> + if (!env.isEmpty()) { >>> + exec.setEnvironment(env.toArray(new String[] {}) ); >>> + } >>> + exec.execute(); >>> + } >>> + + protected List getCommandArguments(String >>> command) { >>> + if (GSH.equals(command)) { >>> + return Arrays.asList("-T", "false"); >>> + } else { >>> + return Collections.emptyList(); >>> + } >>> + } >>> + + protected List getCommandEnvironment(String >>> command) >>> { >>> + if (DEPLOY.equals(command)) { >>> + //this makes the output can be captured in Linux >>> + return >>> Arrays.asList("JAVA_OPTS=- >>> Djline.terminal=jline.UnsupportedTerminal"); >>> + } else { >>> + return Collections.emptyList(); >>> + } >>> + } >>> + >>> + protected String resolveCommandForOS(String command) { + >>> if (isWindows()) { >>> + return geronimoHome + "/bin/" + command + ".bat"; >>> + } else { >>> + if (GSH.equals(command)) { >>> + return geronimoHome + "/bin/" + command; >>> + } else { >>> + return geronimoHome + "/bin/" + command + ".sh"; >>> + } >>> + } + } >>> + + public boolean isWindows() { >>> + return Os.isFamily("windows"); >>> + } >>> + +} >>> >>> Propchange: >>> geronimo/server/trunk/testsupport/testsupport-commands/src/main/ >>> java/org/apache/geronimo/testsupport/commands/ >>> CommandTestSupport.java >>> >>> ------------------------------------------------------------------------------ >>> svn:eol-style = native >>> >>> >>> >>