[jboss-svn-commits] JBoss Common SVN: r4627 - in arquillian/trunk/containers/jetty-embedded-6.1/src: test/java/org/jboss/arquillian/container/jetty/embedded_6_1 and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Jun 29 18:31:51 EDT 2010


Author: dan.j.allen
Date: 2010-06-29 18:31:51 -0400 (Tue, 29 Jun 2010)
New Revision: 4627

Added:
   arquillian/trunk/containers/jetty-embedded-6.1/src/test/java/org/jboss/arquillian/container/jetty/embedded_6_1/JettyEmbeddedClientTestCase.java
Removed:
   arquillian/trunk/containers/jetty-embedded-6.1/src/test/java/org/jboss/arquillian/container/jetty/embedded_6_1/JettyEmbeddedContainerClientTestCase.java
Modified:
   arquillian/trunk/containers/jetty-embedded-6.1/src/main/java/org/jboss/arquillian/container/jetty/embedded_6_1/JettyEmbeddedConfiguration.java
   arquillian/trunk/containers/jetty-embedded-6.1/src/main/java/org/jboss/arquillian/container/jetty/embedded_6_1/JettyEmbeddedContainer.java
Log:
rename test class
change bindHost to bindAddress


Modified: arquillian/trunk/containers/jetty-embedded-6.1/src/main/java/org/jboss/arquillian/container/jetty/embedded_6_1/JettyEmbeddedConfiguration.java
===================================================================
--- arquillian/trunk/containers/jetty-embedded-6.1/src/main/java/org/jboss/arquillian/container/jetty/embedded_6_1/JettyEmbeddedConfiguration.java	2010-06-29 22:10:37 UTC (rev 4626)
+++ arquillian/trunk/containers/jetty-embedded-6.1/src/main/java/org/jboss/arquillian/container/jetty/embedded_6_1/JettyEmbeddedConfiguration.java	2010-06-29 22:31:51 UTC (rev 4627)
@@ -28,7 +28,7 @@
  */
 public class JettyEmbeddedConfiguration implements ContainerConfiguration
 {
-   private String bindHost = "localhost";
+   private String bindAddress = "localhost";
 
    private int bindHttpPort = 9090;
 
@@ -49,14 +49,14 @@
       this.bindHttpPort = bindHttpPort;
    }
 
-   public String getBindHost()
+   public String getBindAddress()
    {
-      return bindHost;
+      return bindAddress;
    }
 
-   public void setBindHost(String bindHost)
+   public void setBindAddress(String bindAddress)
    {
-      this.bindHost = bindHost;
+      this.bindAddress = bindAddress;
    }
 
    public boolean isJettyPlus()

