Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 59092 invoked from network); 16 Jun 2008 18:53:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Jun 2008 18:53:45 -0000 Received: (qmail 73381 invoked by uid 500); 16 Jun 2008 18:53:47 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 73342 invoked by uid 500); 16 Jun 2008 18:53:47 -0000 Mailing-List: contact scm-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 scm@geronimo.apache.org Received: (qmail 73333 invoked by uid 99); 16 Jun 2008 18:53:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Jun 2008 11:53:47 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Jun 2008 18:53:05 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 554C72388A04; Mon, 16 Jun 2008 11:53:24 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r668261 - in /geronimo/server/trunk/testsuite/commands-testsuite/deploy/src/test/java/org/apache/geronimo/testsuite/deploy: DeployerOfflineTest.java DeployerTest.java Date: Mon, 16 Jun 2008 18:53:24 -0000 To: scm@geronimo.apache.org From: gawor@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080616185324.554C72388A04@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: gawor Date: Mon Jun 16 11:53:23 2008 New Revision: 668261 URL: http://svn.apache.org/viewvc?rev=668261&view=rev Log: add initial tests to test offline deployer Added: geronimo/server/trunk/testsuite/commands-testsuite/deploy/src/test/java/org/apache/geronimo/testsuite/deploy/DeployerOfflineTest.java (with props) Modified: 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/DeployerOfflineTest.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/commands-testsuite/deploy/src/test/java/org/apache/geronimo/testsuite/deploy/DeployerOfflineTest.java?rev=668261&view=auto ============================================================================== --- geronimo/server/trunk/testsuite/commands-testsuite/deploy/src/test/java/org/apache/geronimo/testsuite/deploy/DeployerOfflineTest.java (added) +++ geronimo/server/trunk/testsuite/commands-testsuite/deploy/src/test/java/org/apache/geronimo/testsuite/deploy/DeployerOfflineTest.java Mon Jun 16 11:53:23 2008 @@ -0,0 +1,45 @@ +/** + * 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.annotations.Test; + +@Test +public class DeployerOfflineTest extends DeployerTest { + + @Override + protected String execute(String[] args) throws Exception { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + List cmd = new ArrayList(); + cmd.addAll(Arrays.asList("--offline")); + if (args != null) { + cmd.addAll(Arrays.asList(args)); + } + execute(CommandTestSupport.DEPLOY, cmd, null, baos); + return baos.toString(); + } + +} Propchange: geronimo/server/trunk/testsuite/commands-testsuite/deploy/src/test/java/org/apache/geronimo/testsuite/deploy/DeployerOfflineTest.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: 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=668261&r1=668260&r2=668261&view=diff ============================================================================== --- geronimo/server/trunk/testsuite/commands-testsuite/deploy/src/test/java/org/apache/geronimo/testsuite/deploy/DeployerTest.java (original) +++ geronimo/server/trunk/testsuite/commands-testsuite/deploy/src/test/java/org/apache/geronimo/testsuite/deploy/DeployerTest.java Mon Jun 16 11:53:23 2008 @@ -47,8 +47,8 @@ String[] args = new String[]{ "list-modules" }; String output = execute(args); - - if (output.indexOf("org.apache.geronimo.configs/activemq-broker") < 0) { + + if (output.indexOf("org.apache.geronimo.configs/j2ee-deployer") < 0) { Assert.fail("list-modules failed : " + output); } } @@ -59,10 +59,7 @@ 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) { + if (output.indexOf("org.apache.geronimo.configs/j2ee-deployer") < 0) { Assert.fail("list-modules failed : " + output); } } @@ -73,30 +70,20 @@ 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); + if (output.indexOf("org.apache.geronimo.configs/j2ee-deployer") > 0) { + Assert.fail("list-modules failed : " + output); } } @Test - public void testOfflineDeployment() throws Exception { - //todo doesn't work now - /* - String[] args = new String[]{ "--offline", "deploy", "" }; + public void testListTargets() throws Exception { + String[] args = new String[]{ "list-targets" }; - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - execute( command, args, null, baos ); + String output = execute(args); - if (baos.toString().indexOf("org.apache.geronimo.configs/activemq-broker") > 0) { - Assert.fail("deploy/list-modules failed : " + baos.toString()); + if (output.indexOf("j2eeType=ConfigurationStore,name=Local") < 0) { + Assert.fail("deploy/list-targets failed : " + output); } - if (baos.toString().indexOf("org.apache.geronimo.configs/client-corba-yoko") < 0) { - Assert.fail("deploy/list-modules failed : " + baos.toString()); - } - */ } - + }