[jboss-cvs] JBossAS SVN: r95826 - in projects/jboss-osgi: projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal and 15 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Oct 30 09:44:33 EDT 2009
Author: thomas.diesler at jboss.com
Date: 2009-10-30 09:44:32 -0400 (Fri, 30 Oct 2009)
New Revision: 95826
Added:
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Bridge.java
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/BridgeFactory.java
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/HuskyCapability.java
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/RuntimeContext.java
Removed:
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/Bridge.java
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/BridgeFactory.java
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/HuskyCapability.java
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/RuntimeContext.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jta/bundle/
Modified:
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractBridge.java
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/BasicBridge.java
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/Util.java
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/Runner.java
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/junit/JUnitRunner.java
projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/java/org/jboss/test/osgi/husky/context/ContextTestCase.java
projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/java/org/jboss/test/osgi/husky/context/MultipleMethodsTestCase.java
projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/java/org/jboss/test/osgi/husky/context/StaticContextTestCase.java
projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/context/context-basic.bnd
projects/jboss-osgi/trunk/reactor/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/BlueprintContainerTestCase.java
projects/jboss-osgi/trunk/reactor/blueprint/testsuite/src/test/resources/container/container-basic.bnd
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/blueprint/BlueprintTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jta/TransactionTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/simple/SimpleHuskyTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jaxb/JAXBTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/DOMParserTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/SAXParserTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/blueprint/example-blueprint.bnd
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jta/example-jta.bnd
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/xml/jaxb/example-xml-jaxb.bnd
Log:
Migrate JTA test to Husky
Copied: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Bridge.java (from rev 95824, projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/Bridge.java)
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Bridge.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Bridge.java 2009-10-30 13:44:32 UTC (rev 95826)
@@ -0,0 +1,121 @@
+/*
+ * 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
+{
+ /**
+ * Get the caller's class
+ */
+ Class<?> getCallerClass();
+
+ /**
+ * Get the caller's method
+ */
+ String getCallerMethod();
+
+ /**
+ * Get the caller's concatination of class name and method.
+ */
+ String getCallerFrame();
+
+ /**
+ * 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/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/BridgeFactory.java (from rev 95824, projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/BridgeFactory.java)
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/BridgeFactory.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/BridgeFactory.java 2009-10-30 13:44:32 UTC (rev 95826)
@@ -0,0 +1,93 @@
+/*
+ * 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.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+import org.jboss.osgi.husky.internal.BasicBridge;
+import org.jboss.osgi.husky.internal.Util;
+
+/**
+ * Loads the configured {@link Bridge} instance.
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @since 16-May-2009
+ */
+public abstract class BridgeFactory
+{
+ private static Map<Object, Bridge> bridgeCache = new HashMap<Object, Bridge>();
+
+ /**
+ * 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();
+ return getBridgeInternal(null, props);
+ }
+
+ /**
+ * Get the cached instance of the bridge class that is configed through the system property {@link Bridge}.
+ * If there is no cached instance it creates a new instance.
+ */
+ public static Bridge getBridge(Object key)
+ {
+ Properties props = System.getProperties();
+ return getBridgeInternal(key, 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(Object key, Properties props)
+ {
+ String className = props.getProperty(Bridge.class.getName());
+ if (className == null)
+ throw new IllegalStateException("Cannot find property: " + Bridge.class.getName());
+
+ return getBridgeInternal(key, props);
+ }
+
+ private static Bridge getBridgeInternal(Object key, Properties props)
+ {
+ Bridge bridge = bridgeCache.get(key);
+ if (bridge == null)
+ {
+ String className = props.getProperty(Bridge.class.getName(), BasicBridge.class.getName());
+ bridge = (Bridge)Util.loadInstance(className, props);
+
+ if (key != null)
+ bridgeCache.put(key, bridge);
+ }
+ return bridge;
+ }
+}
Copied: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/HuskyCapability.java (from rev 95824, projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/HuskyCapability.java)
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/HuskyCapability.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/HuskyCapability.java 2009-10-30 13:44:32 UTC (rev 95826)
@@ -0,0 +1,49 @@
+/*
+ * 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.runtime.Connector;
+import org.jboss.osgi.spi.capability.Capability;
+import org.jboss.osgi.testing.OSGiRuntime;
+
+/**
+ * Adds the Husky testing capability to the {@link OSGiRuntime}
+ * under test.
+ *
+ * It is ignored if a Husky connector is already registered.
+ *
+ * Installed bundles: jboss-osgi-husky.jar
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 05-May-2009
+ */
+public class HuskyCapability extends Capability
+{
+ public HuskyCapability()
+ {
+ super(Connector.class.getName());
+
+ addBundle("bundles/jboss-osgi-husky.jar");
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/RuntimeContext.java (from rev 95825, projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/RuntimeContext.java)
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/RuntimeContext.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/RuntimeContext.java 2009-10-30 13:44:32 UTC (rev 95826)
@@ -0,0 +1,46 @@
+/*
+ * 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.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.jboss.osgi.husky.runtime.Runner;
+
+/**
+ * An annotation that instructs the {@link Runner} to inject
+ * the {@link Context} into the marked field or method on the
+ * test case instance prior to the execution of any test method.
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @since 16-May-2009
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target({ElementType.METHOD, ElementType.FIELD})
+public @interface RuntimeContext
+{
+
+}
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractBridge.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractBridge.java 2009-10-30 13:18:51 UTC (rev 95825)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractBridge.java 2009-10-30 13:44:32 UTC (rev 95826)
@@ -32,10 +32,9 @@
import junit.framework.AssertionFailedError;
+import org.jboss.osgi.husky.Bridge;
import org.jboss.osgi.husky.Failure;
-import org.jboss.osgi.husky.Invoker;
import org.jboss.osgi.husky.Response;
-import org.jboss.osgi.testing.Bridge;
/**
* An abstract {@link Bridge} implementation.
@@ -125,8 +124,7 @@
line = br.readLine().trim();
String bridgePackage = Bridge.class.getPackage().getName();
- String invokerPackage = Invoker.class.getPackage().getName();
- while (line.startsWith("at " + bridgePackage) || line.startsWith("at " + invokerPackage))
+ while (line.startsWith("at " + bridgePackage))
{
line = br.readLine().trim();
}
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/BasicBridge.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/BasicBridge.java 2009-10-30 13:18:51 UTC (rev 95825)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/BasicBridge.java 2009-10-30 13:44:32 UTC (rev 95826)
@@ -25,8 +25,8 @@
import java.util.Properties;
+import org.jboss.osgi.husky.Bridge;
import org.jboss.osgi.husky.Invoker;
-import org.jboss.osgi.testing.Bridge;
/**
* A basic {@link Bridge} implementation that can be associated
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/Util.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/Util.java 2009-10-30 13:18:51 UTC (rev 95825)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/Util.java 2009-10-30 13:44:32 UTC (rev 95826)
@@ -29,7 +29,7 @@
import java.lang.reflect.Constructor;
import java.util.Properties;
-import org.jboss.osgi.testing.Bridge;
+import org.jboss.osgi.husky.Bridge;
/**
* Loads the configured test {@link Bridge} instance.
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/Runner.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/Runner.java 2009-10-30 13:18:51 UTC (rev 95825)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/Runner.java 2009-10-30 13:44:32 UTC (rev 95826)
@@ -25,8 +25,8 @@
import org.jboss.osgi.husky.Context;
import org.jboss.osgi.husky.Response;
+import org.jboss.osgi.husky.RuntimeContext;
import org.jboss.osgi.husky.runtime.junit.JUnitRunner;
-import org.jboss.osgi.testing.RuntimeContext;
/**
* An abstraction of a test runner that executes the given
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/junit/JUnitRunner.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/junit/JUnitRunner.java 2009-10-30 13:18:51 UTC (rev 95825)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/junit/JUnitRunner.java 2009-10-30 13:44:32 UTC (rev 95826)
@@ -30,8 +30,8 @@
import org.jboss.osgi.husky.Context;
import org.jboss.osgi.husky.Response;
+import org.jboss.osgi.husky.RuntimeContext;
import org.jboss.osgi.husky.runtime.Runner;
-import org.jboss.osgi.testing.RuntimeContext;
import org.junit.runner.Result;
import org.junit.runner.notification.RunListener;
import org.junit.runner.notification.RunNotifier;
Deleted: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/Bridge.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/Bridge.java 2009-10-30 13:18:51 UTC (rev 95825)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/Bridge.java 2009-10-30 13:44:32 UTC (rev 95826)
@@ -1,126 +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.testing;
-
-import org.jboss.osgi.husky.Invoker;
-import org.jboss.osgi.husky.Request;
-import org.jboss.osgi.husky.Response;
-
-
-
-// $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
-{
- /**
- * Get the caller's class
- */
- Class<?> getCallerClass();
-
- /**
- * Get the caller's method
- */
- String getCallerMethod();
-
- /**
- * Get the caller's concatination of class name and method.
- */
- String getCallerFrame();
-
- /**
- * 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/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/BridgeFactory.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/BridgeFactory.java 2009-10-30 13:18:51 UTC (rev 95825)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/BridgeFactory.java 2009-10-30 13:44:32 UTC (rev 95826)
@@ -1,93 +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.testing;
-
-// $Id$
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-
-import org.jboss.osgi.husky.internal.BasicBridge;
-import org.jboss.osgi.husky.internal.Util;
-
-/**
- * Loads the configured {@link Bridge} instance.
- *
- * @author Thomas.Diesler at jboss.com
- * @since 16-May-2009
- */
-public abstract class BridgeFactory
-{
- private static Map<Object, Bridge> bridgeCache = new HashMap<Object, Bridge>();
-
- /**
- * 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();
- return getBridgeInternal(null, props);
- }
-
- /**
- * Get the cached instance of the bridge class that is configed through the system property {@link Bridge}.
- * If there is no cached instance it creates a new instance.
- */
- public static Bridge getBridge(Object key)
- {
- Properties props = System.getProperties();
- return getBridgeInternal(key, 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(Object key, Properties props)
- {
- String className = props.getProperty(Bridge.class.getName());
- if (className == null)
- throw new IllegalStateException("Cannot find property: " + Bridge.class.getName());
-
- return getBridgeInternal(key, props);
- }
-
- private static Bridge getBridgeInternal(Object key, Properties props)
- {
- Bridge bridge = bridgeCache.get(key);
- if (bridge == null)
- {
- String className = props.getProperty(Bridge.class.getName(), BasicBridge.class.getName());
- bridge = (Bridge)Util.loadInstance(className, props);
-
- if (key != null)
- bridgeCache.put(key, bridge);
- }
- return bridge;
- }
-}
Deleted: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/HuskyCapability.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/HuskyCapability.java 2009-10-30 13:18:51 UTC (rev 95825)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/HuskyCapability.java 2009-10-30 13:44:32 UTC (rev 95826)
@@ -1,48 +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.testing;
-
-//$Id$
-
-import org.jboss.osgi.husky.runtime.Connector;
-import org.jboss.osgi.spi.capability.Capability;
-
-/**
- * Adds the Husky testing capability to the {@link OSGiRuntime}
- * under test.
- *
- * It is ignored if a Husky connector is already registered.
- *
- * Installed bundles: jboss-osgi-husky.jar
- *
- * @author thomas.diesler at jboss.com
- * @since 05-May-2009
- */
-public class HuskyCapability extends Capability
-{
- public HuskyCapability()
- {
- super(Connector.class.getName());
-
- addBundle("bundles/jboss-osgi-husky.jar");
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/RuntimeContext.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/RuntimeContext.java 2009-10-30 13:18:51 UTC (rev 95825)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/RuntimeContext.java 2009-10-30 13:44:32 UTC (rev 95826)
@@ -1,47 +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.testing;
-
-// $Id$
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import org.jboss.osgi.husky.Context;
-import org.jboss.osgi.husky.runtime.Runner;
-
-/**
- * An annotation that instructs the {@link Runner} to inject
- * the {@link Context} into the marked field or method on the
- * test case instance prior to the execution of any test method.
- *
- * @author Thomas.Diesler at jboss.com
- * @since 16-May-2009
- */
- at Retention(RetentionPolicy.RUNTIME)
- at Target({ElementType.METHOD, ElementType.FIELD})
-public @interface RuntimeContext
-{
-
-}
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/java/org/jboss/test/osgi/husky/context/ContextTestCase.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/java/org/jboss/test/osgi/husky/context/ContextTestCase.java 2009-10-30 13:18:51 UTC (rev 95825)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/java/org/jboss/test/osgi/husky/context/ContextTestCase.java 2009-10-30 13:44:32 UTC (rev 95826)
@@ -26,12 +26,12 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assume.assumeNotNull;
-import org.jboss.osgi.testing.BridgeFactory;
-import org.jboss.osgi.testing.HuskyCapability;
+import org.jboss.osgi.husky.BridgeFactory;
+import org.jboss.osgi.husky.HuskyCapability;
+import org.jboss.osgi.husky.RuntimeContext;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
import org.jboss.osgi.testing.OSGiTestHelper;
-import org.jboss.osgi.testing.RuntimeContext;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/java/org/jboss/test/osgi/husky/context/MultipleMethodsTestCase.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/java/org/jboss/test/osgi/husky/context/MultipleMethodsTestCase.java 2009-10-30 13:18:51 UTC (rev 95825)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/java/org/jboss/test/osgi/husky/context/MultipleMethodsTestCase.java 2009-10-30 13:44:32 UTC (rev 95826)
@@ -26,12 +26,12 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assume.assumeNotNull;
-import org.jboss.osgi.testing.BridgeFactory;
-import org.jboss.osgi.testing.HuskyCapability;
+import org.jboss.osgi.husky.BridgeFactory;
+import org.jboss.osgi.husky.HuskyCapability;
+import org.jboss.osgi.husky.RuntimeContext;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
import org.jboss.osgi.testing.OSGiTestHelper;
-import org.jboss.osgi.testing.RuntimeContext;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/java/org/jboss/test/osgi/husky/context/StaticContextTestCase.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/java/org/jboss/test/osgi/husky/context/StaticContextTestCase.java 2009-10-30 13:18:51 UTC (rev 95825)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/java/org/jboss/test/osgi/husky/context/StaticContextTestCase.java 2009-10-30 13:44:32 UTC (rev 95826)
@@ -26,12 +26,12 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assume.assumeNotNull;
-import org.jboss.osgi.testing.BridgeFactory;
-import org.jboss.osgi.testing.HuskyCapability;
+import org.jboss.osgi.husky.BridgeFactory;
+import org.jboss.osgi.husky.HuskyCapability;
+import org.jboss.osgi.husky.RuntimeContext;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
import org.jboss.osgi.testing.OSGiTestHelper;
-import org.jboss.osgi.testing.RuntimeContext;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/context/context-basic.bnd
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/context/context-basic.bnd 2009-10-30 13:18:51 UTC (rev 95825)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/context/context-basic.bnd 2009-10-30 13:44:32 UTC (rev 95826)
@@ -6,6 +6,7 @@
Import-Package: \
org.jboss.osgi.spi.capability, \
+ org.jboss.osgi.husky, \
org.jboss.osgi.testing, \
org.junit, \
org.osgi.framework
Modified: projects/jboss-osgi/trunk/reactor/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/BlueprintContainerTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/BlueprintContainerTestCase.java 2009-10-30 13:18:51 UTC (rev 95825)
+++ projects/jboss-osgi/trunk/reactor/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/BlueprintContainerTestCase.java 2009-10-30 13:44:32 UTC (rev 95826)
@@ -36,14 +36,14 @@
import javax.management.MBeanServer;
import org.jboss.osgi.blueprint.BlueprintCapability;
+import org.jboss.osgi.husky.Bridge;
+import org.jboss.osgi.husky.BridgeFactory;
+import org.jboss.osgi.husky.HuskyCapability;
+import org.jboss.osgi.husky.RuntimeContext;
import org.jboss.osgi.jmx.JMXCapability;
-import org.jboss.osgi.testing.Bridge;
-import org.jboss.osgi.testing.BridgeFactory;
-import org.jboss.osgi.testing.HuskyCapability;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
import org.jboss.osgi.testing.OSGiTestHelper;
-import org.jboss.osgi.testing.RuntimeContext;
import org.jboss.test.osgi.blueprint.container.bundle.BeanA;
import org.jboss.test.osgi.blueprint.container.bundle.BeanB;
import org.jboss.test.osgi.blueprint.container.bundle.ServiceA;
Modified: projects/jboss-osgi/trunk/reactor/blueprint/testsuite/src/test/resources/container/container-basic.bnd
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/testsuite/src/test/resources/container/container-basic.bnd 2009-10-30 13:18:51 UTC (rev 95825)
+++ projects/jboss-osgi/trunk/reactor/blueprint/testsuite/src/test/resources/container/container-basic.bnd 2009-10-30 13:44:32 UTC (rev 95826)
@@ -9,6 +9,7 @@
Import-Package: \
javax.management, \
org.jboss.osgi.blueprint, \
+ org.jboss.osgi.husky, \
org.jboss.osgi.jmx, \
org.jboss.osgi.spi.capability, \
org.jboss.osgi.testing, \
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/blueprint/BlueprintTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/blueprint/BlueprintTestCase.java 2009-10-30 13:18:51 UTC (rev 95825)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/blueprint/BlueprintTestCase.java 2009-10-30 13:44:32 UTC (rev 95826)
@@ -30,13 +30,13 @@
import javax.management.MBeanServer;
import org.jboss.osgi.blueprint.BlueprintCapability;
+import org.jboss.osgi.husky.BridgeFactory;
+import org.jboss.osgi.husky.HuskyCapability;
+import org.jboss.osgi.husky.RuntimeContext;
import org.jboss.osgi.jmx.JMXCapability;
-import org.jboss.osgi.testing.BridgeFactory;
-import org.jboss.osgi.testing.HuskyCapability;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
import org.jboss.osgi.testing.OSGiTestHelper;
-import org.jboss.osgi.testing.RuntimeContext;
import org.jboss.test.osgi.example.blueprint.bundle.BeanA;
import org.jboss.test.osgi.example.blueprint.bundle.ServiceA;
import org.jboss.test.osgi.example.blueprint.bundle.ServiceB;
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jta/TransactionTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jta/TransactionTestCase.java 2009-10-30 13:18:51 UTC (rev 95825)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jta/TransactionTestCase.java 2009-10-30 13:44:32 UTC (rev 95826)
@@ -23,17 +23,29 @@
//$Id$
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assume.assumeNotNull;
+import javax.transaction.Status;
+import javax.transaction.Synchronization;
+import javax.transaction.Transaction;
+import javax.transaction.TransactionManager;
+import javax.transaction.UserTransaction;
+
+import org.jboss.osgi.husky.BridgeFactory;
+import org.jboss.osgi.husky.HuskyCapability;
+import org.jboss.osgi.husky.RuntimeContext;
+import org.jboss.osgi.jmx.JMXCapability;
import org.jboss.osgi.jta.TransactionCapability;
-import org.jboss.osgi.testing.HuskyCapability;
-import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
import org.jboss.osgi.testing.OSGiTestHelper;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
/**
* An example of OSGi JTA.
@@ -43,31 +55,107 @@
*/
public class TransactionTestCase
{
+ @RuntimeContext
+ public BundleContext context;
+
private OSGiRuntime runtime;
@Before
public void setUp() throws Exception
{
- runtime = new OSGiTestHelper().getDefaultRuntime();
- runtime.addCapability(new HuskyCapability());
- runtime.addCapability(new HuskyCapability());
- runtime.addCapability(new TransactionCapability());
+ if (context == null)
+ {
+ runtime = new OSGiTestHelper().getDefaultRuntime();
+ runtime.addCapability(new JMXCapability());
+ runtime.addCapability(new HuskyCapability());
+ runtime.addCapability(new TransactionCapability());
+ runtime.installBundle("example-jta.jar").start();
+ }
}
@After
public void tearDown() throws Exception
{
- runtime.shutdown();
- runtime = null;
+ if (context == null)
+ runtime.shutdown();
}
@Test
public void testUserTransaction() throws Exception
{
- OSGiBundle bundle = runtime.installBundle("example-jta.jar");
- assertEquals(Bundle.INSTALLED, bundle.getState());
+ if (context == null)
+ BridgeFactory.getBridge().run();
- bundle.start();
- assertEquals(Bundle.ACTIVE, bundle.getState());
+ // Tell Husky to run this test method within the OSGi Runtime
+ if (context == null)
+ BridgeFactory.getBridge().run();
+
+ // Stop here if the context is not injected
+ assumeNotNull(context);
+
+ ServiceReference sref = context.getServiceReference(UserTransaction.class.getName());
+ assertNotNull("UserTransaction service not null", sref);
+
+ UserTransaction userTx = (UserTransaction)context.getService(sref);
+ assertNotNull("UserTransaction not null", userTx);
+
+ Transactional txObj = new Transactional();
+
+ userTx.begin();
+ try
+ {
+ txObj.register(context);
+
+ txObj.setMessage("Hello World");
+ assertNull("Uncommited message null", txObj.getMessage());
+
+ userTx.commit();
+ }
+ catch (Exception e)
+ {
+ userTx.setRollbackOnly();
+ }
+
+ assertEquals("Hello World", txObj.getMessage());
}
+
+ class Transactional implements Synchronization
+ {
+ private String volatileMessage;
+ private String message;
+
+ public void beforeCompletion()
+ {
+ }
+
+ public void afterCompletion(int status)
+ {
+ if (status == Status.STATUS_COMMITTED)
+ message = volatileMessage;
+ }
+
+ public String getMessage()
+ {
+ return message;
+ }
+
+ public void setMessage(String message)
+ {
+ this.volatileMessage = message;
+ }
+
+ void register(BundleContext context) throws Exception
+ {
+ ServiceReference sref = context.getServiceReference(TransactionManager.class.getName());
+ assertNotNull("TransactionManager service not null", sref);
+
+ TransactionManager tm = (TransactionManager)context.getService(sref);
+ assertNotNull("TransactionManager not null", tm);
+
+ Transaction tx = tm.getTransaction();
+ assertNotNull("Transaction not null", tx);
+
+ tx.registerSynchronization(this);
+ }
+ }
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/simple/SimpleHuskyTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/simple/SimpleHuskyTestCase.java 2009-10-30 13:18:51 UTC (rev 95825)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/simple/SimpleHuskyTestCase.java 2009-10-30 13:44:32 UTC (rev 95826)
@@ -27,12 +27,12 @@
import static org.junit.Assert.assertNotNull;
import static org.junit.Assume.assumeNotNull;
-import org.jboss.osgi.testing.BridgeFactory;
-import org.jboss.osgi.testing.HuskyCapability;
+import org.jboss.osgi.husky.BridgeFactory;
+import org.jboss.osgi.husky.HuskyCapability;
+import org.jboss.osgi.husky.RuntimeContext;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
import org.jboss.osgi.testing.OSGiTestHelper;
-import org.jboss.osgi.testing.RuntimeContext;
import org.jboss.test.osgi.example.simple.bundle.SimpleService;
import org.junit.After;
import org.junit.Before;
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jaxb/JAXBTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jaxb/JAXBTestCase.java 2009-10-30 13:18:51 UTC (rev 95825)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jaxb/JAXBTestCase.java 2009-10-30 13:44:32 UTC (rev 95826)
@@ -34,14 +34,14 @@
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
+import org.jboss.osgi.husky.BridgeFactory;
+import org.jboss.osgi.husky.HuskyCapability;
+import org.jboss.osgi.husky.RuntimeContext;
import org.jboss.osgi.jaxb.JAXBCapability;
import org.jboss.osgi.jaxb.JAXBService;
-import org.jboss.osgi.testing.BridgeFactory;
-import org.jboss.osgi.testing.HuskyCapability;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
import org.jboss.osgi.testing.OSGiTestHelper;
-import org.jboss.osgi.testing.RuntimeContext;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/DOMParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/DOMParserTestCase.java 2009-10-30 13:18:51 UTC (rev 95825)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/DOMParserTestCase.java 2009-10-30 13:44:32 UTC (rev 95826)
@@ -33,12 +33,12 @@
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
-import org.jboss.osgi.testing.BridgeFactory;
-import org.jboss.osgi.testing.HuskyCapability;
+import org.jboss.osgi.husky.BridgeFactory;
+import org.jboss.osgi.husky.HuskyCapability;
+import org.jboss.osgi.husky.RuntimeContext;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
import org.jboss.osgi.testing.OSGiTestHelper;
-import org.jboss.osgi.testing.RuntimeContext;
import org.jboss.osgi.xml.XMLParserCapability;
import org.junit.After;
import org.junit.Before;
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/SAXParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/SAXParserTestCase.java 2009-10-30 13:18:51 UTC (rev 95825)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/SAXParserTestCase.java 2009-10-30 13:44:32 UTC (rev 95826)
@@ -32,12 +32,12 @@
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
-import org.jboss.osgi.testing.BridgeFactory;
-import org.jboss.osgi.testing.HuskyCapability;
+import org.jboss.osgi.husky.BridgeFactory;
+import org.jboss.osgi.husky.HuskyCapability;
+import org.jboss.osgi.husky.RuntimeContext;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
import org.jboss.osgi.testing.OSGiTestHelper;
-import org.jboss.osgi.testing.RuntimeContext;
import org.jboss.osgi.xml.XMLParserCapability;
import org.junit.After;
import org.junit.Before;
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/blueprint/example-blueprint.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/blueprint/example-blueprint.bnd 2009-10-30 13:18:51 UTC (rev 95825)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/blueprint/example-blueprint.bnd 2009-10-30 13:44:32 UTC (rev 95826)
@@ -7,6 +7,7 @@
Import-Package: \
javax.management, \
org.jboss.osgi.blueprint, \
+ org.jboss.osgi.husky, \
org.jboss.osgi.jmx, \
org.jboss.osgi.spi.capability, \
org.jboss.osgi.testing, \
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jta/example-jta.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jta/example-jta.bnd 2009-10-30 13:18:51 UTC (rev 95825)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jta/example-jta.bnd 2009-10-30 13:44:32 UTC (rev 95826)
@@ -1,6 +1,11 @@
# bnd build -classpath target/test-classes -output target/test-libs/example-jta.jar src/test/resources/jta/example-jta.bnd
Bundle-SymbolicName: example-jta
-Bundle-Activator: org.jboss.test.osgi.example.jta.bundle.TransactionActivator
-Private-Package: org.jboss.test.osgi.example.jta.bundle
-Import-Package: javax.transaction, org.junit, org.osgi.framework
+Export-Package: org.jboss.test.osgi.example.jta
+Import-Package: \
+ javax.transaction, \
+ org.jboss.osgi.jmx, org.jboss.osgi.husky, org.jboss.osgi.testing, org.jboss.osgi.jta, org.jboss.osgi.spi.capability, \
+ org.junit, org.osgi.framework
+
+# Tell Husky that there are test cases in this package
+Test-Package: org.jboss.test.osgi.example.jta
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/xml/jaxb/example-xml-jaxb.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/xml/jaxb/example-xml-jaxb.bnd 2009-10-30 13:18:51 UTC (rev 95825)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/xml/jaxb/example-xml-jaxb.bnd 2009-10-30 13:44:32 UTC (rev 95826)
@@ -6,7 +6,7 @@
Export-Package: org.jboss.test.osgi.example.xml.jaxb
Import-Package: com.sun.xml.bind.v2, javax.xml.bind*, javax.xml.datatype, javax.xml.namespace, \
- org.jboss.osgi.jaxb, org.jboss.osgi.spi*, org.jboss.osgi.testing, org.junit, org.osgi.framework
+ org.jboss.osgi.jaxb, org.jboss.osgi.spi*, org.jboss.osgi.husky, org.jboss.osgi.testing, org.junit, org.osgi.framework
Include-Resource: booking.xml, booking.xsd
More information about the jboss-cvs-commits
mailing list