Modified: arquillian/trunk/containers/jetty-embedded-6.1/src/main/java/org/jboss/arquillian/container/jetty/embedded_6_1/JettyEmbeddedContainer.java
===================================================================
--- arquillian/trunk/containers/jetty-embedded-6.1/src/main/java/org/jboss/arquillian/container/jetty/embedded_6_1/JettyEmbeddedContainer.java	2010-06-29 22:10:37 UTC (rev 4626)
+++ arquillian/trunk/containers/jetty-embedded-6.1/src/main/java/org/jboss/arquillian/container/jetty/embedded_6_1/JettyEmbeddedContainer.java	2010-06-29 22:31:51 UTC (rev 4627)
@@ -91,7 +91,7 @@
       {
          server = new Server();
          Connector connector = new SelectChannelConnector();
-         connector.setHost(containerConfig.getBindHost());
+         connector.setHost(containerConfig.getBindAddress());
          connector.setPort(containerConfig.getBindHttpPort());
          server.setConnectors(new Connector[] { connector });
          server.start();
@@ -150,7 +150,7 @@
          return new ServletMethodExecutor(
                new URL(
                      HTTP_PROTOCOL,
-                     containerConfig.getBindHost(),
+                     containerConfig.getBindAddress(),
                      containerConfig.getBindHttpPort(),
                      "/")
                );

Copied: arquillian/trunk/containers/jetty-embedded-6.1/src/test/java/org/jboss/arquillian/container/jetty/embedded_6_1/JettyEmbeddedClientTestCase.java (from rev 4579, arquillian/trunk/containers/jetty-embedded-6.1/src/test/java/org/jboss/arquillian/container/jetty/embedded_6_1/JettyEmbeddedContainerClientTestCase.java)
===================================================================
--- arquillian/trunk/containers/jetty-embedded-6.1/src/test/java/org/jboss/arquillian/container/jetty/embedded_6_1/JettyEmbeddedClientTestCase.java	                        (rev 0)
+++ arquillian/trunk/containers/jetty-embedded-6.1/src/test/java/org/jboss/arquillian/container/jetty/embedded_6_1/JettyEmbeddedClientTestCase.java	2010-06-29 22:31:51 UTC (rev 4627)
@@ -0,0 +1,90 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.jboss.arquillian.container.jetty.embedded_6_1;
+
+import static org.jboss.arquillian.api.RunModeType.AS_CLIENT;
+
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.logging.Logger;
+
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.api.Run;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * Client test case for the Jetty Embedded 6.1.x container
+ *
+ * @author <a href="mailto:aslak at redhat.com">Aslak Knutsen</a>
+ * @author Dan Allen
+ * @version $Revision: $
+ */
+ at RunWith(Arquillian.class)
+ at Run(AS_CLIENT)
+public class JettyEmbeddedClientTestCase
+{
+   private static final Logger log = Logger.getLogger(JettyEmbeddedClientTestCase.class.getName());
+   
+   /**
+    * Deployment for the test
+    */
+   @Deployment
+   public static WebArchive getTestArchive()
+   {
+      final WebArchive war = ShrinkWrap.create("client-test.war", WebArchive.class)
+         .addClass(TestServlet.class)
+         .setWebXML("client-web.xml");
+      log.info(war.toString(true));
+      return war;
+   }
+
+   @Test
+   public void shouldBeAbleToInvokeServletInDeployedWebApp() throws Exception
+   {
+      String body = readAllAndClose(
+            new URL("http://localhost:9595/test" + TestServlet.URL_PATTERN).openStream());
+      
+      Assert.assertEquals(
+            "Verify that the servlet was deployed and returns expected result",
+            TestServlet.MESSAGE,
+            body);
+   }
+   
+   private String readAllAndClose(InputStream is) throws Exception 
+   {
+      ByteArrayOutputStream out = new ByteArrayOutputStream();
+      try
+      {
+         int read;
+         while( (read = is.read()) != -1)
+         {
+            out.write(read);
+         }
+      }
+      finally 
+      {
+         try { is.close(); } catch (Exception e) { }
+      }
+      return out.toString();
+   }
+}

Deleted: arquillian/trunk/containers/jetty-embedded-6.1/src/test/java/org/jboss/arquillian/container/jetty/embedded_6_1/JettyEmbeddedContainerClientTestCase.java
===================================================================
--- arquillian/trunk/containers/jetty-embedded-6.1/src/test/java/org/jboss/arquillian/container/jetty/embedded_6_1/JettyEmbeddedContainerClientTestCase.java	2010-06-29 22:10:37 UTC (rev 4626)
+++ arquillian/trunk/containers/jetty-embedded-6.1/src/test/java/org/jboss/arquillian/container/jetty/embedded_6_1/JettyEmbeddedContainerClientTestCase.java	2010-06-29 22:31:51 UTC (rev 4627)
@@ -1,90 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed 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.jboss.arquillian.container.jetty.embedded_6_1;
-
-import static org.jboss.arquillian.api.RunModeType.AS_CLIENT;
-
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.logging.Logger;
-
-import org.jboss.arquillian.api.Deployment;
-import org.jboss.arquillian.api.Run;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-/**
- * Client test case for the Jetty Embedded 6.1.x container
- *
- * @author <a href="mailto:aslak at redhat.com">Aslak Knutsen</a>
- * @author Dan Allen
- * @version $Revision: $
- */
- at RunWith(Arquillian.class)
- at Run(AS_CLIENT)
-public class JettyEmbeddedContainerClientTestCase
-{
-   private static final Logger log = Logger.getLogger(JettyEmbeddedContainerClientTestCase.class.getName());
-   
-   /**
-    * Deployment for the test
-    */
-   @Deployment
-   public static WebArchive getTestArchive()
-   {
-      final WebArchive war = ShrinkWrap.create("client-test.war", WebArchive.class)
-         .addClass(TestServlet.class)
-         .setWebXML("client-web.xml");
-      log.info(war.toString(true));
-      return war;
-   }
-
-   @Test
-   public void shouldBeAbleToInvokeServletInDeployedWebApp() throws Exception
-   {
-      String body = readAllAndClose(
-            new URL("http://localhost:9595/test" + TestServlet.URL_PATTERN).openStream());
-      
-      Assert.assertEquals(
-            "Verify that the servlet was deployed and returns expected result",
-            TestServlet.MESSAGE,
-            body);
-   }
-   
-   private String readAllAndClose(InputStream is) throws Exception 
-   {
-      ByteArrayOutputStream out = new ByteArrayOutputStream();
-      try
-      {
-         int read;
-         while( (read = is.read()) != -1)
-         {
-            out.write(read);
-         }
-      }
-      finally 
-      {
-         try { is.close(); } catch (Exception e) { }
-      }
-      return out.toString();
-   }
-}



More information about the jboss-svn-commits mailing list