You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ga...@apache.org on 2008/06/16 20:53:24 UTC

svn commit: r668261 - in /geronimo/server/trunk/testsuite/commands-testsuite/deploy/src/test/java/org/apache/geronimo/testsuite/deploy: DeployerOfflineTest.java DeployerTest.java

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<String> cmd = new ArrayList<String>();
+        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());
-        }
-        */
     }
-    
+        
 }