[jbpm-commits] JBoss JBPM SVN: r5596 - in jbpm3/branches/jbpm-3.2-soa/modules/enterprise: src/test/java/org/jbpm/enterprise/console and 1 other directory.

do-not-reply at jboss.org do-not-reply at jboss.org
Mon Aug 31 04:26:10 EDT 2009


Author: alex.guizar at jboss.com
Date: 2009-08-31 04:26:10 -0400 (Mon, 31 Aug 2009)
New Revision: 5596

Modified:
   jbpm3/branches/jbpm-3.2-soa/modules/enterprise/pom.xml
   jbpm3/branches/jbpm-3.2-soa/modules/enterprise/src/test/java/org/jbpm/enterprise/console/ConsoleAvailabilityTest.java
Log:
make jboss.bind.address available to console availability test

Modified: jbpm3/branches/jbpm-3.2-soa/modules/enterprise/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/enterprise/pom.xml	2009-08-31 07:22:40 UTC (rev 5595)
+++ jbpm3/branches/jbpm-3.2-soa/modules/enterprise/pom.xml	2009-08-31 08:26:10 UTC (rev 5596)
@@ -27,11 +27,6 @@
     <relativePath>../../pom.xml</relativePath>
   </parent>
 
-  <!-- Properties -->
-  <properties>
-    <surefire.security.args>-Djava.security.manager -Djava.security.policy=src/test/resources/test.policy</surefire.security.args>
-  </properties>
-
   <!-- Dependencies -->
   <dependencies>
     <!-- jBPM Dependencies -->
@@ -57,6 +52,8 @@
       <artifactId>hibernate</artifactId>
       <scope>provided</scope>
     </dependency>
+
+    <!-- Test Dependencies -->
     <dependency>
       <groupId>org.apache.cactus</groupId>
       <artifactId>cactus.core.framework.wrapper.javaEE.14</artifactId>
@@ -84,8 +81,6 @@
       <artifactId>jbossall-client</artifactId>
       <scope>test</scope>
     </dependency>
-
-    <!-- Test Dependencies -->
   </dependencies>
 
   <!-- Plugins -->
@@ -164,16 +159,24 @@
       <plugin>
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
-          <argLine>${surefire.security.args}</argLine>
           <systemProperties>
             <property>
               <name>log4j.output.dir</name>
               <value>${project.build.directory}</value>
             </property>
+            <property>
+              <name>jboss.bind.address</name>
+              <value>${jboss.bind.address}</value>
+            </property>
+            <property>
+              <name>java.security.manager</name>
+              <value/>
+            </property>
+            <property>
+              <name>java.security.policy</name>
+              <value>src/test/resources/test.policy</value>
+            </property>
           </systemProperties>
-          <excludes>
-            <exclude>org/jbpm/enterprise/console/ConsoleAvailabilityTest.java</exclude>
-          </excludes>
         </configuration>
       </plugin>
     </plugins>
@@ -260,92 +263,5 @@
         </plugins>
       </build>
     </profile>
-
-    <!-- 
-    Name:  mysql
-    Descr: MySQL Database Setup   
-    -->
-    <profile>
-      <id>mysql</id>
-      <activation>
-        <property>
-          <name>database</name>
-          <value>mysql</value>
-        </property>
-      </activation>
-      <build>
-        <plugins>
-          <plugin>
-            <artifactId>maven-surefire-plugin</artifactId>
-          </plugin>
-        </plugins>
-      </build>
-    </profile>
-
-    <!-- 
-    Name:  postgresql
-    Descr: PostgreSQL Database Setup   
-    -->
-    <profile>
-      <id>postgresql</id>
-      <activation>
-        <property>
-          <name>database</name>
-          <value>postgresql</value>
-        </property>
-      </activation>
-      <build>
-        <plugins>
-          <plugin>
-            <artifactId>maven-surefire-plugin</artifactId>
-          </plugin>
-        </plugins>
-      </build>
-    </profile>
-
-    <!-- 
-    Name:  sybase
-    Descr: Sybase Database Setup   
-    -->
-    <profile>
-      <id>sybase</id>
-      <activation>
-        <property>
-          <name>database</name>
-          <value>sybase</value>
-        </property>
-      </activation>
-      <build>
-        <plugins>
-          <plugin>
-            <artifactId>maven-surefire-plugin</artifactId>
-          </plugin>
-        </plugins>
-      </build>
-    </profile>
-
-    <!-- 
-    Name:  oracle
-    Descr: Oracle Database Setup   
-    -->
-    <profile>
-      <id>oracle</id>
-      <activation>
-        <property>
-          <name>database</name>
-          <value>oracle</value>
-        </property>
-      </activation>
-      <build>
-        <plugins>
-          <plugin>
-            <artifactId>maven-surefire-plugin</artifactId>
-          </plugin>
-        </plugins>
-      </build>
-      <dependencies>
-      </dependencies>
-    </profile>
-
   </profiles>
 </project>

