JBoss-OSGI SVN: r91212 - projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-14 09:36:33 -0400 (Tue, 14 Jul 2009)
New Revision: 91212
Modified:
projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/.classpath
Log:
fix eclipse classpath
Modified: projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/.classpath
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/.classpath 2009-07-14 13:33:53 UTC (rev 91211)
+++ projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/.classpath 2009-07-14 13:36:33 UTC (rev 91212)
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src/test/java"/>
- <classpathentry excluding="**" kind="src" path="src/test/resources"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
- <classpathentry kind="output" path="target/test-classes"/>
+ <classpathentry kind="output" path="target/classes"/>
</classpath>
16 years, 5 months
JBoss-OSGI SVN: r91211 - in projects/jboss-osgi/trunk: testsuite and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-14 09:33:53 -0400 (Tue, 14 Jul 2009)
New Revision: 91211
Modified:
projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/.classpath
projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/pom.xml
projects/jboss-osgi/trunk/testsuite/pom.xml
Log:
Disable blueprint tests for equinox and knopflerfish
Modified: projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/.classpath
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/.classpath 2009-07-14 13:31:10 UTC (rev 91210)
+++ projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/.classpath 2009-07-14 13:33:53 UTC (rev 91211)
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="src" path="src/test/java"/>
+ <classpathentry excluding="**" kind="src" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
- <classpathentry kind="output" path="target/classes"/>
+ <classpathentry kind="output" path="target/test-classes"/>
</classpath>
Modified: projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/pom.xml 2009-07-14 13:31:10 UTC (rev 91210)
+++ projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/pom.xml 2009-07-14 13:33:53 UTC (rev 91211)
@@ -119,6 +119,53 @@
<!-- Profiles -->
<profiles>
+ <!--
+ Name: framework-equinox
+ Descr: Setup for Equinox framework integration testing
+ -->
+ <profile>
+ <id>framework-equinox</id>
+ <activation>
+ <property>
+ <name>framework</name>
+ <value>equinox</value>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skipTests>true</skipTests>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <!--
+ Name: framework-knopflerfish
+ Descr: Setup for Knopflerfish framework integration testing
+ -->
+ <profile>
+ <id>framework-knopflerfish</id>
+ <activation>
+ <property>
+ <name>framework</name>
+ <value>knopflerfish</value>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skipTests>true</skipTests>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
</profiles>
</project>
Modified: projects/jboss-osgi/trunk/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/pom.xml 2009-07-14 13:31:10 UTC (rev 91210)
+++ projects/jboss-osgi/trunk/testsuite/pom.xml 2009-07-14 13:33:53 UTC (rev 91211)
@@ -1,16 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
- <!-- ====================================================================== -->
- <!-- -->
- <!-- JBoss, the OpenSource J2EE webOS -->
- <!-- -->
- <!-- Distributable under LGPL license. -->
- <!-- See terms of license at http://www.gnu.org. -->
- <!-- -->
- <!-- ====================================================================== -->
+ <!--
+ ======================================================================
+ -->
+ <!--
+ -->
+ <!--
+ JBoss, the OpenSource J2EE webOS
+ -->
+ <!--
+ -->
+ <!--
+ Distributable under LGPL license.
+ -->
+ <!--
+ See terms of license at http://www.gnu.org.
+ -->
+ <!--
+ -->
+ <!--
+ ======================================================================
+ -->
- <!-- $Id$ -->
-
+ <!--
+ $Id$
+ -->
+
<project xmlns="http://maven.apache.org/POM/4.0.0" 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">
<modelVersion>4.0.0</modelVersion>
@@ -37,6 +52,7 @@
<version.javax.servlet>2.4</version.javax.servlet>
<version.jboss.naming>5.0.1.GA</version.jboss.naming>
<version.jboss.microcontainer>2.0.5.GA</version.jboss.microcontainer>
+ <version.jbossas.client>5.0.1.GA</version.jbossas.client>
</properties>
<!-- DependencyManagement -->
@@ -48,6 +64,11 @@
<version>${version.javax.servlet}</version>
</dependency>
<dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-client</artifactId>
+ <version>${version.jbossas.client}</version>
+ </dependency>
+ <dependency>
<groupId>org.jboss.microcontainer</groupId>
<artifactId>jboss-aop-mc-int</artifactId>
<version>${version.jboss.microcontainer}</version>
@@ -132,9 +153,9 @@
<profiles>
<!--
- Name: framework-default
- Descr: Setup for default framework integration testing
- -->
+ Name: framework-default Descr: Setup for default framework
+ integration testing
+ -->
<profile>
<id>framework-default</id>
<activation>
@@ -151,9 +172,9 @@
</profile>
<!--
- Name: framework-felix
- Descr: Setup for Felix framework integration testing
- -->
+ Name: framework-felix Descr: Setup for Felix framework integration
+ testing
+ -->
<profile>
<id>framework-felix</id>
<activation>
@@ -171,9 +192,9 @@
</profile>
<!--
- Name: framework-equinox
- Descr: Setup for Equinox framework integration testing
- -->
+ Name: framework-equinox Descr: Setup for Equinox framework
+ integration testing
+ -->
<profile>
<id>framework-equinox</id>
<activation>
@@ -204,9 +225,9 @@
</profile>
<!--
- Name: framework-knopflerfish
- Descr: Setup for Knopflerfish framework integration testing
- -->
+ Name: framework-knopflerfish Descr: Setup for Knopflerfish framework
+ integration testing
+ -->
<profile>
<id>framework-knopflerfish</id>
<activation>
@@ -237,9 +258,8 @@
</profile>
<!--
- Name: embedded-testing
- Descr: Setup for embedded integration testing
- -->
+ Name: embedded-testing Descr: Setup for embedded integration testing
+ -->
<profile>
<id>embedded-testing</id>
<activation>
@@ -263,9 +283,8 @@
</profile>
<!--
- Name: runtime-testing
- Descr: Setup for runtime integration testing
- -->
+ Name: runtime-testing Descr: Setup for runtime integration testing
+ -->
<profile>
<id>runtime-testing</id>
<activation>
@@ -290,9 +309,8 @@
</profile>
<!--
- Name: jboss501
- Descr: Setup for jboss501 integration testing
- -->
+ Name: jboss501 Descr: Setup for jboss501 integration testing
+ -->
<profile>
<id>jboss501</id>
<activation>
@@ -312,9 +330,8 @@
</profile>
<!--
- Name: jboss510
- Descr: Setup for jboss510 integration testing
- -->
+ Name: jboss510 Descr: Setup for jboss510 integration testing
+ -->
<profile>
<id>jboss510</id>
<activation>
@@ -334,9 +351,8 @@
</profile>
<!--
- Name: jboss600
- Descr: Setup for jboss600 integration testing
- -->
+ Name: jboss600 Descr: Setup for jboss600 integration testing
+ -->
<profile>
<id>jboss600</id>
<activation>
16 years, 5 months
JBoss-OSGI SVN: r91206 - in projects/jboss-osgi/trunk/reactor/bundles: jboss-xml-binding/src/main/java/org/jboss/osgi/jbossxb/internal and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-14 08:27:47 -0400 (Tue, 14 Jul 2009)
New Revision: 91206
Modified:
projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/pom.xml
projects/jboss-osgi/trunk/reactor/bundles/jboss-xml-binding/src/main/java/org/jboss/osgi/jbossxb/internal/DocumentBuilderFactoryOSGi.java
projects/jboss-osgi/trunk/reactor/bundles/jboss-xml-binding/src/main/java/org/jboss/osgi/jbossxb/internal/SAXParserFactoryOSGi.java
Log:
Fix log4j initialization
Modified: projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/pom.xml 2009-07-14 12:12:00 UTC (rev 91205)
+++ projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/pom.xml 2009-07-14 12:27:47 UTC (rev 91206)
@@ -40,11 +40,6 @@
<artifactId>bnd</artifactId>
</dependency>
<dependency>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-log4j</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-runtime-felix</artifactId>
</dependency>
Modified: projects/jboss-osgi/trunk/reactor/bundles/jboss-xml-binding/src/main/java/org/jboss/osgi/jbossxb/internal/DocumentBuilderFactoryOSGi.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/jboss-xml-binding/src/main/java/org/jboss/osgi/jbossxb/internal/DocumentBuilderFactoryOSGi.java 2009-07-14 12:12:00 UTC (rev 91205)
+++ projects/jboss-osgi/trunk/reactor/bundles/jboss-xml-binding/src/main/java/org/jboss/osgi/jbossxb/internal/DocumentBuilderFactoryOSGi.java 2009-07-14 12:27:47 UTC (rev 91206)
@@ -26,7 +26,6 @@
import javax.xml.parsers.DocumentBuilderFactory;
import org.apache.xerces.jaxp.DocumentBuilderFactoryImpl;
-import org.jboss.logging.Logger;
/**
* A {@link DocumentBuilderFactory}
@@ -36,11 +35,4 @@
*/
public class DocumentBuilderFactoryOSGi extends DocumentBuilderFactoryImpl
{
- // Provide logging
- final Logger log = Logger.getLogger(DocumentBuilderFactoryOSGi.class);
-
- public DocumentBuilderFactoryOSGi()
- {
- log.debug("Using OSGi DocumentBuilderFactory");
- }
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/reactor/bundles/jboss-xml-binding/src/main/java/org/jboss/osgi/jbossxb/internal/SAXParserFactoryOSGi.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/jboss-xml-binding/src/main/java/org/jboss/osgi/jbossxb/internal/SAXParserFactoryOSGi.java 2009-07-14 12:12:00 UTC (rev 91205)
+++ projects/jboss-osgi/trunk/reactor/bundles/jboss-xml-binding/src/main/java/org/jboss/osgi/jbossxb/internal/SAXParserFactoryOSGi.java 2009-07-14 12:27:47 UTC (rev 91206)
@@ -26,21 +26,13 @@
import javax.xml.parsers.SAXParserFactory;
import org.apache.xerces.jaxp.SAXParserFactoryImpl;
-import org.jboss.logging.Logger;
/**
- * A {@link SAXParserFactory}
+ * A {@link SAXParserFactory}
*
* @author thomas.diesler(a)jboss.com
* @since 13-May-2009
*/
public class SAXParserFactoryOSGi extends SAXParserFactoryImpl
{
- // Provide logging
- final Logger log = Logger.getLogger(SAXParserFactoryOSGi.class);
-
- public SAXParserFactoryOSGi()
- {
- log.debug("Using OSGi SAXParserFactory");
- }
}
\ No newline at end of file
16 years, 5 months
JBoss-OSGI SVN: r91205 - in projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky: runtime/osgi and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-14 08:12:00 -0400 (Tue, 14 Jul 2009)
New Revision: 91205
Modified:
projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractConnector.java
projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/JMXConnector.java
projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/JMXConnectorMBean.java
projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/SocketConnector.java
Log:
Restore stream access via ConnectorMBean
Modified: projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractConnector.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractConnector.java 2009-07-14 11:37:53 UTC (rev 91204)
+++ projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractConnector.java 2009-07-14 12:12:00 UTC (rev 91205)
@@ -23,6 +23,12 @@
// $Id$
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -69,4 +75,45 @@
}
throw new IllegalStateException("Cannot find listener to handle: " + testClass + ", we have " + listeners);
}
+
+ protected InputStream process(InputStream reqStream)
+ {
+ Request request = null;
+ Response response = null;
+ try
+ {
+ // Unmarshall the Request
+ ObjectInputStream ois = new ObjectInputStream(reqStream);
+ request = (Request)ois.readObject();
+
+ // Field the request through the abstract connector
+ response = process(request);
+ }
+ catch (Exception ex)
+ {
+ response = new BasicResponse();
+ BasicFailure failure = new BasicFailure(ex.getMessage(), ex);
+ if (request != null)
+ {
+ failure.setClassName(request.getClassName());
+ failure.setMethodName(request.getMethodName());
+ }
+ response.addFailure(failure);
+ }
+
+ // Marshall the Response
+ try
+ {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ObjectOutputStream oos = new ObjectOutputStream(baos);
+ oos.writeObject(response);
+ oos.close();
+
+ return new ByteArrayInputStream(baos.toByteArray());
+ }
+ catch (IOException ex)
+ {
+ throw new IllegalStateException("Cannot marshall response", ex);
+ }
+ }
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/JMXConnector.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/JMXConnector.java 2009-07-14 11:37:53 UTC (rev 91204)
+++ projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/JMXConnector.java 2009-07-14 12:12:00 UTC (rev 91205)
@@ -23,6 +23,7 @@
// $Id$
+import java.io.InputStream;
import java.util.Properties;
import javax.management.MBeanServer;
@@ -96,4 +97,10 @@
server.unregisterMBean(OBJECT_NAME);
}
}
+
+ @Override
+ public InputStream process(InputStream reqStream)
+ {
+ return super.process(reqStream);
+ }
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/JMXConnectorMBean.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/JMXConnectorMBean.java 2009-07-14 11:37:53 UTC (rev 91204)
+++ projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/JMXConnectorMBean.java 2009-07-14 12:12:00 UTC (rev 91205)
@@ -23,8 +23,11 @@
//$Id$
-import org.jboss.osgi.husky.runtime.PackageListener;
+import java.io.InputStream;
+import org.jboss.osgi.husky.Request;
+import org.jboss.osgi.husky.Response;
+
/**
* The management interface of the {@link JMXConnector}.
*
@@ -33,8 +36,12 @@
*/
public interface JMXConnectorMBean
{
- /*
- * Add a {@link PackageListener} to this connector
+ /**
+ * Consumes the serialized version of an {@link Request} and
+ * return the the {@link Response} from the test run
+ *
+ * @param reqStream the input stream to read the {@link Request} from
+ * @return the input stream to read the {@link Response} from
*/
- void addPackageListener(PackageListener listener);
+ InputStream process(InputStream reqStream);
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/SocketConnector.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/SocketConnector.java 2009-07-14 11:37:53 UTC (rev 91204)
+++ projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/SocketConnector.java 2009-07-14 12:12:00 UTC (rev 91205)
@@ -23,22 +23,14 @@
// $Id$
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.Properties;
-import org.jboss.osgi.husky.Request;
-import org.jboss.osgi.husky.Response;
import org.jboss.osgi.husky.internal.AbstractConnector;
-import org.jboss.osgi.husky.internal.BasicFailure;
-import org.jboss.osgi.husky.internal.BasicResponse;
import org.jboss.osgi.husky.internal.LogServiceTracker;
import org.jboss.osgi.husky.internal.Util;
import org.jboss.osgi.husky.runtime.Connector;
@@ -118,47 +110,6 @@
listenerThread.stopListener();
}
- private InputStream process(InputStream reqStream)
- {
- Request request = null;
- Response response = null;
- try
- {
- // Unmarshall the Request
- ObjectInputStream ois = new ObjectInputStream(reqStream);
- request = (Request)ois.readObject();
-
- // Field the request through the abstract connector
- response = process(request);
- }
- catch (Exception ex)
- {
- response = new BasicResponse();
- BasicFailure failure = new BasicFailure(ex.getMessage(), ex);
- if (request != null)
- {
- failure.setClassName(request.getClassName());
- failure.setMethodName(request.getMethodName());
- }
- response.addFailure(failure);
- }
-
- // Marshall the Response
- try
- {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- ObjectOutputStream oos = new ObjectOutputStream(baos);
- oos.writeObject(response);
- oos.close();
-
- return new ByteArrayInputStream(baos.toByteArray());
- }
- catch (IOException ex)
- {
- throw new IllegalStateException("Cannot marshall response", ex);
- }
- }
-
class ListenerThread extends Thread
{
private ServerSocket serverSocket;
16 years, 5 months
JBoss-OSGI SVN: r91204 - projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-14 07:37:53 -0400 (Tue, 14 Jul 2009)
New Revision: 91204
Modified:
projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/HuskyExtender.java
Log:
layout code
Modified: projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/HuskyExtender.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/HuskyExtender.java 2009-07-14 11:36:38 UTC (rev 91203)
+++ projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/HuskyExtender.java 2009-07-14 11:37:53 UTC (rev 91204)
@@ -41,8 +41,7 @@
import org.osgi.service.log.LogService;
/**
- * The Husky extender is a {@link BundleListener} that checkes
- * the {@link #HEADER_TEST_PACKAGE}
+ * The Husky extender is a {@link BundleListener} that checkes the {@link #HEADER_TEST_PACKAGE}
*
* @author Thomas.Diesler(a)jboss.com
* @since 17-May-2009
@@ -51,7 +50,7 @@
{
/** The manifest header that identifies a bundle as Husky test bundle: 'Test-Package' */
public static final String HEADER_TEST_PACKAGE = "Test-Package";
-
+
private BundleContext context;
private LogService log;
@@ -94,7 +93,6 @@
if (srefs != null)
{
log.log(LogService.LOG_INFO, "Register test packages " + packages);
-
for (ServiceReference sref : srefs)
{
Connector connector = (Connector)context.getService(sref);
@@ -115,7 +113,7 @@
{
// cannot get here
}
-
+
if (srefs != null)
{
log.log(LogService.LOG_INFO, "Unregister test packages " + packages);
@@ -137,7 +135,7 @@
String testPackage = (String)bundle.getHeaders().get(HEADER_TEST_PACKAGE);
if (testPackage != null)
return Arrays.asList(testPackage.split("[,\\s]"));
-
+
return null;
}
}
\ No newline at end of file
16 years, 5 months
JBoss-OSGI SVN: r91203 - projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-14 07:36:38 -0400 (Tue, 14 Jul 2009)
New Revision: 91203
Modified:
projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/HuskyExtender.java
Log:
Prevent potential NPE
Modified: projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/HuskyExtender.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/HuskyExtender.java 2009-07-14 11:34:29 UTC (rev 91202)
+++ projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/HuskyExtender.java 2009-07-14 11:36:38 UTC (rev 91203)
@@ -92,13 +92,15 @@
}
if (srefs != null)
+ {
log.log(LogService.LOG_INFO, "Register test packages " + packages);
- for (ServiceReference sref : srefs)
- {
- Connector connector = (Connector)context.getService(sref);
- JUnitPackageListener listener = new OSGiJUnitPackageListener(bundle, packages);
- connector.addPackageListener(listener);
+ for (ServiceReference sref : srefs)
+ {
+ Connector connector = (Connector)context.getService(sref);
+ JUnitPackageListener listener = new OSGiJUnitPackageListener(bundle, packages);
+ connector.addPackageListener(listener);
+ }
}
}
@@ -115,16 +117,17 @@
}
if (srefs != null)
+ {
log.log(LogService.LOG_INFO, "Unregister test packages " + packages);
-
- for (ServiceReference sref : srefs)
- {
- Connector connector = (Connector)context.getService(sref);
- for (PackageListener listener : new ArrayList<PackageListener>(connector.getPackageListeners()))
+ for (ServiceReference sref : srefs)
{
- List<String> auxNames = listener.getPackageNames();
- if (auxNames.equals(packages))
- connector.removePackageListener(listener);
+ Connector connector = (Connector)context.getService(sref);
+ for (PackageListener listener : new ArrayList<PackageListener>(connector.getPackageListeners()))
+ {
+ List<String> auxNames = listener.getPackageNames();
+ if (auxNames.equals(packages))
+ connector.removePackageListener(listener);
+ }
}
}
}
16 years, 5 months
JBoss-OSGI SVN: r91202 - in projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky: runtime and 2 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-14 07:34:29 -0400 (Tue, 14 Jul 2009)
New Revision: 91202
Modified:
projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractConnector.java
projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractPackageListener.java
projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/internal/LocalInvocation.java
projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/Connector.java
projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/PackageListener.java
projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/junit/JUnitPackageListener.java
projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/HuskyExtender.java
projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/OSGiJUnitPackageListener.java
Log:
Unregister test packages
Modified: projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractConnector.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractConnector.java 2009-07-14 10:54:29 UTC (rev 91201)
+++ projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractConnector.java 2009-07-14 11:34:29 UTC (rev 91202)
@@ -24,6 +24,7 @@
// $Id$
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import org.jboss.osgi.husky.Request;
@@ -46,6 +47,11 @@
listeners.add(listener);
}
+ public List<PackageListener> getPackageListeners()
+ {
+ return Collections.unmodifiableList(listeners);
+ }
+
public void removePackageListener(PackageListener listener)
{
listeners.remove(listener);
Modified: projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractPackageListener.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractPackageListener.java 2009-07-14 10:54:29 UTC (rev 91201)
+++ projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractPackageListener.java 2009-07-14 11:34:29 UTC (rev 91202)
@@ -23,7 +23,8 @@
// $Id$
-import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
import org.jboss.osgi.husky.Context;
import org.jboss.osgi.husky.Request;
@@ -39,17 +40,22 @@
*/
public abstract class AbstractPackageListener implements PackageListener
{
- private String[] testPackages;
+ private List<String> testPackages;
- public AbstractPackageListener(String[] testPackages)
+ public AbstractPackageListener(List<String> packages)
{
- if (testPackages == null)
- throw new IllegalArgumentException("Invalid test package: " + testPackages);
+ if (packages == null)
+ throw new IllegalArgumentException("Invalid test package: " + packages);
- this.testPackages = testPackages;
+ this.testPackages = packages;
}
+ public List<String> getPackageNames()
+ {
+ return Collections.unmodifiableList(testPackages);
+ }
+
public boolean match(Request req)
{
String testClass = req.getClassName();
@@ -75,6 +81,6 @@
public String toString()
{
- return Arrays.asList(testPackages).toString();
+ return testPackages.toString();
}
}
Modified: projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/internal/LocalInvocation.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/internal/LocalInvocation.java 2009-07-14 10:54:29 UTC (rev 91201)
+++ projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/internal/LocalInvocation.java 2009-07-14 11:34:29 UTC (rev 91202)
@@ -23,6 +23,8 @@
// $Id$
+import java.util.Arrays;
+
import org.jboss.osgi.husky.Context;
import org.jboss.osgi.husky.Request;
import org.jboss.osgi.husky.Response;
@@ -53,7 +55,7 @@
{
public MatchAllJUnitPackageListener()
{
- super(new String[] { "org.jboss.test" });
+ super(Arrays.asList(new String[] { "org.jboss.test" }));
}
public Context getContext()
Modified: projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/Connector.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/Connector.java 2009-07-14 10:54:29 UTC (rev 91201)
+++ projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/Connector.java 2009-07-14 11:34:29 UTC (rev 91202)
@@ -21,6 +21,9 @@
*/
package org.jboss.osgi.husky.runtime;
+
+import java.util.List;
+
import org.jboss.osgi.husky.Request;
import org.jboss.osgi.husky.Response;
@@ -49,6 +52,11 @@
Response process(Request req) throws ClassNotFoundException;
/**
+ * Get the set of registered {@link PackageListener}s for this connector
+ */
+ List<PackageListener> getPackageListeners();
+
+ /**
* Add a {@link PackageListener} to this connector
*/
void addPackageListener(PackageListener listener);
Modified: projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/PackageListener.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/PackageListener.java 2009-07-14 10:54:29 UTC (rev 91201)
+++ projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/PackageListener.java 2009-07-14 11:34:29 UTC (rev 91202)
@@ -21,6 +21,8 @@
*/
package org.jboss.osgi.husky.runtime;
+import java.util.List;
+
import org.jboss.osgi.husky.Request;
import org.jboss.osgi.husky.Response;
@@ -39,6 +41,11 @@
public interface PackageListener
{
/**
+ * Return the list of packages that this listener can handle.
+ */
+ List<String> getPackageNames();
+
+ /**
* Return true if the given {@link Request} is from a package
* that this listener can handle.
*/
Modified: projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/junit/JUnitPackageListener.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/junit/JUnitPackageListener.java 2009-07-14 10:54:29 UTC (rev 91201)
+++ projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/junit/JUnitPackageListener.java 2009-07-14 11:34:29 UTC (rev 91202)
@@ -23,6 +23,8 @@
// $Id$
+import java.util.List;
+
import org.jboss.osgi.husky.Context;
import org.jboss.osgi.husky.internal.AbstractPackageListener;
import org.jboss.osgi.husky.internal.BasicContext;
@@ -37,9 +39,9 @@
*/
public class JUnitPackageListener extends AbstractPackageListener
{
- public JUnitPackageListener(String[] testPackages)
+ public JUnitPackageListener(List<String> packages)
{
- super(testPackages);
+ super(packages);
}
@Override
Modified: projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/HuskyExtender.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/HuskyExtender.java 2009-07-14 10:54:29 UTC (rev 91201)
+++ projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/HuskyExtender.java 2009-07-14 11:34:29 UTC (rev 91202)
@@ -23,8 +23,13 @@
// $Id$
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
import org.jboss.osgi.husky.internal.LogServiceTracker;
import org.jboss.osgi.husky.runtime.Connector;
+import org.jboss.osgi.husky.runtime.PackageListener;
import org.jboss.osgi.husky.runtime.junit.JUnitPackageListener;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
@@ -61,17 +66,20 @@
if (event.getType() == BundleEvent.STARTED)
{
Bundle bundle = event.getBundle();
- String testPackage = (String)bundle.getHeaders().get(HEADER_TEST_PACKAGE);
- if (testPackage != null)
- {
- log.log(LogService.LOG_INFO, "Test-Package [" + testPackage + "] in bundle: " + bundle);
- String[] packages = testPackage.split("[,\\s]");
+ List<String> packages = getTestPackages(bundle);
+ if (packages != null)
registerPackageListener(bundle, packages);
- }
}
+ else if (event.getType() == BundleEvent.STOPPED)
+ {
+ Bundle bundle = event.getBundle();
+ List<String> packages = getTestPackages(bundle);
+ if (packages != null)
+ unregisterPackageListener(bundle, packages);
+ }
}
- private void registerPackageListener(Bundle bundle, String[] testPackages)
+ private void registerPackageListener(Bundle bundle, List<String> packages)
{
ServiceReference[] srefs = null;
try
@@ -82,12 +90,51 @@
{
// cannot get here
}
-
+
+ if (srefs != null)
+ log.log(LogService.LOG_INFO, "Register test packages " + packages);
+
for (ServiceReference sref : srefs)
{
Connector connector = (Connector)context.getService(sref);
- JUnitPackageListener listener = new OSGiJUnitPackageListener(bundle, testPackages);
+ JUnitPackageListener listener = new OSGiJUnitPackageListener(bundle, packages);
connector.addPackageListener(listener);
}
}
+
+ private void unregisterPackageListener(Bundle bundle, List<String> packages)
+ {
+ ServiceReference[] srefs = null;
+ try
+ {
+ srefs = context.getServiceReferences(Connector.class.getName(), null);
+ }
+ catch (InvalidSyntaxException ex)
+ {
+ // cannot get here
+ }
+
+ if (srefs != null)
+ log.log(LogService.LOG_INFO, "Unregister test packages " + packages);
+
+ for (ServiceReference sref : srefs)
+ {
+ Connector connector = (Connector)context.getService(sref);
+ for (PackageListener listener : new ArrayList<PackageListener>(connector.getPackageListeners()))
+ {
+ List<String> auxNames = listener.getPackageNames();
+ if (auxNames.equals(packages))
+ connector.removePackageListener(listener);
+ }
+ }
+ }
+
+ private List<String> getTestPackages(Bundle bundle)
+ {
+ String testPackage = (String)bundle.getHeaders().get(HEADER_TEST_PACKAGE);
+ if (testPackage != null)
+ return Arrays.asList(testPackage.split("[,\\s]"));
+
+ return null;
+ }
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/OSGiJUnitPackageListener.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/OSGiJUnitPackageListener.java 2009-07-14 10:54:29 UTC (rev 91201)
+++ projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/OSGiJUnitPackageListener.java 2009-07-14 11:34:29 UTC (rev 91202)
@@ -23,6 +23,8 @@
// $Id$
+import java.util.List;
+
import org.jboss.osgi.husky.Context;
import org.jboss.osgi.husky.internal.BasicContext;
import org.jboss.osgi.husky.runtime.Runner;
@@ -41,9 +43,9 @@
{
private Bundle bundle;
- public OSGiJUnitPackageListener(Bundle bundle, String[] testPackages)
+ public OSGiJUnitPackageListener(Bundle bundle, List<String> packages)
{
- super(testPackages);
+ super(packages);
this.bundle = bundle;
}
16 years, 5 months
JBoss-OSGI SVN: r91201 - in projects/jboss-osgi/trunk: reactor/bundles/jboss-common-core and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-14 06:54:29 -0400 (Tue, 14 Jul 2009)
New Revision: 91201
Modified:
projects/jboss-osgi/trunk/pom.xml
projects/jboss-osgi/trunk/reactor/bundles/jboss-common-core/pom.xml
Log:
Reorder reactor build
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-07-14 10:45:06 UTC (rev 91200)
+++ projects/jboss-osgi/trunk/pom.xml 2009-07-14 10:54:29 UTC (rev 91201)
@@ -289,24 +289,24 @@
<id>reactor</id>
<modules>
<module>reactor/spi</module>
+ <module>reactor/runtime/equinox</module>
+ <module>reactor/runtime/felix</module>
+ <module>reactor/runtime/knopflerfish</module>
+ <module>reactor/runtime/deployers</module>
+ <module>reactor/bundles/common</module>
+ <module>reactor/bundles/jboss-common-core</module>
<module>reactor/bundles/apache-xerces</module>
- <module>reactor/bundles/blueprint</module>
- <module>reactor/bundles/common</module>
- <module>reactor/bundles/hotdeploy</module>
- <module>reactor/bundles/husky</module>
<module>reactor/bundles/jaxb</module>
- <module>reactor/bundles/jboss-common-core</module>
<module>reactor/bundles/jboss-xml-binding</module>
<module>reactor/bundles/jmx</module>
<module>reactor/bundles/jndi</module>
- <module>reactor/bundles/microcontainer</module>
<module>reactor/bundles/remotelog</module>
<module>reactor/bundles/webconsole</module>
- <module>reactor/runtime/equinox</module>
- <module>reactor/runtime/deployers</module>
- <module>reactor/runtime/felix</module>
+ <module>reactor/bundles/hotdeploy</module>
+ <module>reactor/bundles/microcontainer</module>
+ <module>reactor/bundles/husky</module>
+ <module>reactor/bundles/blueprint</module>
<module>reactor/runtime/jbossas</module>
- <module>reactor/runtime/knopflerfish</module>
<module>testsuite</module>
</modules>
</profile>
Modified: projects/jboss-osgi/trunk/reactor/bundles/jboss-common-core/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/jboss-common-core/pom.xml 2009-07-14 10:45:06 UTC (rev 91200)
+++ projects/jboss-osgi/trunk/reactor/bundles/jboss-common-core/pom.xml 2009-07-14 10:54:29 UTC (rev 91201)
@@ -14,7 +14,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" 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">
<modelVersion>4.0.0</modelVersion>
- <name>JBossOSGi Bundles - JBoss Common Core</name>
+ <name>JBossOSGi Bundles - Common Core</name>
<description>A JBossOSGi provided JBoss Common Core bundle</description>
<groupId>org.jboss.osgi.bundles</groupId>
16 years, 5 months
JBoss-OSGI SVN: r91200 - projects/jboss-osgi/trunk/hudson/hudson-home.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-14 06:45:06 -0400 (Tue, 14 Jul 2009)
New Revision: 91200
Modified:
projects/jboss-osgi/trunk/hudson/hudson-home/config.xml
Log:
Update userguide locations
Modified: projects/jboss-osgi/trunk/hudson/hudson-home/config.xml
===================================================================
--- projects/jboss-osgi/trunk/hudson/hudson-home/config.xml 2009-07-14 10:41:00 UTC (rev 91199)
+++ projects/jboss-osgi/trunk/hudson/hudson-home/config.xml 2009-07-14 10:45:06 UTC (rev 91200)
@@ -9,9 +9,9 @@
<table>
<tr align="left"><th>Bind Addr</th><td>@jboss.bind.address@</td></tr>
<tr align="left"><th>Userguide</th><td>
-<a href='job/jbossosgi-jdk16/ws/jboss-osgi/distribution/target/auto-install-dest/docs/userguide/pdf/JBossOSGi - Userguide.pdf'>PDF</a>
-<a href='job/jbossosgi-jdk16/ws/jboss-osgi/distribution/target/auto-install-dest/docs/userguide/html/index.html'>HTML</a>
-<a href='job/jbossosgi-jdk16/ws/jboss-osgi/distribution/target/auto-install-dest/docs/userguide/html_single/index.html'>HTML-Single</a>
+<a href='job/jbossosgi-jdk16/ws/jboss-osgi/distribution/installer/target/auto-install-dest/docs/userguide/pdf/JBossOSGi - Userguide.pdf'>PDF</a>
+<a href='job/jbossosgi-jdk16/ws/jboss-osgi/distribution/installer/target/auto-install-dest/docs/userguide/html/index.html'>HTML</a>
+<a href='job/jbossosgi-jdk16/ws/jboss-osgi/distribution/installer/target/auto-install-dest/docs/userguide/html_single/index.html'>HTML-Single</a>
</td></tr>
</table>
]]>
16 years, 5 months
JBoss-OSGI SVN: r91199 - in projects/jboss-osgi/trunk: reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky and 2 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-14 06:41:00 -0400 (Tue, 14 Jul 2009)
New Revision: 91199
Added:
projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/internal/BasicFailure.java
Modified:
projects/jboss-osgi/trunk/distribution/installer/
projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/Request.java
projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractConnector.java
projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractPackageListener.java
projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/internal/BasicRequest.java
projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/JMXConnectorMBean.java
projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/SocketConnector.java
Log:
Relay husky socket exceptions back to client
Property changes on: projects/jboss-osgi/trunk/distribution/installer
___________________________________________________________________
Name: svn:ignore
+ target
Modified: projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/Request.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/Request.java 2009-07-14 10:05:14 UTC (rev 91198)
+++ projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/Request.java 2009-07-14 10:41:00 UTC (rev 91199)
@@ -36,10 +36,10 @@
/**
* Get the test case name
*/
- String getTestClass();
+ String getClassName();
/**
* Get the test method name
*/
- String getTestMethod();
+ String getMethodName();
}
Modified: projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractConnector.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractConnector.java 2009-07-14 10:05:14 UTC (rev 91198)
+++ projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractConnector.java 2009-07-14 10:41:00 UTC (rev 91199)
@@ -23,11 +23,6 @@
// $Id$
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
import java.util.ArrayList;
import java.util.List;
@@ -58,7 +53,7 @@
public Response process(Request req) throws ClassNotFoundException
{
- String testClass = req.getTestClass();
+ String testClass = req.getClassName();
for (PackageListener listener : listeners)
{
if (listener.match(req))
@@ -68,35 +63,4 @@
}
throw new IllegalStateException("Cannot find listener to handle: " + testClass + ", we have " + listeners);
}
-
- public InputStream process(InputStream reqStream)
- {
- try
- {
- // Unmarshall the Request
- ObjectInputStream ois = new ObjectInputStream(reqStream);
- Request request = (Request)ois.readObject();
-
- // Field the request through the abstract connector
- Response response = process(request);
- if (response == null)
- throw new IllegalStateException("response cannot be null");
-
- // Marshall the Response
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- ObjectOutputStream oos = new ObjectOutputStream(baos);
- oos.writeObject(response);
- oos.close();
-
- return new ByteArrayInputStream(baos.toByteArray());
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new IllegalStateException("Cannot process request", ex);
- }
- }
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractPackageListener.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractPackageListener.java 2009-07-14 10:05:14 UTC (rev 91198)
+++ projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractPackageListener.java 2009-07-14 10:41:00 UTC (rev 91199)
@@ -52,7 +52,7 @@
public boolean match(Request req)
{
- String testClass = req.getTestClass();
+ String testClass = req.getClassName();
for (String testPackage : testPackages)
{
if (testClass.startsWith(testPackage))
@@ -63,7 +63,7 @@
public Response runTests(Request request) throws ClassNotFoundException
{
- String testClass = request.getTestClass();
+ String testClass = request.getClassName();
return getRunner().runTests(getContext(), loadTestClass(testClass));
}
Added: projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/internal/BasicFailure.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/internal/BasicFailure.java (rev 0)
+++ projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/internal/BasicFailure.java 2009-07-14 10:41:00 UTC (rev 91199)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.husky.internal;
+
+// $Id: BasicResponse.java 91197 2009-07-14 09:48:24Z thomas.diesler(a)jboss.com $
+
+import org.jboss.osgi.husky.Failure;
+
+/**
+ * A basic {@link Failure} implementation.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 16-May-2009
+ */
+public class BasicFailure implements Failure
+{
+ private static final long serialVersionUID = 1L;
+
+ private String message;
+ private Throwable exception;
+ private String className;
+ private String methodName;
+
+ public BasicFailure(String message, Throwable exception)
+ {
+ this.message = message;
+ this.exception = exception;
+ }
+
+ public Throwable getException()
+ {
+ return exception;
+ }
+
+ public String getMessage()
+ {
+ return message;
+ }
+
+ public String getClassName()
+ {
+ return className;
+ }
+
+ public void setClassName(String className)
+ {
+ this.className = className;
+ }
+
+ public String getMethodName()
+ {
+ return methodName;
+ }
+
+ public void setMethodName(String methodName)
+ {
+ this.methodName = methodName;
+ }
+}
Modified: projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/internal/BasicRequest.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/internal/BasicRequest.java 2009-07-14 10:05:14 UTC (rev 91198)
+++ projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/internal/BasicRequest.java 2009-07-14 10:41:00 UTC (rev 91199)
@@ -35,23 +35,23 @@
{
private static final long serialVersionUID = 1L;
- private String testClass;
- private String testMethod;
+ private String className;
+ private String methodName;
- public BasicRequest(String testClass, String testMethod)
+ public BasicRequest(String className, String methodName)
{
- this.testClass = testClass;
- this.testMethod = testMethod;
+ this.className = className;
+ this.methodName = methodName;
}
- public String getTestClass()
+ public String getClassName()
{
- return testClass;
+ return className;
}
- public String getTestMethod()
+ public String getMethodName()
{
- return testMethod;
+ return methodName;
}
}
Modified: projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/JMXConnectorMBean.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/JMXConnectorMBean.java 2009-07-14 10:05:14 UTC (rev 91198)
+++ projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/JMXConnectorMBean.java 2009-07-14 10:41:00 UTC (rev 91199)
@@ -23,8 +23,6 @@
//$Id$
-import java.io.InputStream;
-
import org.jboss.osgi.husky.runtime.PackageListener;
/**
@@ -36,13 +34,6 @@
public interface JMXConnectorMBean
{
/*
- * Consumes the serialized version of an {@link Request} and return the the {@link Response} from the test run
- * @param reqStream the input stream to read the {@link Request} from
- * @return the input stream to read the {@link Response} from
- */
- InputStream process(InputStream reqStream);
-
- /*
* Add a {@link PackageListener} to this connector
*/
void addPackageListener(PackageListener listener);
Modified: projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/SocketConnector.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/SocketConnector.java 2009-07-14 10:05:14 UTC (rev 91198)
+++ projects/jboss-osgi/trunk/reactor/bundles/husky/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/SocketConnector.java 2009-07-14 10:41:00 UTC (rev 91199)
@@ -23,14 +23,22 @@
// $Id$
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.Properties;
+import org.jboss.osgi.husky.Request;
+import org.jboss.osgi.husky.Response;
import org.jboss.osgi.husky.internal.AbstractConnector;
+import org.jboss.osgi.husky.internal.BasicFailure;
+import org.jboss.osgi.husky.internal.BasicResponse;
import org.jboss.osgi.husky.internal.LogServiceTracker;
import org.jboss.osgi.husky.internal.Util;
import org.jboss.osgi.husky.runtime.Connector;
@@ -110,6 +118,47 @@
listenerThread.stopListener();
}
+ private InputStream process(InputStream reqStream)
+ {
+ Request request = null;
+ Response response = null;
+ try
+ {
+ // Unmarshall the Request
+ ObjectInputStream ois = new ObjectInputStream(reqStream);
+ request = (Request)ois.readObject();
+
+ // Field the request through the abstract connector
+ response = process(request);
+ }
+ catch (Exception ex)
+ {
+ response = new BasicResponse();
+ BasicFailure failure = new BasicFailure(ex.getMessage(), ex);
+ if (request != null)
+ {
+ failure.setClassName(request.getClassName());
+ failure.setMethodName(request.getMethodName());
+ }
+ response.addFailure(failure);
+ }
+
+ // Marshall the Response
+ try
+ {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ObjectOutputStream oos = new ObjectOutputStream(baos);
+ oos.writeObject(response);
+ oos.close();
+
+ return new ByteArrayInputStream(baos.toByteArray());
+ }
+ catch (IOException ex)
+ {
+ throw new IllegalStateException("Cannot marshall response", ex);
+ }
+ }
+
class ListenerThread extends Thread
{
private ServerSocket serverSocket;
16 years, 5 months