[jboss-osgi-commits] JBoss-OSGI SVN: r88675 - in projects/jboss-osgi/trunk/testsuite: trailblazer and 18 other directories.
jboss-osgi-commits at lists.jboss.org
jboss-osgi-commits at lists.jboss.org
Mon May 11 17:38:27 EDT 2009
Author: thomas.diesler at jboss.com
Date: 2009-05-11 17:38:26 -0400 (Mon, 11 May 2009)
New Revision: 88675
Added:
projects/jboss-osgi/trunk/testsuite/trailblazer/
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/AuditService.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/PaymentService.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/Shop.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/ShoppingMall.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/HttpRenderServlet.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/RequestHandler.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/ShoppingCart.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/main/
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/main/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/main/ShoppingMallImpl.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/creditcard/
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/creditcard/CreditCardServiceImpl.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/creditcard/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/pets/
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/pets/PetStore.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/pets/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/sports/
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/sports/ClimbingStore.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/sports/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/types/
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/types/Product.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/jboss-osgi-framework.properties
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/frontend.bnd
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/main.bnd
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/pay-creditcard.bnd
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/shop-pets.bnd
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/shop-sports.bnd
Removed:
projects/jboss-osgi/trunk/testsuite/trailblazer/scripts/assembly-examples-zip.xml
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/example/http/bundle/
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/example/jmx/JMXTestCase.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/example/jmx/bundle/
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/example/jndi/JNDITestCase.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/example/jndi/bundle/
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/example/log/bundle/
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleA/
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleB/
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/http/
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/jboss-osgi-felix.properties
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/jmx/
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/jndi/
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/log/
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/mcservice/
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/example-http.bnd
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/message.txt
Modified:
projects/jboss-osgi/trunk/testsuite/trailblazer/pom.xml
projects/jboss-osgi/trunk/testsuite/trailblazer/scripts/antrun-test-jars.xml
Log:
Trailblazer initial cut
Copied: projects/jboss-osgi/trunk/testsuite/trailblazer (from rev 88577, projects/jboss-osgi/trunk/testsuite/example)
Property changes on: projects/jboss-osgi/trunk/testsuite/trailblazer
___________________________________________________________________
Name: svn:ignore
+ target
felix-cache
Name: svn:mergeinfo
+
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/pom.xml 2009-05-09 13:25:16 UTC (rev 88577)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/pom.xml 2009-05-11 21:38:26 UTC (rev 88675)
@@ -2,10 +2,10 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
- <name>JBossOSGi - Testsuite Examples</name>
+ <name>JBossOSGi - Testsuite Trailblazer</name>
<groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-testsuite-example</artifactId>
+ <artifactId>jboss-osgi-testsuite-trailblazer</artifactId>
<packaging>jar</packaging>
<parent>
@@ -39,19 +39,6 @@
</descriptors>
</configuration>
</execution>
- <execution>
- <id>examples</id>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- <configuration>
- <appendAssemblyId>false</appendAssemblyId>
- <descriptors>
- <descriptor>scripts/assembly-examples-zip.xml</descriptor>
- </descriptors>
- </configuration>
- </execution>
</executions>
</plugin>
<plugin>
@@ -73,43 +60,9 @@
</execution>
</executions>
</plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-artifacts</id>
- <phase>package</phase>
- <goals>
- <goal>attach-artifact</goal>
- </goals>
- <configuration>
- <artifacts>
- <artifact>
- <file>target/${project.artifactId}-${project.version}.zip</file>
- <type>zip</type>
- </artifact>
- </artifacts>
- </configuration>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
- <!-- Repositories -->
- <repositories>
- <!--
- Also define the JBoss Repository here because
- the examples are distributed standalone
- -->
- <repository>
- <id>repository.jboss.org</id>
- <name>JBoss Repository</name>
- <url>http://repository.jboss.org/maven2</url>
- </repository>
- </repositories>
-
<!-- Profiles -->
<profiles>
</profiles>
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/scripts/antrun-test-jars.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-test-jars.xml 2009-05-09 13:25:16 UTC (rev 88577)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/scripts/antrun-test-jars.xml 2009-05-11 21:38:26 UTC (rev 88675)
@@ -40,26 +40,21 @@
<target name="build-test-jars" depends="init" description="Build the test deployments">
- <!-- Please add alphabetically -->
-
- <!-- http -->
- <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example-http.jar" files="${tests.resources.dir}/http/example-http.bnd" />
-
- <!-- jmx -->
- <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example-jmx.jar" files="${tests.resources.dir}/jmx/example-jmx.bnd" />
-
- <!-- jndi -->
- <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example-jndi.jar" files="${tests.resources.dir}/jndi/example-jndi.bnd" />
-
- <!-- log -->
- <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example-log.jar" files="${tests.resources.dir}/log/example-log.bnd" />
+ <!-- frontend -->
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/trailblazer-frontend.jar" files="${tests.resources.dir}/trailblazer/frontend.bnd" />
- <!-- mcservice -->
- <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example-mcservice-bundleA.jar" files="${tests.resources.dir}/mcservice/example-mcservice-bundleA.bnd" />
- <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example-mcservice-bundleB.jar" files="${tests.resources.dir}/mcservice/example-mcservice-bundleB.bnd" />
+ <!-- main -->
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/trailblazer-main.jar" files="${tests.resources.dir}/trailblazer/main.bnd" />
- <!-- Please add alphabetically -->
-
+ <!-- pay-creditcard -->
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/trailblazer-pay-creditcard.jar" files="${tests.resources.dir}/trailblazer/pay-creditcard.bnd" />
+
+ <!-- shop-sports -->
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/trailblazer-shop-sports.jar" files="${tests.resources.dir}/trailblazer/shop-sports.bnd" />
+
+ <!-- shop-pets -->
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/trailblazer-shop-pets.jar" files="${tests.resources.dir}/trailblazer/shop-pets.bnd" />
+
</target>
</project>
Deleted: projects/jboss-osgi/trunk/testsuite/trailblazer/scripts/assembly-examples-zip.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-examples-zip.xml 2009-05-09 13:25:16 UTC (rev 88577)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/scripts/assembly-examples-zip.xml 2009-05-11 21:38:26 UTC (rev 88675)
@@ -1,19 +0,0 @@
-<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
- <id>examples</id>
- <formats>
- <format>zip</format>
- </formats>
- <includeBaseDirectory>false</includeBaseDirectory>
- <fileSets>
- <fileSet>
- <directory></directory>
- <outputDirectory>example</outputDirectory>
- <includes>
- <include>scripts/**</include>
- <include>src/**</include>
- <include>pom.xml</include>
- </includes>
- </fileSet>
- </fileSets>
-</assembly>
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java 2009-05-09 13:25:16 UTC (rev 88577)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java 2009-05-11 21:38:26 UTC (rev 88675)
@@ -1,114 +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.test.osgi.example.http;
-
-//$Id: HttpServiceRemoteTestCase.java 87330 2009-04-15 10:57:57Z thomas.diesler at jboss.com $
-
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-import java.net.URL;
-
-import org.jboss.osgi.spi.testing.AbstractBundle;
-import org.jboss.osgi.spi.testing.ConfigAdminCapability;
-import org.jboss.osgi.spi.testing.HttpCapability;
-import org.jboss.osgi.spi.testing.OSGiRuntime;
-import org.jboss.osgi.spi.testing.OSGiTest;
-import org.jboss.osgi.spi.testing.OSGiTestSetup;
-
-import junit.framework.Test;
-
-/**
- * A test that deployes a bundle that containes a HttpServlet which
- * is registered through the OSGi HttpService
- *
- * @author thomas.diesler at jboss.com
- * @since 23-Jan-2009
- */
-public class HttpServiceTestCase extends OSGiTest
-{
- private static OSGiRuntime runtime;
- private static AbstractBundle testBundle;
-
- public static Test suite()
- {
- OSGiTestSetup testSetup = new OSGiTestSetup(HttpServiceTestCase.class)
- {
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- runtime = getDefaultRuntime();
- runtime.addCapability(new ConfigAdminCapability());
- runtime.addCapability(new HttpCapability());
-
- Thread.sleep(500);
-
- testBundle = runtime.installBundle("example-http.jar");
- testBundle.start();
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- testBundle.uninstall();
- runtime.shutdown();
- super.tearDown();
- }
- };
- return testSetup;
- }
-
- public void testServletAccess() throws Exception
- {
- URL url = new URL("http://" + runtime.getServerHost() + ":8090/servlet?test=plain");
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- assertEquals("Hello from Servlet", br.readLine());
- }
-
- public void testServletInitProps() throws Exception
- {
- URL url = new URL("http://" + runtime.getServerHost() + ":8090/servlet?test=initProp");
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- assertEquals("initProp=SomeValue", br.readLine());
- }
-
- public void testServletBundleContext() throws Exception
- {
- URL url = new URL("http://" + runtime.getServerHost() + ":8090/servlet?test=context");
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- assertEquals("example-http", br.readLine());
- }
-
- public void testServletStartLevel() throws Exception
- {
- URL url = new URL("http://" + runtime.getServerHost() + ":8090/servlet?test=startLevel");
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- assertEquals("startLevel=1", br.readLine());
- }
-
- public void testResourceAccess() throws Exception
- {
- URL url = new URL("http://" + runtime.getServerHost() + ":8090/file/message.txt");
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- assertEquals("Hello from Resource", br.readLine());
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/example/jmx/JMXTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/JMXTestCase.java 2009-05-09 13:25:16 UTC (rev 88577)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/example/jmx/JMXTestCase.java 2009-05-11 21:38:26 UTC (rev 88675)
@@ -1,97 +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.test.osgi.example.jmx;
-
-//$Id: JMXTestCase.java 88356 2009-05-07 13:13:26Z thomas.diesler at jboss.com $
-
-import javax.management.MBeanServerConnection;
-import javax.management.ObjectName;
-import javax.naming.InitialContext;
-
-import junit.framework.Test;
-
-import org.jboss.osgi.spi.management.MBeanProxy;
-import org.jboss.osgi.spi.testing.AbstractBundle;
-import org.jboss.osgi.spi.testing.OSGiRuntime;
-import org.jboss.osgi.spi.testing.JMXCapability;
-import org.jboss.osgi.spi.testing.JNDICapability;
-import org.jboss.osgi.spi.testing.OSGiTest;
-import org.jboss.osgi.spi.testing.OSGiTestSetup;
-import org.jboss.test.osgi.example.jmx.bundle.FooMBean;
-
-/**
- * A test that deployes a bundle that registeres an MBean
- *
- * @author thomas.diesler at jboss.com
- * @since 12-Feb-2009
- */
-public class JMXTestCase extends OSGiTest
-{
- private static OSGiRuntime runtime;
- private static AbstractBundle bundle;
-
- public static Test suite()
- {
- OSGiTestSetup setup = new OSGiTestSetup(JMXTestCase.class)
- {
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- runtime = getDefaultRuntime();
- runtime.addCapability(new JNDICapability());
- runtime.addCapability(new JMXCapability());
-
- bundle = runtime.installBundle("example-jmx.jar");
- bundle.start();
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- bundle.uninstall();
- runtime.shutdown();
- super.tearDown();
- }
- };
- return setup;
- }
-
- public void testMBeanAccess() throws Exception
- {
- ObjectName oname = new ObjectName("jboss.osgi:service=mbean-test-service");
- FooMBean foo = (FooMBean)MBeanProxy.get(FooMBean.class, oname, runtime.getMBeanServer());
- assertEquals("hello", foo.echo("hello"));
- }
-
- public void testRMIAdaptor() throws Exception
- {
- // Lookup the MBeanServerConnection
- InitialContext iniCtx = runtime.getInitialContext();
- MBeanServerConnection rmiAdaptor = (MBeanServerConnection)iniCtx.lookup("jmx/invoker/RMIAdaptor");
-
- // Access the MBean through the MBeanServerConnection
- ObjectName oname = new ObjectName("jboss.osgi:service=mbean-test-service");
- FooMBean foo = (FooMBean)MBeanProxy.get(FooMBean.class, oname, rmiAdaptor);
- assertEquals("hello", foo.echo("hello"));
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/example/jndi/JNDITestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jndi/JNDITestCase.java 2009-05-09 13:25:16 UTC (rev 88577)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/example/jndi/JNDITestCase.java 2009-05-11 21:38:26 UTC (rev 88675)
@@ -1,94 +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.test.osgi.example.jndi;
-
-//$Id: JNDITestCase.java 88356 2009-05-07 13:13:26Z thomas.diesler at jboss.com $
-
-import javax.naming.InitialContext;
-import javax.naming.NameNotFoundException;
-
-import junit.framework.Test;
-
-import org.jboss.osgi.spi.testing.AbstractBundle;
-import org.jboss.osgi.spi.testing.OSGiRuntime;
-import org.jboss.osgi.spi.testing.JNDICapability;
-import org.jboss.osgi.spi.testing.OSGiTest;
-import org.jboss.osgi.spi.testing.OSGiTestSetup;
-import org.osgi.framework.Bundle;
-
-/**
- * A test that deployes a bundle that binds a String to JNDI
- *
- * @author thomas.diesler at jboss.com
- * @since 05-May-2009
- */
-public class JNDITestCase extends OSGiTest
-{
- private static OSGiRuntime runtime;
-
- public static Test suite()
- {
- OSGiTestSetup setup = new OSGiTestSetup(JNDITestCase.class)
- {
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- runtime = getDefaultRuntime();
- runtime.addCapability(new JNDICapability());
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- runtime.shutdown();
- super.tearDown();
- }
- };
- return setup;
- }
-
- public void testJNDIAccess() throws Exception
- {
- AbstractBundle bundle = runtime.installBundle("example-jndi.jar");
- bundle.start();
-
- assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
-
- InitialContext iniCtx = runtime.getInitialContext();
- String lookup = (String)iniCtx.lookup("test/Foo");
- assertEquals("JNDI bound String expected", "Bar", lookup);
-
- // Uninstall should unbind the object
- bundle.uninstall();
-
- try
- {
- iniCtx.lookup("test/Foo");
- fail("NameNotFoundException expected");
- }
- catch (NameNotFoundException ex)
- {
- // expected
- }
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java 2009-05-09 13:25:16 UTC (rev 88577)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java 2009-05-11 21:38:26 UTC (rev 88675)
@@ -1,86 +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.test.osgi.example.log;
-
-//$Id: LogServiceTestCase.java 87330 2009-04-15 10:57:57Z thomas.diesler at jboss.com $
-
-import java.util.List;
-
-import org.jboss.osgi.spi.logging.LogEntryCache;
-import org.jboss.osgi.spi.logging.LogEntryFilter;
-import org.jboss.osgi.spi.testing.AbstractBundle;
-import org.jboss.osgi.spi.testing.OSGiRuntime;
-import org.jboss.osgi.spi.testing.OSGiTest;
-import org.osgi.framework.Bundle;
-import org.osgi.service.log.LogEntry;
-import org.osgi.service.log.LogService;
-
-/**
- * This example demonstrates the usage of the {@link LogService}
- *
- * @author thomas.diesler at jboss.com
- * @since 09-Apr-2009
- */
-public class LogServiceTestCase extends OSGiTest
-{
- private LogEntryCache logEntryCache;
- private OSGiRuntime runtime;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- runtime = getDefaultRuntime();
- logEntryCache = new LogEntryCache(new LogEntryFilter("example-log(.*)", LogService.LOG_INFO, "\\[ServiceA\\](.*)"));
- runtime.startLogEntryTracking(logEntryCache);
- }
-
-
- @Override
- protected void tearDown() throws Exception
- {
- runtime.shutdown();
- super.tearDown();
- }
-
- public void testLogEntryFilter() throws Exception
- {
- // Install and start the test bundle
- AbstractBundle bundleA = runtime.installBundle("example-log.jar");
- bundleA.start();
-
- // Verify that the bundle is active
- assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundleA.getState());
-
- // Wait a little for the asynchronous log entry to arrive
- Thread.sleep(200);
-
- // Uninstall the test bundle
- bundleA.uninstall();
-
- // Verify the received log entries
- List<LogEntry> entries = logEntryCache.getLog();
- assertEquals("Number of entries", 1, entries.size());
- assertEquals("[ServiceA] new Service", entries.get(0).getMessage());
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.java 2009-05-09 13:25:16 UTC (rev 88577)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.java 2009-05-11 21:38:26 UTC (rev 88675)
@@ -1,125 +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.test.osgi.example.microcontainer;
-
-//$Id$
-
-import static org.jboss.osgi.microcontainer.MicrocontainerService.BEAN_KERNEL;
-import static org.jboss.osgi.microcontainer.MicrocontainerService.BEAN_MBEAN_SERVER;
-import static org.jboss.osgi.microcontainer.MicrocontainerService.BEAN_SYSTEM_BUNDLE_CONTEXT;
-import static org.jboss.osgi.microcontainer.MicrocontainerServiceMBean.MBEAN_MICROCONTAINER_SERVICE;
-import static org.jboss.osgi.spi.management.ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK;
-
-import java.util.List;
-import java.util.Set;
-
-import javax.management.ObjectName;
-
-import junit.framework.Test;
-
-import org.jboss.osgi.microcontainer.MicrocontainerServiceMBean;
-import org.jboss.osgi.spi.management.ManagedFrameworkMBean;
-import org.jboss.osgi.spi.testing.JMXCapability;
-import org.jboss.osgi.spi.testing.JNDICapability;
-import org.jboss.osgi.spi.testing.MicrocontainerCapability;
-import org.jboss.osgi.spi.testing.OSGiRuntime;
-import org.jboss.osgi.spi.testing.OSGiTest;
-import org.jboss.osgi.spi.testing.OSGiTestSetup;
-
-/**
- * A test that checks whether the MicrocontainerService can be accessed
- *
- * @author thomas.diesler at jboss.com
- * @since 12-Feb-2009
- */
-public class MicrocontainerTestCase extends OSGiTest
-{
- private static OSGiRuntime runtime;
-
- public static Test suite()
- {
- OSGiTestSetup setup = new OSGiTestSetup(MicrocontainerTestCase.class)
- {
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- runtime = getDefaultRuntime();
- runtime.addCapability(new JNDICapability());
- runtime.addCapability(new JMXCapability());
- runtime.addCapability(new MicrocontainerCapability());
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- runtime.shutdown();
- super.tearDown();
- }
- };
- return setup;
- }
-
- public void testServiceAccess() throws Exception
- {
- MicrocontainerServiceMBean mcService = runtime.getMBeanProxy(MicrocontainerServiceMBean.class, MBEAN_MICROCONTAINER_SERVICE);
- List<String> registeredBeans = mcService.getRegisteredBeans();
- assertTrue("BundleContext registered with MC", registeredBeans.contains(BEAN_SYSTEM_BUNDLE_CONTEXT));
- assertTrue("MBeanServer registered with MC", registeredBeans.contains(BEAN_MBEAN_SERVER));
- assertTrue("Kernel registered with MC", registeredBeans.contains(BEAN_KERNEL));
- }
-
- /**
- * Test whether the bundle can be deployed through the MicrocontainerServiceMBean
- */
- public void testBundleDeployment() throws Exception
- {
- MicrocontainerServiceMBean mcService = runtime.getMBeanProxy(MicrocontainerServiceMBean.class, MBEAN_MICROCONTAINER_SERVICE);
- mcService.deploy(getTestArchiveURL("example-mcservice-bundleA.jar"));
-
- ManagedFrameworkMBean frameworkMBean = runtime.getMBeanProxy(ManagedFrameworkMBean.class, MBEAN_MANAGED_FRAMEWORK);
- Set<ObjectName> bundles = frameworkMBean.getBundles();
- assertTrue("Managed bundle registered", bundles.toString().indexOf("jboss.osgi:bundle=example-mcservice-bundleA") > 0);
-
- mcService.undeploy(getTestArchiveURL("example-mcservice-bundleA.jar"));
-}
-
- public void testBeansDeployment() throws Exception
- {
- MicrocontainerServiceMBean mcService = runtime.getMBeanProxy(MicrocontainerServiceMBean.class, MBEAN_MICROCONTAINER_SERVICE);
- mcService.deploy(getTestArchiveURL("example-mcservice-bundleB.jar"));
-
- ManagedFrameworkMBean frameworkMBean = runtime.getMBeanProxy(ManagedFrameworkMBean.class, MBEAN_MANAGED_FRAMEWORK);
- Set<ObjectName> bundles = frameworkMBean.getBundles();
- assertTrue("Managed bundle registered", bundles.toString().indexOf("jboss.osgi:bundle=example-mcservice-bundleB") > 0);
-
- // Check whether the bean is registered
- List<String> registeredBeans = mcService.getRegisteredBeans();
- assertTrue("SomeBean registered", registeredBeans.contains("SomeBean"));
-
- mcService.undeploy(getTestArchiveURL("example-mcservice-bundleB.jar"));
-
- // Check whether the bean is unregistered
- registeredBeans = mcService.getRegisteredBeans();
- assertFalse("SomeBean unregistered", registeredBeans.contains("SomeBean"));
- }
-}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/AuditService.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/AuditService.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/AuditService.java 2009-05-11 21:38:26 UTC (rev 88675)
@@ -0,0 +1,17 @@
+package org.jboss.test.osgi.trailblazer;
+
+import org.jboss.test.osgi.trailblazer.types.Product;
+
+
+/**
+ * [TODO]
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 10-May-2009
+ */
+public interface AuditService
+{
+ int getTotalPurchases();
+
+ void purchaseProduct(Product product);
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/AuditService.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/PaymentService.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/PaymentService.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/PaymentService.java 2009-05-11 21:38:26 UTC (rev 88675)
@@ -0,0 +1,14 @@
+package org.jboss.test.osgi.trailblazer;
+
+import java.util.Collection;
+
+/**
+ * [TODO]
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 10-May-2009
+ */
+public interface PaymentService
+{
+ Collection<String> listPaymentTypes();
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/PaymentService.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/Shop.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/Shop.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/Shop.java 2009-05-11 21:38:26 UTC (rev 88675)
@@ -0,0 +1,41 @@
+package org.jboss.test.osgi.trailblazer;
+
+import java.util.Collection;
+
+import org.jboss.test.osgi.trailblazer.types.Product;
+
+/**
+ * A {@link Shop} represents and individual shop implementation.
+ * <p/>
+ * The trailblazer supports multiple shops. Each shop maintains a collection of
+ * {@link Products}s and a {@link PaymentService}
+ * <p/>
+ * Shops can get registered and unregistered at any time.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 10-May-2009
+ */
+public interface Shop
+{
+ /**
+ * Get the name of the shop
+ */
+ String getName();
+
+ /**
+ * Get the product list
+ * @return an empty collection if there are no products
+ */
+ Collection<Product> getProductList();
+
+ /**
+ * Get a product by name
+ * @return null if the product does not exist
+ */
+ Product getProductByName(String name);
+
+ /**
+ * Get the associated payment service.
+ */
+ PaymentService getPaymentService();
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/Shop.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/ShoppingMall.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/ShoppingMall.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/ShoppingMall.java 2009-05-11 21:38:26 UTC (rev 88675)
@@ -0,0 +1,29 @@
+package org.jboss.test.osgi.trailblazer;
+
+import java.util.Collection;
+
+import org.jboss.test.osgi.trailblazer.types.Product;
+
+/**
+ * [TODO]
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 10-May-2009
+ */
+public interface ShoppingMall
+{
+ /**
+ * Get the collection of currently registered shops.
+ */
+ Collection<Shop> getShops();
+
+ /**
+ * Get a shop by name.
+ */
+ Shop getShopByName(String shopName);
+
+ /**
+ * Purchase a product
+ */
+ void purchaseProduct(Product product);
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/ShoppingMall.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/HttpRenderServlet.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/HttpRenderServlet.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/HttpRenderServlet.java 2009-05-11 21:38:26 UTC (rev 88675)
@@ -0,0 +1,148 @@
+/*
+ * 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.test.osgi.trailblazer.frontend;
+
+//$Id$
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.test.osgi.trailblazer.ShoppingMall;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.http.HttpService;
+import org.osgi.service.log.LogService;
+import org.osgi.util.tracker.ServiceTracker;
+
+
+/**
+ * A servlet that gets registered with the {@link HttpService} to
+ * render an implementation of the {@link ShoppingMall}
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 10-May-2009
+ */
+ at SuppressWarnings("serial")
+public class HttpRenderServlet extends HttpServlet
+{
+ private LogService log;
+
+ private ShoppingMall mallService;
+
+ public HttpRenderServlet(BundleContext context)
+ {
+ this.log = new LogServiceTracker(context);
+
+ ServiceTracker tracker = new ServiceTracker(context, ShoppingMall.class.getName(), null)
+ {
+ @Override
+ public Object addingService(ServiceReference reference)
+ {
+ log.log(LogService.LOG_INFO, "ShoppingMallService added");
+ mallService = (ShoppingMall)super.addingService(reference);
+ return mallService;
+ }
+
+ @Override
+ public void removedService(ServiceReference reference, Object service)
+ {
+ super.removedService(reference, service);
+ log.log(LogService.LOG_INFO, "ShoppingMallService removed");
+ mallService = null;
+ }
+ };
+ tracker.open();
+ }
+
+ @Override
+ protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
+ {
+ PrintWriter out = res.getWriter();
+
+ String path = req.getPathInfo();
+ if (path == null)
+ path = "/";
+
+ log.log(LogService.LOG_INFO, "doGet "+ path);
+
+ renderHeader(req, res);
+
+ if (mallService != null)
+ {
+ RequestHandler reqHandler = new RequestHandler(mallService);
+ if (path.startsWith("/list"))
+ {
+ reqHandler.renderListPage(req, res);
+ }
+ else if (path.startsWith("/buy"))
+ {
+ reqHandler.actionAddToCart(req, res);
+ reqHandler.renderCartPage(req, res);
+ }
+ else if (path.startsWith("/clear"))
+ {
+ reqHandler.actionClearProducts(req, res);
+ reqHandler.renderCartPage(req, res);
+ }
+ else if (path.startsWith("/checkout"))
+ {
+ reqHandler.actionCheckout(req, res);
+ reqHandler.actionClearProducts(req, res);
+ reqHandler.renderConfirmPage(req, res);
+ }
+ else if (path.startsWith("/cart"))
+ {
+ reqHandler.renderCartPage(req, res);
+ }
+ else
+ {
+ reqHandler.renderHomePage(req, res);
+ }
+ }
+ else
+ {
+ out.println("No mall service available, please try later.");
+ }
+ renderFooter(req, res);
+
+ out.close();
+ }
+
+ private void renderHeader(HttpServletRequest req, HttpServletResponse res) throws IOException
+ {
+ PrintWriter out = res.getWriter();
+ out.println("<a href='" + req.getServletPath() + "'>home</a>");
+ out.println("<a href='" + req.getServletPath() + "/cart'>cart</a>");
+ out.println("<p/>");
+ }
+
+ private void renderFooter(HttpServletRequest req, HttpServletResponse res)
+ {
+ }
+
+}
Property changes on: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/HttpRenderServlet.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/RequestHandler.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/RequestHandler.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/RequestHandler.java 2009-05-11 21:38:26 UTC (rev 88675)
@@ -0,0 +1,198 @@
+/*
+ * 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.test.osgi.trailblazer.frontend;
+
+//$Id$
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.Collection;
+import java.util.Set;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.jboss.test.osgi.trailblazer.PaymentService;
+import org.jboss.test.osgi.trailblazer.Shop;
+import org.jboss.test.osgi.trailblazer.ShoppingMall;
+import org.jboss.test.osgi.trailblazer.types.Product;
+
+/**
+ * [TODO]
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 10-May-2009
+ */
+public class RequestHandler
+{
+ private ShoppingMall mallService;
+
+ public RequestHandler(ShoppingMall mallService)
+ {
+ this.mallService = mallService;
+ }
+
+ public void renderHomePage(HttpServletRequest req, HttpServletResponse res) throws IOException
+ {
+ PrintWriter out = res.getWriter();
+ out.println("<h1>Welcome to the Mall</h1>");
+
+ Collection<Shop> activeShops = mallService.getShops();
+ if (activeShops.size() > 0)
+ {
+ for (Shop shop : activeShops)
+ {
+ String shopName = shop.getName();
+ out.println("<a href='" + req.getServletPath() + "/list?shop=" + shopName + "'>" + shopName + "</a>");
+ out.println("<br>");
+ }
+ }
+ else
+ {
+ out.println("No active shops available, please try later.");
+ }
+ }
+
+ public void renderListPage(HttpServletRequest req, HttpServletResponse res) throws IOException
+ {
+ PrintWriter out = res.getWriter();
+
+ Shop shop = getShopFromRequestParam(req);
+
+ out.println("<h2>" + shop.getName() + "</h2");
+
+ out.println("<table>");
+ out.println("<tr><th>Product</th><th>Price</th></tr>");
+ for (Product p : shop.getProductList())
+ {
+ StringBuffer price = new StringBuffer(p.getPrice().toString());
+ price.insert(price.length() - 2, ".");
+
+ out.println("<tr>");
+ out.println("<td>" + p.getName() + "</td><td>" + price + "</td>");
+ out.println("<td><a href='" + req.getServletPath() + "/buy?shop=" + shop.getName() + "&name=" + p.getName() + "'>buy</a></td>");
+ out.println("</tr>");
+ }
+ out.println("</table>");
+ }
+
+ public void renderConfirmPage(HttpServletRequest req, HttpServletResponse res) throws IOException
+ {
+ PrintWriter out = res.getWriter();
+ out.println("Thanks for shopping with us");
+ }
+
+ public void renderCartPage(HttpServletRequest req, HttpServletResponse res) throws IOException
+ {
+ PrintWriter out = res.getWriter();
+
+ out.println("<h2>Shopping Cart</h2>");
+
+ ShoppingCart shoppingCart = ShoppingCart.getShoppingCart(req);
+ Set<Shop> shops = shoppingCart.getShops();
+ if (shops.size() == 0)
+ {
+ out.println("Your shopping cart is empty");
+ return;
+ }
+
+ for (Shop shop : shops)
+ {
+ Integer total = new Integer(0);
+
+ String shopName = shop.getName();
+ out.println("<h4><a href='" + req.getServletPath() + "/list?shop=" + shopName + "'>" + shopName + "</a></h4>");
+ out.println("<table>");
+ out.println("<tr><th>Product</th><th>Price</th></tr>");
+ for (Product p : shoppingCart.getProductsByShop(shop))
+ {
+ StringBuffer price = new StringBuffer(p.getPrice().toString());
+ price.insert(price.length() - 2, ".");
+ out.println("<tr>");
+ out.println("<td>" + p.getName() + "</td><td>" + price + "</td>");
+ out.println("</tr>");
+
+ total += p.getPrice();
+ }
+
+ StringBuffer totalStr = new StringBuffer(total.toString());
+ totalStr.insert(totalStr.length() - 2, ".");
+ out.println("<tr><td>Total</td><th>" + totalStr + "</th></tr>");
+ out.println("</table>");
+ out.println("<p/>");
+
+ PaymentService payService = shop.getPaymentService();
+ if (payService != null)
+ {
+ out.println("<a href='" + req.getServletPath() + "/clear?shop=" + shopName + "'>Clear<a/> products or pay using: ");
+ for (String type : payService.listPaymentTypes())
+ {
+ out.println("<a href='" + req.getServletPath() + "/checkout?shop=" + shopName + "&pay=" + type + "'>" + type + "</a> ");
+ }
+ }
+ else
+ {
+ out.println("Payment service not available, please try later.");
+ }
+ }
+ out.println("<p/>");
+
+ }
+
+ public void actionAddToCart(HttpServletRequest req, HttpServletResponse res)
+ {
+ Shop shopService = getShopFromRequestParam(req);
+ String name = req.getParameter("name");
+ Product prod = shopService.getProductByName(name);
+ if (prod == null)
+ throw new IllegalArgumentException("Invalid product name: " + name);
+
+ ShoppingCart shoppingCart = ShoppingCart.getShoppingCart(req);
+ shoppingCart.addToCart(prod);
+ }
+
+ public void actionCheckout(HttpServletRequest req, HttpServletResponse res)
+ {
+ Shop shop = getShopFromRequestParam(req);
+ ShoppingCart shoppingCart = ShoppingCart.getShoppingCart(req);
+ for (Product prod : shoppingCart.getProductsByShop(shop))
+ {
+ mallService.purchaseProduct(prod);
+ }
+ }
+
+ public void actionClearProducts(HttpServletRequest req, HttpServletResponse res)
+ {
+ Shop shop = getShopFromRequestParam(req);
+ ShoppingCart shoppingCart = ShoppingCart.getShoppingCart(req);
+ shoppingCart.clearProductsByShop(shop);
+ }
+
+ private Shop getShopFromRequestParam(HttpServletRequest req)
+ {
+ String shopName = req.getParameter("shop");
+ Shop shop = mallService.getShopByName(shopName);
+ if (shop == null)
+ throw new IllegalArgumentException("Invalid request for shop: " + shopName);
+ return shop;
+ }
+}
Property changes on: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/RequestHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/ServiceActivator.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/ServiceActivator.java 2009-05-11 21:38:26 UTC (rev 88675)
@@ -0,0 +1,94 @@
+/*
+ * 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.test.osgi.trailblazer.frontend;
+
+//$Id$
+
+import org.jboss.osgi.common.log.LogServiceTracker;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.http.HttpService;
+import org.osgi.service.log.LogService;
+import org.osgi.util.tracker.ServiceTracker;
+
+/**
+ * A bundle activator that uses the {@link ServiceTracker}
+ * to registers the {@link HttpRenderServlet} with the {@link HttpService}
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 10-May-2009
+ */
+public class ServiceActivator implements BundleActivator
+{
+ private static final String CONTEXT_PATH = "/osgishop";
+
+ private HttpService httpService;
+ private LogService log;
+
+ public void start(BundleContext context)
+ {
+ this.log = new LogServiceTracker(context);
+
+ log.log(LogService.LOG_INFO, "Start HttpService tracking");
+ ServiceTracker tracker = new ServiceTracker(context, HttpService.class.getName(), null)
+ {
+ @Override
+ public Object addingService(ServiceReference reference)
+ {
+ httpService = (HttpService)super.addingService(reference);
+ try
+ {
+ log.log(LogService.LOG_INFO, "Register " + CONTEXT_PATH);
+ HttpRenderServlet servlet = new HttpRenderServlet(context);
+ httpService.registerServlet(CONTEXT_PATH, servlet, null, null);
+ }
+ catch (Exception ex)
+ {
+ throw new IllegalStateException("Cannot register: " + CONTEXT_PATH, ex);
+ }
+ return httpService;
+ }
+
+ @Override
+ public void removedService(ServiceReference reference, Object service)
+ {
+ super.removedService(reference, service);
+
+ log.log(LogService.LOG_INFO, "Unregister " + CONTEXT_PATH);
+ httpService.unregister(CONTEXT_PATH);
+ httpService = null;
+ }
+ };
+ tracker.open();
+ }
+
+ public void stop(BundleContext context)
+ {
+ if (httpService != null)
+ {
+ log.log(LogService.LOG_INFO, "Unregister " + CONTEXT_PATH);
+ httpService.unregister(CONTEXT_PATH);
+ httpService = null;
+ }
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/ServiceActivator.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/ShoppingCart.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/ShoppingCart.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/ShoppingCart.java 2009-05-11 21:38:26 UTC (rev 88675)
@@ -0,0 +1,91 @@
+/*
+ * 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.test.osgi.trailblazer.frontend;
+
+//$Id$
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+
+import org.jboss.test.osgi.trailblazer.Shop;
+import org.jboss.test.osgi.trailblazer.types.Product;
+
+/**
+ * A basic implementation of a shopping cart that is maintained in the user session
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 10-May-2009
+ */
+public class ShoppingCart
+{
+ private Map<Shop, List<Product>> content = new HashMap<Shop, List<Product>>();
+
+ // Hide ctor
+ private ShoppingCart()
+ {
+ }
+
+ static ShoppingCart getShoppingCart(HttpServletRequest req)
+ {
+ HttpSession session = req.getSession(true);
+ ShoppingCart content = (ShoppingCart)session.getAttribute("cart");
+ if (content == null)
+ {
+ content = new ShoppingCart();
+ session.setAttribute("cart", content);
+ }
+ return content;
+ }
+
+ Set<Shop> getShops()
+ {
+ return content.keySet();
+ }
+
+ List<Product> getProductsByShop(Shop shop)
+ {
+ List<Product> products = content.get(shop);
+ if (products == null)
+ {
+ products = new ArrayList<Product>();
+ content.put(shop, products);
+ }
+ return products;
+ }
+
+ void clearProductsByShop(Shop shop)
+ {
+ content.remove(shop);
+ }
+
+ void addToCart(Product product)
+ {
+ List<Product> products = getProductsByShop(product.getShop());
+ products.add(product);
+ }
+}
Property changes on: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/ShoppingCart.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/main/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/main/ServiceActivator.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/main/ServiceActivator.java 2009-05-11 21:38:26 UTC (rev 88675)
@@ -0,0 +1,64 @@
+/*
+ * 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.test.osgi.trailblazer.main;
+
+//$Id$
+
+import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.test.osgi.trailblazer.ShoppingMall;
+import org.jboss.test.osgi.trailblazer.frontend.HttpRenderServlet;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+import org.osgi.service.http.HttpService;
+import org.osgi.service.log.LogService;
+
+/**
+ * A bundle activator that registers the {@link HttpRenderServlet} with the {@link HttpService}
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 10-May-2009
+ */
+public class ServiceActivator implements BundleActivator
+{
+ private LogService log;
+ private ServiceRegistration registration;
+
+ public void start(BundleContext context)
+ {
+ this.log = new LogServiceTracker(context);
+
+ log.log(LogService.LOG_INFO, "Register ShoppingMallService");
+ ShoppingMallImpl mallService = new ShoppingMallImpl(context);
+ registration = context.registerService(ShoppingMall.class.getName(), mallService, null);
+ }
+
+ public void stop(BundleContext context)
+ {
+ if (registration != null)
+ {
+ log.log(LogService.LOG_INFO, "Unregister ShoppingMallService");
+ registration.unregister();
+ registration = null;
+ }
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/main/ServiceActivator.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/main/ShoppingMallImpl.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/main/ShoppingMallImpl.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/main/ShoppingMallImpl.java 2009-05-11 21:38:26 UTC (rev 88675)
@@ -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.test.osgi.trailblazer.main;
+
+//$Id$
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.jboss.test.osgi.trailblazer.AuditService;
+import org.jboss.test.osgi.trailblazer.PaymentService;
+import org.jboss.test.osgi.trailblazer.Shop;
+import org.jboss.test.osgi.trailblazer.ShoppingMall;
+import org.jboss.test.osgi.trailblazer.frontend.HttpRenderServlet;
+import org.jboss.test.osgi.trailblazer.types.Product;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.http.HttpService;
+
+/**
+ * A bundle activator that registers the {@link HttpRenderServlet} with the {@link HttpService}
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 10-May-2009
+ */
+public class ShoppingMallImpl implements ShoppingMall
+{
+ private BundleContext context;
+
+ public ShoppingMallImpl(BundleContext context)
+ {
+ this.context = context;
+ }
+
+ public Shop getShopByName(String shopName)
+ {
+ Shop shop = null;
+ for (Shop aux : getShops())
+ {
+ if (aux.getName().equals(shopName))
+ {
+ shop = aux;
+ break;
+ }
+ }
+ return shop;
+ }
+
+ public Collection<Shop> getShops()
+ {
+ Collection<Shop> shops = new ArrayList<Shop>();
+ try
+ {
+ ServiceReference[] shoprefs = context.getServiceReferences(Shop.class.getName(), null);
+ if (shoprefs != null)
+ {
+ for(ServiceReference sref : shoprefs)
+ {
+ shops.add((Shop)context.getService(sref));
+ }
+ }
+ }
+ catch (InvalidSyntaxException ex)
+ {
+ // ignore, because we don't have a filter
+ }
+ return shops;
+ }
+
+ public void purchaseProduct(Product product)
+ {
+ Shop shop = product.getShop();
+ PaymentService paymentService = shop.getPaymentService();
+ if (paymentService == null)
+ throw new IllegalStateException("Payment service not available");
+
+ ServiceReference sref = context.getServiceReference(AuditService.class.getName());
+ if (sref != null)
+ {
+ AuditService auditService = (AuditService)context.getService(sref);
+ auditService.purchaseProduct(product);
+ }
+ }
+
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/main/ShoppingMallImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/creditcard/CreditCardServiceImpl.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/creditcard/CreditCardServiceImpl.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/creditcard/CreditCardServiceImpl.java 2009-05-11 21:38:26 UTC (rev 88675)
@@ -0,0 +1,24 @@
+package org.jboss.test.osgi.trailblazer.pay.creditcard;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.jboss.test.osgi.trailblazer.PaymentService;
+
+
+/**
+ * [TODO]
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 10-May-2009
+ */
+public class CreditCardServiceImpl implements PaymentService
+{
+ public Collection<String> listPaymentTypes()
+ {
+ ArrayList<String> list = new ArrayList<String>();
+ list.add("Visa");
+ list.add("MasterCard");
+ return list;
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/creditcard/CreditCardServiceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/creditcard/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/creditcard/ServiceActivator.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/creditcard/ServiceActivator.java 2009-05-11 21:38:26 UTC (rev 88675)
@@ -0,0 +1,62 @@
+/*
+ * 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.test.osgi.trailblazer.pay.creditcard;
+
+//$Id$
+
+import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.test.osgi.trailblazer.PaymentService;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+import org.osgi.service.log.LogService;
+
+
+/**
+ * [TODO]
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 10-May-2009
+ */
+public class ServiceActivator implements BundleActivator
+{
+ private LogService log;
+ private ServiceRegistration serviceReg;
+
+ public void start(BundleContext context)
+ {
+ this.log = new LogServiceTracker(context);
+
+ log.log(LogService.LOG_INFO, "Register the PaymentService");
+ serviceReg = context.registerService(PaymentService.class.getName(), new CreditCardServiceImpl(), null);
+ }
+
+ public void stop(BundleContext context)
+ {
+ if (serviceReg != null)
+ {
+ log.log(LogService.LOG_INFO, "Unregister the PaymentService");
+ serviceReg.unregister();
+ serviceReg = null;
+ }
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/creditcard/ServiceActivator.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/pets/PetStore.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/pets/PetStore.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/pets/PetStore.java 2009-05-11 21:38:26 UTC (rev 88675)
@@ -0,0 +1,84 @@
+/*
+ * 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.test.osgi.trailblazer.shop.pets;
+
+//$Id$
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.jboss.test.osgi.trailblazer.PaymentService;
+import org.jboss.test.osgi.trailblazer.Shop;
+import org.jboss.test.osgi.trailblazer.types.Product;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+/**
+ * [TODO]
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 10-May-2009
+ */
+public class PetStore implements Shop
+{
+ private BundleContext context;
+ private Map<String, Product> products = new LinkedHashMap<String, Product>();
+
+ public PetStore(BundleContext context)
+ {
+ this.context = context;
+ add(new Product(this, "Cat", 7500));
+ add(new Product(this, "Dog", 9500));
+ add(new Product(this, "Hamster", 500));
+ add(new Product(this, "Bird", 1500));
+ add(new Product(this, "Snail", 27500));
+ }
+
+ public String getName()
+ {
+ return "PetStore";
+ }
+
+ public Collection<Product> getProductList()
+ {
+ return Collections.unmodifiableCollection(products.values());
+ }
+
+ public Product getProductByName(String name)
+ {
+ return products.get(name);
+ }
+
+ private void add(Product p)
+ {
+ products.put(p.getName(), p);
+ }
+
+ public PaymentService getPaymentService()
+ {
+ ServiceReference sref = context.getServiceReference(PaymentService.class.getName());
+ return sref != null ? (PaymentService)context.getService(sref) : null;
+ }
+
+}
Property changes on: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/pets/PetStore.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/pets/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/pets/ServiceActivator.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/pets/ServiceActivator.java 2009-05-11 21:38:26 UTC (rev 88675)
@@ -0,0 +1,62 @@
+/*
+ * 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.test.osgi.trailblazer.shop.pets;
+
+//$Id$
+
+import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.test.osgi.trailblazer.Shop;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+import org.osgi.service.log.LogService;
+
+
+/**
+ * [TODO]
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 10-May-2009
+ */
+public class ServiceActivator implements BundleActivator
+{
+ private LogService log;
+ private ServiceRegistration serviceReg;
+
+ public void start(BundleContext context)
+ {
+ this.log = new LogServiceTracker(context);
+
+ log.log(LogService.LOG_INFO, "Register the PetStore");
+ serviceReg = context.registerService(Shop.class.getName(), new PetStore(context), null);
+ }
+
+ public void stop(BundleContext context)
+ {
+ if (serviceReg != null)
+ {
+ log.log(LogService.LOG_INFO, "Unregister the PetStore");
+ serviceReg.unregister();
+ serviceReg = null;
+ }
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/pets/ServiceActivator.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/sports/ClimbingStore.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/sports/ClimbingStore.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/sports/ClimbingStore.java 2009-05-11 21:38:26 UTC (rev 88675)
@@ -0,0 +1,87 @@
+/*
+ * 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.test.osgi.trailblazer.shop.sports;
+
+//$Id$
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.jboss.test.osgi.trailblazer.PaymentService;
+import org.jboss.test.osgi.trailblazer.Shop;
+import org.jboss.test.osgi.trailblazer.types.Product;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+
+
+/**
+ * [TODO]
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 10-May-2009
+ */
+public class ClimbingStore implements Shop
+{
+ private BundleContext context;
+ private Map<String, Product> products = new LinkedHashMap<String, Product>();
+
+ public ClimbingStore(BundleContext context)
+ {
+ this.context = context;
+ add(new Product(this, "Shoes", 9500));
+ add(new Product(this, "Chalk", 150));
+ add(new Product(this, "Harness", 7500));
+ add(new Product(this, "Rope", 13500));
+ add(new Product(this, "Pants", 7500));
+ add(new Product(this, "Shirt", 3500));
+ }
+
+ public String getName()
+ {
+ return "ClimbingStore";
+ }
+
+ public Collection<Product> getProductList()
+ {
+ return Collections.unmodifiableCollection(products.values());
+ }
+
+ public Product getProductByName(String name)
+ {
+ return products.get(name);
+ }
+
+ private void add(Product p)
+ {
+ products.put(p.getName(), p);
+ }
+
+ public PaymentService getPaymentService()
+ {
+ ServiceReference sref = context.getServiceReference(PaymentService.class.getName());
+ return sref != null ? (PaymentService)context.getService(sref) : null;
+ }
+
+}
Property changes on: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/sports/ClimbingStore.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/sports/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/sports/ServiceActivator.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/sports/ServiceActivator.java 2009-05-11 21:38:26 UTC (rev 88675)
@@ -0,0 +1,62 @@
+/*
+ * 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.test.osgi.trailblazer.shop.sports;
+
+//$Id$
+
+import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.test.osgi.trailblazer.Shop;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+import org.osgi.service.log.LogService;
+
+
+/**
+ * [TODO]
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 10-May-2009
+ */
+public class ServiceActivator implements BundleActivator
+{
+ private LogService log;
+ private ServiceRegistration serviceReg;
+
+ public void start(BundleContext context)
+ {
+ this.log = new LogServiceTracker(context);
+
+ log.log(LogService.LOG_INFO, "Register the ClimbingStore");
+ serviceReg = context.registerService(Shop.class.getName(), new ClimbingStore(context), null);
+ }
+
+ public void stop(BundleContext context)
+ {
+ if (serviceReg != null)
+ {
+ log.log(LogService.LOG_INFO, "Unregister the ClimbingStore");
+ serviceReg.unregister();
+ serviceReg = null;
+ }
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/sports/ServiceActivator.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/types/Product.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/types/Product.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/types/Product.java 2009-05-11 21:38:26 UTC (rev 88675)
@@ -0,0 +1,62 @@
+/*
+ * 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.test.osgi.trailblazer.types;
+
+import org.jboss.test.osgi.trailblazer.Shop;
+
+//$Id$
+
+
+/**
+ * [TODO]
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 10-May-2009
+ */
+public class Product
+{
+ private String name;
+ private Integer price;
+ private Shop shop;
+
+ public Product(Shop shop, String name, Integer price)
+ {
+ this.shop = shop;
+ this.name = name;
+ this.price = price;
+ }
+
+ public Shop getShop()
+ {
+ return shop;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public Integer getPrice()
+ {
+ return price;
+ }
+}
Property changes on: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/types/Product.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/jboss-osgi-felix.properties
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties 2009-05-09 13:25:16 UTC (rev 88577)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/jboss-osgi-felix.properties 2009-05-11 21:38:26 UTC (rev 88675)
@@ -1,51 +0,0 @@
-#
-# Properties read by the org.jboss.osgi.spi.framework.PropertiesBootstrapProvider
-#
-# $Id$
-#
-
-# The OSGiFramework implementation
-org.jboss.osgi.spi.framework.impl=org.jboss.osgi.felix.framework.FelixIntegration
-
-# Properties to configure the Framework
-org.osgi.framework.storage=${basedir}/target/osgi-store
-org.osgi.framework.storage.clean=onFirstInit
-
-# Framework bootdelegation
-org.osgi.framework.bootdelegation=org.osgi.service.log
-
-# Extra System Packages
-org.osgi.framework.system.packages.extra=\
- org.jboss.logging, \
- org.jboss.net.protocol, \
- org.jboss.osgi.spi, \
- org.jboss.osgi.spi.logging, \
- org.jboss.osgi.spi.management, \
- org.jboss.virtual, \
- org.jboss.virtual.plugins.registry, \
- org.jboss.virtual.plugins.context.jar, \
- org.jboss.virtual.plugins.vfs.helpers, \
- org.jboss.virtual.protocol, \
- org.osgi.framework;version\=1.4, \
- org.apache.log4j, \
- org.jboss.util, \
- org.jboss.util.id, \
- org.jboss.util.threadpool, \
- org.jboss.util.propertyeditor
-
-# These are needed by jboss-remoting
-# org.apache.log4j, \
-# org.jboss.util, \
-# org.jboss.util.id, \
-# org.jboss.util.threadpool, \
-# org.jboss.util.propertyeditor
-
-# Bundles that need to be installed with the Framework automatically
-org.jboss.osgi.spi.framework.autoInstall=\
- file://${test.archive.directory}/bundles/org.osgi.compendium.jar
-
-# Bundles that need to be started automatically
-org.jboss.osgi.spi.framework.autoStart=\
- file://${test.archive.directory}/bundles/org.apache.felix.log.jar \
- file://${test.archive.directory}/bundles/jboss-osgi-common.jar \
- file://${test.archive.directory}/bundles/jboss-osgi-logging.jar
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/jboss-osgi-framework.properties (from rev 88577, projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/jboss-osgi-framework.properties (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/jboss-osgi-framework.properties 2009-05-11 21:38:26 UTC (rev 88675)
@@ -0,0 +1,51 @@
+#
+# Properties read by the org.jboss.osgi.spi.framework.PropertiesBootstrapProvider
+#
+# $Id$
+#
+
+# The OSGiFramework implementation
+org.jboss.osgi.spi.framework.impl=org.jboss.osgi.felix.framework.FelixIntegration
+
+# Properties to configure the Framework
+org.osgi.framework.storage=${basedir}/target/osgi-store
+org.osgi.framework.storage.clean=onFirstInit
+
+# Framework bootdelegation
+org.osgi.framework.bootdelegation=org.osgi.service.log
+
+# Extra System Packages
+org.osgi.framework.system.packages.extra=\
+ org.jboss.logging, \
+ org.jboss.net.protocol, \
+ org.jboss.osgi.spi, \
+ org.jboss.osgi.spi.logging, \
+ org.jboss.osgi.spi.management, \
+ org.jboss.virtual, \
+ org.jboss.virtual.plugins.registry, \
+ org.jboss.virtual.plugins.context.jar, \
+ org.jboss.virtual.plugins.vfs.helpers, \
+ org.jboss.virtual.protocol, \
+ org.osgi.framework;version\=1.4, \
+ org.apache.log4j, \
+ org.jboss.util, \
+ org.jboss.util.id, \
+ org.jboss.util.threadpool, \
+ org.jboss.util.propertyeditor
+
+# These are needed by jboss-remoting
+# org.apache.log4j, \
+# org.jboss.util, \
+# org.jboss.util.id, \
+# org.jboss.util.threadpool, \
+# org.jboss.util.propertyeditor
+
+# Bundles that need to be installed with the Framework automatically
+org.jboss.osgi.spi.framework.autoInstall=\
+ file://${test.archive.directory}/bundles/org.osgi.compendium.jar
+
+# Bundles that need to be started automatically
+org.jboss.osgi.spi.framework.autoStart=\
+ file://${test.archive.directory}/bundles/org.apache.felix.log.jar \
+ file://${test.archive.directory}/bundles/jboss-osgi-common.jar \
+ file://${test.archive.directory}/bundles/jboss-osgi-logging.jar
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer (from rev 88577, projects/jboss-osgi/trunk/testsuite/example/src/test/resources/http)
Deleted: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/example-http.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/http/example-http.bnd 2009-05-09 13:25:16 UTC (rev 88577)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/example-http.bnd 2009-05-11 21:38:26 UTC (rev 88675)
@@ -1,6 +0,0 @@
-# bnd build -classpath target/test-classes -output target/test-libs/example/example-http.jar src/test/resources/example/http/example-http.bnd
-
-Bundle-SymbolicName: example-http
-Bundle-Activator: org.jboss.test.osgi.example.http.bundle.ServiceActivator
-Export-Package: org.jboss.test.osgi.example.http.bundle
-Include-Resource: res/message.txt=message.txt
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/frontend.bnd (from rev 88577, projects/jboss-osgi/trunk/testsuite/example/src/test/resources/http/example-http.bnd)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/frontend.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/frontend.bnd 2009-05-11 21:38:26 UTC (rev 88675)
@@ -0,0 +1,15 @@
+# bnd build -classpath target/test-classes -output target/test-libs/trailblazer-frontend.jar src/test/resources/trailblazer/frontend.bnd
+
+Bundle-SymbolicName: trailblazer-frontend
+Bundle-Activator: org.jboss.test.osgi.trailblazer.frontend.ServiceActivator
+Private-Package: org.jboss.test.osgi.trailblazer.frontend
+Import-Package: \
+ javax.servlet*, \
+ org.osgi.framework, \
+ org.osgi.service.http, \
+ org.osgi.service.log, \
+ org.osgi.util.tracker, \
+ org.jboss.osgi.common.log, \
+ org.jboss.test.osgi.trailblazer, \
+ org.jboss.test.osgi.trailblazer.types
+
Added: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/main.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/main.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/main.bnd 2009-05-11 21:38:26 UTC (rev 88675)
@@ -0,0 +1,6 @@
+# bnd build -classpath target/test-classes -output target/test-libs/trailblazer-main.jar src/test/resources/trailblazer/main.bnd
+
+Bundle-SymbolicName: trailblazer-main
+Bundle-Activator: org.jboss.test.osgi.trailblazer.main.ServiceActivator
+Private-Package: org.jboss.test.osgi.trailblazer.main
+Export-Package: org.jboss.test.osgi.trailblazer, org.jboss.test.osgi.trailblazer.types
Deleted: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/message.txt
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/http/message.txt 2009-05-09 13:25:16 UTC (rev 88577)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/message.txt 2009-05-11 21:38:26 UTC (rev 88675)
@@ -1 +0,0 @@
-Hello from Resource
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/pay-creditcard.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/pay-creditcard.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/pay-creditcard.bnd 2009-05-11 21:38:26 UTC (rev 88675)
@@ -0,0 +1,11 @@
+# bnd build -classpath target/test-classes -output target/test-libs/trailblazer-payment-creditcard.jar src/test/resources/trailblazer/payment-creditcard.bnd
+
+Bundle-SymbolicName: trailblazer-payment-creditcard
+Bundle-Activator: org.jboss.test.osgi.trailblazer.pay.creditcard.ServiceActivator
+Private-Package: org.jboss.test.osgi.trailblazer.pay.creditcard
+Import-Package: \
+ org.osgi.framework, \
+ org.osgi.service.log, \
+ org.jboss.osgi.common.log, \
+ org.jboss.test.osgi.trailblazer, \
+ org.jboss.test.osgi.trailblazer.types
Added: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/shop-pets.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/shop-pets.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/shop-pets.bnd 2009-05-11 21:38:26 UTC (rev 88675)
@@ -0,0 +1,11 @@
+# bnd build -classpath target/test-classes -output target/test-libs/trailblazer-shop-pets.jar src/test/resources/trailblazer/shop-pets.bnd
+
+Bundle-SymbolicName: trailblazer-shop-pets
+Bundle-Activator: org.jboss.test.osgi.trailblazer.shop.pets.ServiceActivator
+Private-Package: org.jboss.test.osgi.trailblazer.shop.pets
+Import-Package: \
+ org.osgi.framework, \
+ org.osgi.service.log, \
+ org.jboss.osgi.common.log, \
+ org.jboss.test.osgi.trailblazer, \
+ org.jboss.test.osgi.trailblazer.types
Added: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/shop-sports.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/shop-sports.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/shop-sports.bnd 2009-05-11 21:38:26 UTC (rev 88675)
@@ -0,0 +1,11 @@
+# bnd build -classpath target/test-classes -output target/test-libs/trailblazer-shop-sports.jar src/test/resources/trailblazer/shop-sports.bnd
+
+Bundle-SymbolicName: trailblazer-shop-sports
+Bundle-Activator: org.jboss.test.osgi.trailblazer.shop.sports.ServiceActivator
+Private-Package: org.jboss.test.osgi.trailblazer.shop.sports
+Import-Package: \
+ org.osgi.framework, \
+ org.osgi.service.log, \
+ org.jboss.osgi.common.log, \
+ org.jboss.test.osgi.trailblazer, \
+ org.jboss.test.osgi.trailblazer.types
More information about the jboss-osgi-commits
mailing list