[jboss-cvs] JBossAS SVN: r89041 - in projects/jboss-osgi/projects/husky/trunk/harness: src/main/java/org/jboss/osgi/husky and 4 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue May 19 08:28:25 EDT 2009
Author: thomas.diesler at jboss.com
Date: 2009-05-19 08:28:25 -0400 (Tue, 19 May 2009)
New Revision: 89041
Added:
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Bridge.java
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/BridgeFactory.java
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Context.java
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Failure.java
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Invoker.java
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Request.java
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Response.java
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/BasicBridge.java
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/Connector.java
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/PackageListener.java
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/Runner.java
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/junit/
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/junit/JUnitFailure.java
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/junit/JUnitPackageListener.java
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/junit/JUnitResponse.java
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/junit/JUnitRunner.java
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/junit/package.html
Removed:
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/BasicBridge.java
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Bridge.java
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/BridgeFactory.java
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Connector.java
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Context.java
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Failure.java
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Invoker.java
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/PackageListener.java
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Request.java
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Response.java
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Runner.java
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/JUnitFailure.java
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/JUnitResponse.java
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/junit/
Modified:
projects/jboss-osgi/projects/husky/trunk/harness/pom.xml
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/annotation/ProvideContext.java
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractConnector.java
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractPackageListener.java
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/Extender.java
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/JMXConnectorMBean.java
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/LocalInvoker.java
Log:
API restructure
Modified: projects/jboss-osgi/projects/husky/trunk/harness/pom.xml
===================================================================
--- projects/jboss-osgi/projects/husky/trunk/harness/pom.xml 2009-05-19 11:48:57 UTC (rev 89040)
+++ projects/jboss-osgi/projects/husky/trunk/harness/pom.xml 2009-05-19 12:28:25 UTC (rev 89041)
@@ -69,7 +69,7 @@
<Bundle-Activator>org.jboss.osgi.husky.internal.Activator</Bundle-Activator>
<Private-Package>
org.jboss.osgi.husky.internal,
- org.jboss.osgi.husky.junit
+ org.jboss.osgi.husky.runtime*,
</Private-Package>
<Export-Package>
org.jboss.osgi.husky;version=${version},
Deleted: projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/BasicBridge.java
===================================================================
--- projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/BasicBridge.java 2009-05-19 11:48:57 UTC (rev 89040)
+++ projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/BasicBridge.java 2009-05-19 12:28:25 UTC (rev 89041)
@@ -1,88 +0,0 @@
-/*
- * 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;
-
-// $Id$
-
-import java.util.Properties;
-
-import org.jboss.osgi.husky.internal.AbstractBridge;
-import org.jboss.osgi.husky.internal.Util;
-
-/**
- * A basic {@link Bridge} implementation that can be associated
- * with an arbitrary {@link Invoker}.
- *
- * @author Thomas.Diesler at jboss.com
- * @since 16-May-2009
- */
-public class BasicBridge extends AbstractBridge
-{
- private Properties props;
- private Invoker invoker;
-
- /**
- * Construct a basic {@link Bridge} with the given properties.
- *
- * The properties would typically contain the name of the
- * associated invoker under the key of {@link Invoker}.
- */
- public BasicBridge(Properties props)
- {
- this.props = props;
- }
-
- /**
- * Get the invoker associated with this {@link Bridge}.
- *
- * If the invoker was not explicitly set, this method will load the
- * invoker from the class name given by the {@link Invoker} property.
- *
- * If still not found it will load the invoker from the class name
- * given by the {@link Invoker} system property.
- *
- * @throws RuntimeException if the {@link Invoker} cannot be loaded.
- */
- public Invoker getInvoker()
- {
- if (invoker == null)
- {
- String className = props.getProperty(Invoker.class.getName());
- if (className == null)
- className = System.getProperty(Invoker.class.getName());
-
- if (className == null)
- throw new IllegalStateException("Cannot load invoker: " + className);
-
- invoker = (Invoker)Util.loadInstance(className, props);
- }
- return invoker;
- }
-
- /**
- * Set the associated invoker
- */
- public void setInvoker(Invoker invoker)
- {
- this.invoker = invoker;
- }
-}
Deleted: projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Bridge.java
===================================================================
--- projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Bridge.java 2009-05-19 11:48:57 UTC (rev 89040)
+++ projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Bridge.java 2009-05-19 12:28:25 UTC (rev 89041)
@@ -1,105 +0,0 @@
-/*
- * 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;
-
-// $Id$
-
-/**
- * A Bridge intercepts a test and delegates the execution
- * to the same (or another) test in and isolated test environment.
- *
- * An isolated test environment is one that does not have the same
- * class loading space as the test itself. Isolated test environments
- * are for example
- *
- * <ul>
- * <li>Remote container environment</li>
- * <li>Embedded OSGi Framework</li>
- * </ul>
- *
- * Details on test method mapping is given with the individual
- * run methods.
- *
- * The test {@link Request} is fieled through an {@link Invoker}
- * that that returns a {@link Response} for the given test run.
- *
- * Invokers may be arbitarily complex. Local 'in proccess' invokers are
- * possible just as well as remote invokers.
- *
- * <pre>
- * void testMethod
- * {
- * if(isNotInContainer())
- * {
- * BridgeFactory.getBridge().run();
- * return;
- * }
- * else
- * {
- * // in container test logic
- * ...
- * }
- * }
- * </pre>
- *
- * @author Thomas.Diesler at jboss.com
- * @since 16-May-2009
- */
-public interface Bridge
-{
- /**
- * Intercepts a test and delegates the execution to the
- * same test in the same test class.
- *
- * The main use case is that of the same test class beeing deployed
- * in the isolated test environment as well as run from the client test runner.
- */
- void run();
-
- /**
- * Intercepts a test and delegates the execution to the
- * same test in a different test class.
- *
- * The main use case is that of one client side test class with the same
- * set of test methods as another test class that runs in the isolated test environment.
- */
- void run(Class<?> testClass);
-
- /**
- * Intercepts a test and delegates the execution to another test
- * in a different test class.
- *
- * The main use case is that of free mapping between client side tests and tests
- * that run in the isolated test environment.
- */
- void run(Class<?> testClass, String testMethod);
-
- /**
- * Get the invoker that is associated with this bridge.
- */
- Invoker getInvoker();
-
- /**
- * Set the invoker that is associated with this bridge.
- */
- void setInvoker(Invoker invoker);
-}
Copied: projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Bridge.java (from rev 88983, projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Bridge.java)
===================================================================
--- projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Bridge.java (rev 0)
+++ projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Bridge.java 2009-05-19 12:28:25 UTC (rev 89041)
@@ -0,0 +1,106 @@
+/*
+ * 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;
+
+
+// $Id$
+
+/**
+ * A Bridge intercepts a test and delegates the execution
+ * to the same (or another) test in and isolated test environment.
+ *
+ * An isolated test environment is one that does not have the same
+ * class loading space as the test itself. Isolated test environments
+ * are for example
+ *
+ * <ul>
+ * <li>Remote container environment</li>
+ * <li>Embedded OSGi Framework</li>
+ * </ul>
+ *
+ * Details on test method mapping is given with the individual
+ * run methods.
+ *
+ * The test {@link Request} is fieled through an {@link Invoker}
+ * that that returns a {@link Response} for the given test run.
+ *
+ * Invokers may be arbitarily complex. Local 'in proccess' invokers are
+ * possible just as well as remote invokers.
+ *
+ * <pre>
+ * void testMethod
+ * {
+ * if(isNotInContainer())
+ * {
+ * BridgeFactory.getBridge().run();
+ * return;
+ * }
+ * else
+ * {
+ * // in container test logic
+ * ...
+ * }
+ * }
+ * </pre>
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @since 16-May-2009
+ */
+public interface Bridge
+{
+ /**
+ * Intercepts a test and delegates the execution to the
+ * same test in the same test class.
+ *
+ * The main use case is that of the same test class beeing deployed
+ * in the isolated test environment as well as run from the client test runner.
+ */
+ void run();
+
+ /**
+ * Intercepts a test and delegates the execution to the
+ * same test in a different test class.
+ *
+ * The main use case is that of one client side test class with the same
+ * set of test methods as another test class that runs in the isolated test environment.
+ */
+ void run(Class<?> testClass);
+
+ /**
+ * Intercepts a test and delegates the execution to another test
+ * in a different test class.
+ *
+ * The main use case is that of free mapping between client side tests and tests
+ * that run in the isolated test environment.
+ */
+ void run(Class<?> testClass, String testMethod);
+
+ /**
+ * Get the invoker that is associated with this bridge.
+ */
+ Invoker getInvoker();
+
+ /**
+ * Set the invoker that is associated with this bridge.
+ */
+ void setInvoker(Invoker invoker);
+}
Deleted: projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/BridgeFactory.java
===================================================================
--- projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/BridgeFactory.java 2009-05-19 11:48:57 UTC (rev 89040)
+++ projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/BridgeFactory.java 2009-05-19 12:28:25 UTC (rev 89041)
@@ -1,65 +0,0 @@
-/*
- * 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;
-
-// $Id$
-
-import java.util.Properties;
-
-import org.jboss.osgi.husky.internal.Util;
-
-/**
- * Loads the configured test {@link Bridge} instance.
- *
- * @author Thomas.Diesler at jboss.com
- * @since 16-May-2009
- */
-public abstract class BridgeFactory
-{
- /**
- * Loads the bridge class that is configed through the system property {@link Bridge}.
- * If there is no such property, it returns an instance of {@link BasicBridge}.
- */
- public static Bridge getBridge()
- {
- Properties props = System.getProperties();
- String className = props.getProperty(Bridge.class.getName());
- return (className != null ? getBridge(props) : new BasicBridge(props));
- }
-
- /**
- * Loads the bridge class that is configed through the property {@link Bridge}.
- *
- * If the loaded bridge has a constructor that takes a {@link Properties} parameter,
- * that constructor is used. Otherwise the bridge will be instanciated with the default constructor
- *
- * @param props bridge properties
- */
- public static Bridge getBridge(Properties props)
- {
- String className = props.getProperty(Bridge.class.getName());
- if (className == null)
- throw new IllegalStateException("Cannot find property: " + Bridge.class.getName());
-
- return (Bridge)Util.loadInstance(className, props);
- }
-}
Copied: projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/BridgeFactory.java (from rev 89009, projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/BridgeFactory.java)
===================================================================
--- projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/BridgeFactory.java (rev 0)
+++ projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/BridgeFactory.java 2009-05-19 12:28:25 UTC (rev 89041)
@@ -0,0 +1,66 @@
+/*
+ * 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;
+
+// $Id$
+
+import java.util.Properties;
+
+import org.jboss.osgi.husky.internal.BasicBridge;
+import org.jboss.osgi.husky.internal.Util;
+
+/**
+ * Loads the configured test {@link Bridge} instance.
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @since 16-May-2009
+ */
+public abstract class BridgeFactory
+{
+ /**
+ * Loads the bridge class that is configed through the system property {@link Bridge}.
+ * If there is no such property, it returns an instance of {@link BasicBridge}.
+ */
+ public static Bridge getBridge()
+ {
+ Properties props = System.getProperties();
+ String className = props.getProperty(Bridge.class.getName());
+ return (className != null ? getBridge(props) : new BasicBridge(props));
+ }
+
+ /**
+ * Loads the bridge class that is configed through the property {@link Bridge}.
+ *
+ * If the loaded bridge has a constructor that takes a {@link Properties} parameter,
+ * that constructor is used. Otherwise the bridge will be instanciated with the default constructor
+ *
+ * @param props bridge properties
+ */
+ public static Bridge getBridge(Properties props)
+ {
+ String className = props.getProperty(Bridge.class.getName());
+ if (className == null)
+ throw new IllegalStateException("Cannot find property: " + Bridge.class.getName());
+
+ return (Bridge)Util.loadInstance(className, props);
+ }
+}
Deleted: projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Connector.java
===================================================================
--- projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Connector.java 2009-05-19 11:48:57 UTC (rev 89040)
+++ projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Connector.java 2009-05-19 12:28:25 UTC (rev 89041)
@@ -1,57 +0,0 @@
-/*
- * 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;
-
-// $Id$
-
-/**
- * A Connector is the receiving side of a test request.
- *
- * It processes the test request by dispatching it to one of
- * the associated {@link PackageListener}s.
- *
- * It is an error if no {@link PackageListener} can handle the
- * incomming test request.
- *
- * @author Thomas.Diesler at jboss.com
- * @since 16-May-2009
- */
-public interface Connector
-{
- /**
- * Handles the test request by dispatching to one of the
- * associated {@link PackageListener}s.
- *
- * @throws RuntimeException if no {@link PackageListener} can
- */
- Response process(Request req) throws ClassNotFoundException;
-
- /**
- * Add a {@link PackageListener} to this connector
- */
- void addPackageListener(PackageListener listener);
-
- /**
- * Remove a {@link PackageListener} from this connector
- */
- void removePackageListener(PackageListener listener);
-}
Deleted: projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Context.java
===================================================================
--- projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Context.java 2009-05-19 11:48:57 UTC (rev 89040)
+++ projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Context.java 2009-05-19 12:28:25 UTC (rev 89041)
@@ -1,160 +0,0 @@
-/*
- * 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;
-
-// $Id$
-
-import java.util.Collection;
-
-/**
- * The Context is a bucket of typed/named attachemnts.
- *
- * @author Thomas.Diesler at jboss.com
- * @since 20-Apr-2007
- */
-public interface Context
-{
- /** Get attachment keys */
- Collection<Key> getAttachmentKeys();
-
- /** Add arbitrary attachment */
- <T> T addAttachment(Class<T> clazz, Object value);
-
- /** Add arbitrary attachment with name */
- <T> T addAttachment(Class<T> clazz, String name, Object value);
-
- /** Add arbitrary attachment with name */
- Object addAttachment(String name, Object value);
-
- /** Get an arbitrary attachment */
- <T> T getAttachment(Class<T> clazz);
-
- /** Get an arbitrary attachment */
- <T> T getAttachment(Class<T> clazz, String name);
-
- /** Get an arbitrary attachment */
- Object getAttachment(String name);
-
- /** Remove arbitrary attachments */
- <T> T removeAttachment(Class<T> clazz);
-
- /** Remove arbitrary attachments */
- <T> T removeAttachment(Class<T> clazz, String name);
-
- /** Remove arbitrary attachments */
- Object removeAttachment(String name);
-
- /**
- * A key for attachements
- */
- static class Key
- {
- private Class<?> clazz;
- private String name;
-
- /**
- * Construct the key with optional class and name
- */
- public Key(Class<?> clazz, String name)
- {
- this.clazz = clazz;
- this.name = name;
- }
-
- public static Key valueOf(String key)
- {
- int index = key.indexOf(",");
- if (key.startsWith("[") && key.endsWith("]") && index > 0)
- {
- Class<?> classPart = null;
- String className = key.substring(1, index);
- String namePart = key.substring(index + 1, key.length() - 1);
- if (className.length() > 0 && !className.equals("null"))
- {
- try
- {
- classPart = Class.forName(className);
- }
- catch (ClassNotFoundException ex)
- {
- throw new IllegalArgumentException("Cannot find class '" + className + "' in: " + key);
- }
- }
- return new Key(classPart, namePart);
- }
- return null;
- }
-
- /**
- * Get the class part for this key
- *
- * @return maybe null
- */
- public Class<?> getClassPart()
- {
- return clazz;
- }
-
- /**
- * Get the name part for this key
- *
- * @return maybe null
- */
- public String getNamePart()
- {
- return name;
- }
-
- /**
- * Two keys are equal if their {@link #toString()} is equal
- */
- public boolean equals(Object obj)
- {
- if (!(obj instanceof Key))
- return false;
- if (obj == this)
- return true;
- return obj.toString().equals(toString());
- }
-
- /**
- * Two keys have the same hashCode if their {@link #toString()} is equal
- */
- public int hashCode()
- {
- return toString().hashCode();
- }
-
- /**
- * Returns the String repesentation of this Key.
- * <p/>
- *
- * <pre>
- * "[" + clazz + "," + name + "]"
- * </pre>
- */
- public String toString()
- {
- return "[" + clazz + "," + name + "]";
- }
- }
-}
\ No newline at end of file
Copied: projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Context.java (from rev 88983, projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Context.java)
===================================================================
--- projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Context.java (rev 0)
+++ projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Context.java 2009-05-19 12:28:25 UTC (rev 89041)
@@ -0,0 +1,160 @@
+/*
+ * 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;
+
+// $Id$
+
+import java.util.Collection;
+
+/**
+ * The Context is a bucket of typed/named attachemnts.
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @since 20-Apr-2007
+ */
+public interface Context
+{
+ /** Get attachment keys */
+ Collection<Key> getAttachmentKeys();
+
+ /** Add arbitrary attachment */
+ <T> T addAttachment(Class<T> clazz, Object value);
+
+ /** Add arbitrary attachment with name */
+ <T> T addAttachment(Class<T> clazz, String name, Object value);
+
+ /** Add arbitrary attachment with name */
+ Object addAttachment(String name, Object value);
+
+ /** Get an arbitrary attachment */
+ <T> T getAttachment(Class<T> clazz);
+
+ /** Get an arbitrary attachment */
+ <T> T getAttachment(Class<T> clazz, String name);
+
+ /** Get an arbitrary attachment */
+ Object getAttachment(String name);
+
+ /** Remove arbitrary attachments */
+ <T> T removeAttachment(Class<T> clazz);
+
+ /** Remove arbitrary attachments */
+ <T> T removeAttachment(Class<T> clazz, String name);
+
+ /** Remove arbitrary attachments */
+ Object removeAttachment(String name);
+
+ /**
+ * A key for attachements
+ */
+ static class Key
+ {
+ private Class<?> clazz;
+ private String name;
+
+ /**
+ * Construct the key with optional class and name
+ */
+ public Key(Class<?> clazz, String name)
+ {
+ this.clazz = clazz;
+ this.name = name;
+ }
+
+ public static Key valueOf(String key)
+ {
+ int index = key.indexOf(",");
+ if (key.startsWith("[") && key.endsWith("]") && index > 0)
+ {
+ Class<?> classPart = null;
+ String className = key.substring(1, index);
+ String namePart = key.substring(index + 1, key.length() - 1);
+ if (className.length() > 0 && !className.equals("null"))
+ {
+ try
+ {
+ classPart = Class.forName(className);
+ }
+ catch (ClassNotFoundException ex)
+ {
+ throw new IllegalArgumentException("Cannot find class '" + className + "' in: " + key);
+ }
+ }
+ return new Key(classPart, namePart);
+ }
+ return null;
+ }
+
+ /**
+ * Get the class part for this key
+ *
+ * @return maybe null
+ */
+ public Class<?> getClassPart()
+ {
+ return clazz;
+ }
+
+ /**
+ * Get the name part for this key
+ *
+ * @return maybe null
+ */
+ public String getNamePart()
+ {
+ return name;
+ }
+
+ /**
+ * Two keys are equal if their {@link #toString()} is equal
+ */
+ public boolean equals(Object obj)
+ {
+ if (!(obj instanceof Key))
+ return false;
+ if (obj == this)
+ return true;
+ return obj.toString().equals(toString());
+ }
+
+ /**
+ * Two keys have the same hashCode if their {@link #toString()} is equal
+ */
+ public int hashCode()
+ {
+ return toString().hashCode();
+ }
+
+ /**
+ * Returns the String repesentation of this Key.
+ * <p/>
+ *
+ * <pre>
+ * "[" + clazz + "," + name + "]"
+ * </pre>
+ */
+ public String toString()
+ {
+ return "[" + clazz + "," + name + "]";
+ }
+ }
+}
\ No newline at end of file
Deleted: projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Failure.java
===================================================================
--- projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Failure.java 2009-05-19 11:48:57 UTC (rev 89040)
+++ projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Failure.java 2009-05-19 12:28:25 UTC (rev 89041)
@@ -1,57 +0,0 @@
-/*
- * 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;
-
-// $Id$
-
-import java.io.Serializable;
-
-/**
- * An abstraction of a test failure that is associated with a test {@link Response}.
- *
- * @author Thomas.Diesler at jboss.com
- * @since 16-May-2009
- */
-public interface Failure extends Serializable
-{
- /**
- * Get the name of the test class that failed
- */
- String getClassName();
-
- /**
- * Get the name of the test method that failed
- */
- String getMethodName();
-
- /**
- * Get the test failure message
- */
- String getMessage();
-
- /**
- * Get the exceoption that caused the failure.
- * In case of a failure due to an assertion, this will be
- * RuntimeException or Error thrown by the test framework.
- */
- Throwable getException();
-}
\ No newline at end of file
Copied: projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Failure.java (from rev 88983, projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Failure.java)
===================================================================
--- projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Failure.java (rev 0)
+++ projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Failure.java 2009-05-19 12:28:25 UTC (rev 89041)
@@ -0,0 +1,59 @@
+/*
+ * 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;
+
+// $Id$
+
+import java.io.Serializable;
+
+
+
+/**
+ * An abstraction of a test failure that is associated with a test {@link Response}.
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @since 16-May-2009
+ */
+public interface Failure extends Serializable
+{
+ /**
+ * Get the name of the test class that failed
+ */
+ String getClassName();
+
+ /**
+ * Get the name of the test method that failed
+ */
+ String getMethodName();
+
+ /**
+ * Get the test failure message
+ */
+ String getMessage();
+
+ /**
+ * Get the exceoption that caused the failure.
+ * In case of a failure due to an assertion, this will be
+ * RuntimeException or Error thrown by the test framework.
+ */
+ Throwable getException();
+}
\ No newline at end of file
Deleted: projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Invoker.java
===================================================================
--- projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Invoker.java 2009-05-19 11:48:57 UTC (rev 89040)
+++ projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Invoker.java 2009-05-19 12:28:25 UTC (rev 89041)
@@ -1,39 +0,0 @@
-/*
- * 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;
-
-// $Id$
-
-/**
- * An Invoker is the sending side of a test request.
- *
- * @author Thomas.Diesler at jboss.com
- * @since 16-May-2009
- */
-public interface Invoker
-{
- /**
- * Invokes the associated {@link Connector} with a given test
- * {@link Request}
- */
- Response invoke(Request req);
-}
Copied: projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Invoker.java (from rev 88983, projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Invoker.java)
===================================================================
--- projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Invoker.java (rev 0)
+++ projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Invoker.java 2009-05-19 12:28:25 UTC (rev 89041)
@@ -0,0 +1,41 @@
+/*
+ * 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;
+
+import org.jboss.osgi.husky.runtime.Connector;
+
+// $Id$
+
+/**
+ * An Invoker is the sending side of a test request.
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @since 16-May-2009
+ */
+public interface Invoker
+{
+ /**
+ * Invokes the associated {@link Connector} with a given test
+ * {@link Request}
+ */
+ Response invoke(Request req);
+}
Deleted: projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/PackageListener.java
===================================================================
--- projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/PackageListener.java 2009-05-19 11:48:57 UTC (rev 89040)
+++ projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/PackageListener.java 2009-05-19 12:28:25 UTC (rev 89041)
@@ -1,50 +0,0 @@
-/*
- * 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;
-
-// $Id$
-
-/**
- * A PackageListener that is associated with a {@link Connector}.
- *
- * The PackageListener matches test {@link Request}s with the package names
- * that it can handle. On a successful match the {@link Connector} will invoke
- * the {@link #runTests(Request)} method.
- *
- * @author Thomas.Diesler at jboss.com
- * @since 16-May-2009
- */
-public interface PackageListener
-{
- /**
- * Return true if the given {@link Request} is from a package
- * that this listener can handle.
- */
- boolean match(Request request);
-
- /**
- * Called by {@link Connector} when this listener indicated that it can
- * handle the test request.
- */
- Response runTests(Request request) throws ClassNotFoundException;
-
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Request.java
===================================================================
--- projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Request.java 2009-05-19 11:48:57 UTC (rev 89040)
+++ projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Request.java 2009-05-19 12:28:25 UTC (rev 89041)
@@ -1,45 +0,0 @@
-/*
- * 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;
-
-//$Id$
-
-import java.io.Serializable;
-
-/**
- * An abstraction of a test request.
- *
- * @author Thomas.Diesler at jboss.com
- * @since 16-May-2009
- */
-public interface Request extends Serializable
-{
- /**
- * Get the test case name
- */
- String getTestClass();
-
- /**
- * Get the test method name
- */
- String getTestMethod();
-}
Copied: projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Request.java (from rev 88983, projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Request.java)
===================================================================
--- projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Request.java (rev 0)
+++ projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Request.java 2009-05-19 12:28:25 UTC (rev 89041)
@@ -0,0 +1,45 @@
+/*
+ * 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;
+
+//$Id$
+
+import java.io.Serializable;
+
+/**
+ * An abstraction of a test request.
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @since 16-May-2009
+ */
+public interface Request extends Serializable
+{
+ /**
+ * Get the test case name
+ */
+ String getTestClass();
+
+ /**
+ * Get the test method name
+ */
+ String getTestMethod();
+}
Deleted: projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Response.java
===================================================================
--- projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Response.java 2009-05-19 11:48:57 UTC (rev 89040)
+++ projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Response.java 2009-05-19 12:28:25 UTC (rev 89041)
@@ -1,52 +0,0 @@
-/*
- * 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;
-
-// $Id$
-
-import java.io.Serializable;
-import java.util.List;
-
-/**
- * An abstraction of a test response.
- *
- * @author Thomas.Diesler at jboss.com
- * @since 16-May-2009
- */
-public interface Response extends Serializable
-{
- /**
- * Get the list of test failures
- * @return an empty list if the test was successful
- */
- List<Failure> getFailures();
-
- /**
- * Add a list of failures to the response
- */
- void addAllFailures(List<Failure> failures);
-
- /**
- * Add a failure to the response
- */
- void addFailure(Failure failure);
-}
Copied: projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Response.java (from rev 89009, projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Response.java)
===================================================================
--- projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Response.java (rev 0)
+++ projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Response.java 2009-05-19 12:28:25 UTC (rev 89041)
@@ -0,0 +1,54 @@
+/*
+ * 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;
+
+// $Id$
+
+import java.io.Serializable;
+import java.util.List;
+
+
+
+/**
+ * An abstraction of a test response.
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @since 16-May-2009
+ */
+public interface Response extends Serializable
+{
+ /**
+ * Get the list of test failures
+ * @return an empty list if the test was successful
+ */
+ List<Failure> getFailures();
+
+ /**
+ * Add a list of failures to the response
+ */
+ void addAllFailures(List<Failure> failures);
+
+ /**
+ * Add a failure to the response
+ */
+ void addFailure(Failure failure);
+}
Deleted: projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Runner.java
===================================================================
--- projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Runner.java 2009-05-19 11:48:57 UTC (rev 89040)
+++ projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Runner.java 2009-05-19 12:28:25 UTC (rev 89041)
@@ -1,54 +0,0 @@
-/*
- * 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;
-
-//$Id$
-
-import org.jboss.osgi.husky.annotation.ProvideContext;
-import org.jboss.osgi.husky.junit.JUnitRunner;
-
-/**
- * An abstraction of a test runner that executes the given
- * test case in the isolated test environment.
- *
- * @author Thomas.Diesler at jboss.com
- * @since 16-May-2009
- */
-public interface Runner
-{
- /**
- * Run the tests in the given test class.
- *
- * Simmilar to the {@link JUnitRunner} a valid implementation
- * would do something simmilar to
- *
- * <ol>
- * <li>Instanciate the test case</li>
- * <li>Inject the context in the field marked by {@link ProvideContext}</li>
- * <li>Run the individual test methods</li>
- * <li>Collect the test results and wrap them in the {@link Response}</li>
- * </ol>
- *
- * Note, some test frameworks may choose to use an instance per test method.
- */
- Response runTests(Context context, Class<?> testClass);
-}
Modified: projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/annotation/ProvideContext.java
===================================================================
--- projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/annotation/ProvideContext.java 2009-05-19 11:48:57 UTC (rev 89040)
+++ projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/annotation/ProvideContext.java 2009-05-19 12:28:25 UTC (rev 89041)
@@ -29,7 +29,7 @@
import java.lang.annotation.Target;
import org.jboss.osgi.husky.Context;
-import org.jboss.osgi.husky.Runner;
+import org.jboss.osgi.husky.runtime.Runner;
/**
* An annotation that instructs the {@link Runner} to inject
Modified: projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractConnector.java
===================================================================
--- projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractConnector.java 2009-05-19 11:48:57 UTC (rev 89040)
+++ projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractConnector.java 2009-05-19 12:28:25 UTC (rev 89041)
@@ -26,10 +26,10 @@
import java.util.ArrayList;
import java.util.List;
-import org.jboss.osgi.husky.Connector;
-import org.jboss.osgi.husky.PackageListener;
import org.jboss.osgi.husky.Request;
import org.jboss.osgi.husky.Response;
+import org.jboss.osgi.husky.runtime.Connector;
+import org.jboss.osgi.husky.runtime.PackageListener;
/**
* [TODO]
Modified: projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractPackageListener.java
===================================================================
--- projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractPackageListener.java 2009-05-19 11:48:57 UTC (rev 89040)
+++ projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractPackageListener.java 2009-05-19 12:28:25 UTC (rev 89041)
@@ -26,10 +26,10 @@
import java.util.Arrays;
import org.jboss.osgi.husky.Context;
-import org.jboss.osgi.husky.PackageListener;
import org.jboss.osgi.husky.Request;
import org.jboss.osgi.husky.Response;
-import org.jboss.osgi.husky.Runner;
+import org.jboss.osgi.husky.runtime.PackageListener;
+import org.jboss.osgi.husky.runtime.Runner;
/**
* [TODO]
Copied: projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/BasicBridge.java (from rev 89009, projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/BasicBridge.java)
===================================================================
--- projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/BasicBridge.java (rev 0)
+++ projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/BasicBridge.java 2009-05-19 12:28:25 UTC (rev 89041)
@@ -0,0 +1,88 @@
+/*
+ * 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$
+
+import java.util.Properties;
+
+import org.jboss.osgi.husky.Bridge;
+import org.jboss.osgi.husky.Invoker;
+
+/**
+ * A basic {@link Bridge} implementation that can be associated
+ * with an arbitrary {@link Invoker}.
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @since 16-May-2009
+ */
+public class BasicBridge extends AbstractBridge
+{
+ private Properties props;
+ private Invoker invoker;
+
+ /**
+ * Construct a basic {@link Bridge} with the given properties.
+ *
+ * The properties would typically contain the name of the
+ * associated invoker under the key of {@link Invoker}.
+ */
+ public BasicBridge(Properties props)
+ {
+ this.props = props;
+ }
+
+ /**
+ * Get the invoker associated with this {@link Bridge}.
+ *
+ * If the invoker was not explicitly set, this method will load the
+ * invoker from the class name given by the {@link Invoker} property.
+ *
+ * If still not found it will load the invoker from the class name
+ * given by the {@link Invoker} system property.
+ *
+ * @throws RuntimeException if the {@link Invoker} cannot be loaded.
+ */
+ public Invoker getInvoker()
+ {
+ if (invoker == null)
+ {
+ String className = props.getProperty(Invoker.class.getName());
+ if (className == null)
+ className = System.getProperty(Invoker.class.getName());
+
+ if (className == null)
+ throw new IllegalStateException("Cannot load invoker: " + className);
+
+ invoker = (Invoker)Util.loadInstance(className, props);
+ }
+ return invoker;
+ }
+
+ /**
+ * Set the associated invoker
+ */
+ public void setInvoker(Invoker invoker)
+ {
+ this.invoker = invoker;
+ }
+}
Modified: projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/Extender.java
===================================================================
--- projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/Extender.java 2009-05-19 11:48:57 UTC (rev 89040)
+++ projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/Extender.java 2009-05-19 12:28:25 UTC (rev 89041)
@@ -26,8 +26,8 @@
import javax.management.MBeanServer;
import org.jboss.osgi.common.log.LogServiceTracker;
-import org.jboss.osgi.husky.PackageListener;
-import org.jboss.osgi.husky.junit.JUnitPackageListener;
+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;
import org.osgi.framework.BundleEvent;
Modified: projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/JMXConnectorMBean.java
===================================================================
--- projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/JMXConnectorMBean.java 2009-05-19 11:48:57 UTC (rev 89040)
+++ projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/JMXConnectorMBean.java 2009-05-19 12:28:25 UTC (rev 89041)
@@ -25,9 +25,9 @@
import java.io.InputStream;
-import org.jboss.osgi.husky.PackageListener;
import org.jboss.osgi.husky.Request;
import org.jboss.osgi.husky.Response;
+import org.jboss.osgi.husky.runtime.PackageListener;
/**
* [TODO]
Deleted: projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/JUnitFailure.java
===================================================================
--- projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/JUnitFailure.java 2009-05-19 11:48:57 UTC (rev 89040)
+++ projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/JUnitFailure.java 2009-05-19 12:28:25 UTC (rev 89041)
@@ -1,72 +0,0 @@
-/*
- * 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$
-
-import org.jboss.osgi.husky.Failure;
-import org.junit.runner.Description;
-
-/**
- * [TODO]
- *
- * @author Thomas.Diesler at jboss.com
- * @since 16-May-2009
- */
-public class JUnitFailure implements Failure
-{
- private static final long serialVersionUID = 1L;
-
- private String className;
- private String methodName;
- private Throwable exception;
- private String message;
-
- public JUnitFailure(org.junit.runner.notification.Failure failure)
- {
- Description descr = failure.getDescription();
- className = descr.getClassName();
- methodName = descr.getMethodName();
- message = failure.getMessage();
- exception = failure.getException();
- }
-
- public String getClassName()
- {
- return className;
- }
-
- public String getMethodName()
- {
- return methodName;
- }
-
- public String getMessage()
- {
- return message;
- }
-
- public Throwable getException()
- {
- return exception;
- }
-}
Deleted: projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/JUnitResponse.java
===================================================================
--- projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/JUnitResponse.java 2009-05-19 11:48:57 UTC (rev 89040)
+++ projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/JUnitResponse.java 2009-05-19 12:28:25 UTC (rev 89041)
@@ -1,46 +0,0 @@
-/*
- * 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$
-
-import org.junit.runner.Result;
-
-/**
- * [TODO]
- *
- * @author Thomas.Diesler at jboss.com
- * @since 16-May-2009
- */
-public class JUnitResponse extends BasicResponse
-{
- private static final long serialVersionUID = 1L;
-
- public JUnitResponse(Result result)
- {
- for (org.junit.runner.notification.Failure failure: result.getFailures())
- {
- addFailure(new JUnitFailure(failure));
- }
- }
-
-}
Modified: projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/LocalInvoker.java
===================================================================
--- projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/LocalInvoker.java 2009-05-19 11:48:57 UTC (rev 89040)
+++ projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/LocalInvoker.java 2009-05-19 12:28:25 UTC (rev 89041)
@@ -35,13 +35,13 @@
import javax.management.MBeanServerFactory;
import javax.management.RuntimeMBeanException;
-import org.jboss.osgi.husky.Connector;
import org.jboss.osgi.husky.Context;
import org.jboss.osgi.husky.Invoker;
import org.jboss.osgi.husky.Request;
import org.jboss.osgi.husky.Response;
-import org.jboss.osgi.husky.Runner;
-import org.jboss.osgi.husky.junit.JUnitRunner;
+import org.jboss.osgi.husky.runtime.Connector;
+import org.jboss.osgi.husky.runtime.Runner;
+import org.jboss.osgi.husky.runtime.junit.JUnitRunner;
/**
* [TODO]
Copied: projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/Connector.java (from rev 89009, projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Connector.java)
===================================================================
--- projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/Connector.java (rev 0)
+++ projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/Connector.java 2009-05-19 12:28:25 UTC (rev 89041)
@@ -0,0 +1,60 @@
+/*
+ * 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.runtime;
+
+import org.jboss.osgi.husky.Request;
+import org.jboss.osgi.husky.Response;
+
+// $Id$
+
+/**
+ * A Connector is the receiving side of a test request.
+ *
+ * It processes the test request by dispatching it to one of
+ * the associated {@link PackageListener}s.
+ *
+ * It is an error if no {@link PackageListener} can handle the
+ * incomming test request.
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @since 16-May-2009
+ */
+public interface Connector
+{
+ /**
+ * Handles the test request by dispatching to one of the
+ * associated {@link PackageListener}s.
+ *
+ * @throws RuntimeException if no {@link PackageListener} can
+ */
+ Response process(Request req) throws ClassNotFoundException;
+
+ /**
+ * Add a {@link PackageListener} to this connector
+ */
+ void addPackageListener(PackageListener listener);
+
+ /**
+ * Remove a {@link PackageListener} from this connector
+ */
+ void removePackageListener(PackageListener listener);
+}
Copied: projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/PackageListener.java (from rev 89009, projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/PackageListener.java)
===================================================================
--- projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/PackageListener.java (rev 0)
+++ projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/PackageListener.java 2009-05-19 12:28:25 UTC (rev 89041)
@@ -0,0 +1,53 @@
+/*
+ * 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.runtime;
+
+import org.jboss.osgi.husky.Request;
+import org.jboss.osgi.husky.Response;
+
+// $Id$
+
+/**
+ * A PackageListener that is associated with a {@link Connector}.
+ *
+ * The PackageListener matches test {@link Request}s with the package names
+ * that it can handle. On a successful match the {@link Connector} will invoke
+ * the {@link #runTests(Request)} method.
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @since 16-May-2009
+ */
+public interface PackageListener
+{
+ /**
+ * Return true if the given {@link Request} is from a package
+ * that this listener can handle.
+ */
+ boolean match(Request request);
+
+ /**
+ * Called by {@link Connector} when this listener indicated that it can
+ * handle the test request.
+ */
+ Response runTests(Request request) throws ClassNotFoundException;
+
+}
\ No newline at end of file
Copied: projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/Runner.java (from rev 88983, projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Runner.java)
===================================================================
--- projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/Runner.java (rev 0)
+++ projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/Runner.java 2009-05-19 12:28:25 UTC (rev 89041)
@@ -0,0 +1,56 @@
+/*
+ * 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.runtime;
+
+//$Id$
+
+import org.jboss.osgi.husky.Context;
+import org.jboss.osgi.husky.Response;
+import org.jboss.osgi.husky.annotation.ProvideContext;
+import org.jboss.osgi.husky.runtime.junit.JUnitRunner;
+
+/**
+ * An abstraction of a test runner that executes the given
+ * test case in the isolated test environment.
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @since 16-May-2009
+ */
+public interface Runner
+{
+ /**
+ * Run the tests in the given test class.
+ *
+ * Simmilar to the {@link JUnitRunner} a valid implementation
+ * would do something simmilar to
+ *
+ * <ol>
+ * <li>Instanciate the test case</li>
+ * <li>Inject the context in the field marked by {@link ProvideContext}</li>
+ * <li>Run the individual test methods</li>
+ * <li>Collect the test results and wrap them in the {@link Response}</li>
+ * </ol>
+ *
+ * Note, some test frameworks may choose to use an instance per test method.
+ */
+ Response runTests(Context context, Class<?> testClass);
+}
Copied: projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/junit/JUnitFailure.java (from rev 88983, projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/JUnitFailure.java)
===================================================================
--- projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/junit/JUnitFailure.java (rev 0)
+++ projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/junit/JUnitFailure.java 2009-05-19 12:28:25 UTC (rev 89041)
@@ -0,0 +1,72 @@
+/*
+ * 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.runtime.junit;
+
+// $Id$
+
+import org.jboss.osgi.husky.Failure;
+import org.junit.runner.Description;
+
+/**
+ * [TODO]
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @since 16-May-2009
+ */
+public class JUnitFailure implements Failure
+{
+ private static final long serialVersionUID = 1L;
+
+ private String className;
+ private String methodName;
+ private Throwable exception;
+ private String message;
+
+ public JUnitFailure(org.junit.runner.notification.Failure failure)
+ {
+ Description descr = failure.getDescription();
+ className = descr.getClassName();
+ methodName = descr.getMethodName();
+ message = failure.getMessage();
+ exception = failure.getException();
+ }
+
+ public String getClassName()
+ {
+ return className;
+ }
+
+ public String getMethodName()
+ {
+ return methodName;
+ }
+
+ public String getMessage()
+ {
+ return message;
+ }
+
+ public Throwable getException()
+ {
+ return exception;
+ }
+}
Copied: projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/junit/JUnitPackageListener.java (from rev 89009, projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/junit/JUnitPackageListener.java)
===================================================================
--- projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/junit/JUnitPackageListener.java (rev 0)
+++ projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/junit/JUnitPackageListener.java 2009-05-19 12:28:25 UTC (rev 89041)
@@ -0,0 +1,70 @@
+/*
+ * 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.runtime.junit;
+
+// $Id$
+
+import org.jboss.osgi.husky.Context;
+import org.jboss.osgi.husky.internal.AbstractPackageListener;
+import org.jboss.osgi.husky.internal.BasicContext;
+import org.jboss.osgi.husky.runtime.Runner;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+
+/**
+ * An implementation of a {@link Runner} that uses the
+ * JUnit4 Test Runner.
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @since 16-May-2009
+ */
+public class JUnitPackageListener extends AbstractPackageListener
+{
+ private Bundle bundle;
+
+ public JUnitPackageListener(Bundle bundle, String[] testPackages)
+ {
+ super(testPackages);
+ this.bundle = bundle;
+ }
+
+ @Override
+ public Context getContext()
+ {
+ BasicContext context = new BasicContext();
+ context.addAttachment(Bundle.class, bundle);
+ context.addAttachment(BundleContext.class, bundle.getBundleContext());
+ return context;
+ }
+
+ @Override
+ public Runner getRunner()
+ {
+ return new JUnitRunner();
+ }
+
+ @Override
+ public Class<?> loadTestClass(String className) throws ClassNotFoundException
+ {
+ return bundle.loadClass(className);
+ }
+}
Copied: projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/junit/JUnitResponse.java (from rev 89009, projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/JUnitResponse.java)
===================================================================
--- projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/junit/JUnitResponse.java (rev 0)
+++ projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/junit/JUnitResponse.java 2009-05-19 12:28:25 UTC (rev 89041)
@@ -0,0 +1,47 @@
+/*
+ * 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.runtime.junit;
+
+// $Id$
+
+import org.jboss.osgi.husky.internal.BasicResponse;
+import org.junit.runner.Result;
+
+/**
+ * [TODO]
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @since 16-May-2009
+ */
+public class JUnitResponse extends BasicResponse
+{
+ private static final long serialVersionUID = 1L;
+
+ public JUnitResponse(Result result)
+ {
+ for (org.junit.runner.notification.Failure failure: result.getFailures())
+ {
+ addFailure(new JUnitFailure(failure));
+ }
+ }
+
+}
Copied: projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/junit/JUnitRunner.java (from rev 88983, projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/junit/JUnitRunner.java)
===================================================================
--- projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/junit/JUnitRunner.java (rev 0)
+++ projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/junit/JUnitRunner.java 2009-05-19 12:28:25 UTC (rev 89041)
@@ -0,0 +1,105 @@
+/*
+ * 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.runtime.junit;
+
+// $Id$
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+
+import org.jboss.osgi.husky.Context;
+import org.jboss.osgi.husky.Response;
+import org.jboss.osgi.husky.annotation.ProvideContext;
+import org.jboss.osgi.husky.runtime.Runner;
+import org.junit.runner.Result;
+import org.junit.runner.notification.RunListener;
+import org.junit.runner.notification.RunNotifier;
+import org.junit.runners.BlockJUnit4ClassRunner;
+import org.junit.runners.model.InitializationError;
+
+/**
+ * An implementation of a {@link Runner} that uses the
+ * JUnit4 Test Runner.
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @since 16-May-2009
+ */
+public class JUnitRunner implements Runner
+{
+ /**
+ * Run the tests in the given test class.
+ */
+ public Response runTests(final Context context, final Class<?> testClass)
+ {
+ BlockJUnit4ClassRunner runner;
+ try
+ {
+ runner = new BlockJUnit4ClassRunner(testClass)
+ {
+ @Override
+ protected Object createTest() throws Exception
+ {
+ Object test = super.createTest();
+ for (Field field : testClass.getFields())
+ {
+ ProvideContext anProvide = field.getAnnotation(ProvideContext.class);
+ if (anProvide != null)
+ {
+ field.set(test, context);
+ }
+ }
+ for (Method method : testClass.getDeclaredMethods())
+ {
+ ProvideContext anProvide = method.getAnnotation(ProvideContext.class);
+ if (anProvide != null)
+ {
+ method.invoke(test, context);
+ }
+ }
+ return test;
+ }
+ };
+ }
+ catch (InitializationError ex)
+ {
+ throw new IllegalStateException("Cannot initialize test case: " + testClass.getName());
+ }
+
+ Result result = new Result();
+ RunListener listener = result.createListener();
+ RunNotifier fNotifier = new RunNotifier();
+ fNotifier.addFirstListener(listener);
+ try
+ {
+ fNotifier.fireTestRunStarted(runner.getDescription());
+ runner.run(fNotifier);
+ fNotifier.fireTestRunFinished(result);
+ }
+ finally
+ {
+ fNotifier.removeListener(listener);
+ }
+
+ Response response = new JUnitResponse(result);
+ return response;
+ }
+}
Copied: projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/junit/package.html (from rev 88983, projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/junit/package.html)
===================================================================
--- projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/junit/package.html (rev 0)
+++ projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/junit/package.html 2009-05-19 12:28:25 UTC (rev 89041)
@@ -0,0 +1,4 @@
+<body>
+JUnit specific implementations
+</body>
+
\ No newline at end of file
More information about the jboss-cvs-commits
mailing list