Modified: jbpm3/branches/jbpm-3.2-soa/modules/enterprise/src/test/java/org/jbpm/enterprise/console/ConsoleAvailabilityTest.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/enterprise/src/test/java/org/jbpm/enterprise/console/ConsoleAvailabilityTest.java	2009-08-31 07:22:40 UTC (rev 5595)
+++ jbpm3/branches/jbpm-3.2-soa/modules/enterprise/src/test/java/org/jbpm/enterprise/console/ConsoleAvailabilityTest.java	2009-08-31 08:26:10 UTC (rev 5596)
@@ -21,35 +21,28 @@
  */
 package org.jbpm.enterprise.console;
 
-import java.io.BufferedReader;
 import java.io.IOException;
-import java.io.InputStreamReader;
 import java.net.HttpURLConnection;
 import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
 
 import junit.framework.TestCase;
 
 /**
  * @author Heiko.Braun <heiko.braun at jboss.com>
  */
-public class ConsoleAvailabilityTest extends TestCase
-{
+public class ConsoleAvailabilityTest extends TestCase {
+
   /**
    * Verify if the console has been deployed successfully
    */
-  public void testConsoleDeployment() throws IOException
-  {
+  public void testConsoleDeployment() throws IOException {
     String host = "localhost";
     int port = 8080;
 
     String bindAddress = System.getProperty("jboss.bind.address");
-    if (bindAddress != null)
-    {
+    if (bindAddress != null) {
       int colonIndex = bindAddress.lastIndexOf(':');
-      if (colonIndex != -1)
-      {
+      if (colonIndex != -1) {
         host = bindAddress.substring(0, colonIndex);
         port = Integer.parseInt(bindAddress.substring(colonIndex + 1));
       }
@@ -60,45 +53,23 @@
     URL url = new URL("http", host, port, "/jbpm-console");
     System.out.println("Console URL: " + url);
 
-    List response = doGet(url);
-    String status = (String) response.get(0);
-    assertEquals(HttpURLConnection.HTTP_OK, Integer.parseInt(status));
+    int responseCode = doGet(url);
+    assertEquals(HttpURLConnection.HTTP_OK, responseCode);
   }
 
   /**
    * Gets the resource pointed by the given URL.
+   * 
    * @param url a pointer to a resource
-   * @return response data in the following order:
-   * <
-   * <li>Code</li>
-   * <li>Message</li>
-   * <li>Body</li>
-   * @throws IOException
+   * @return the response code
+   * @throws IOException if an I/O error occurs
    */
-  static List doGet(URL url) throws IOException
-  {
+  static int doGet(URL url) throws IOException {
     HttpURLConnection connection = (HttpURLConnection) url.openConnection();
-    try 
-    {
-      List response = new ArrayList();
-      response.add(Integer.toString(connection.getResponseCode()));
-      response.add(connection.getResponseMessage());
-
-      BufferedReader connReader = new BufferedReader(new InputStreamReader(connection
-          .getInputStream()));
-      try
-      {
-        for (String line; (line = connReader.readLine()) != null;)
-          response.add(line);
-      }
-      finally
-      {
-        connReader.close();
-      }
-      return response;
+    try {
+      return connection.getResponseCode();
     }
-    finally 
-    {
+    finally {
       connection.disconnect();
     }
   }



More information about the jbpm-commits mailing list