[jboss-cvs] JBossAS SVN: r94455 - in projects/jboss-osgi/trunk: distribution and 9 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Oct 7 05:54:15 EDT 2009
Author: thomas.diesler at jboss.com
Date: 2009-10-07 05:54:15 -0400 (Wed, 07 Oct 2009)
New Revision: 94455
Modified:
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml
projects/jboss-osgi/trunk/distribution/pom.xml
projects/jboss-osgi/trunk/pom.xml
projects/jboss-osgi/trunk/testsuite/example/pom.xml
projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml
projects/jboss-osgi/trunk/testsuite/example/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/webapp/WebAppTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/webapp/META-INF/MANIFEST.MF
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/webapp/WEB-INF/web.xml
projects/jboss-osgi/trunk/testsuite/pom.xml
Log:
More on WebApp example
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml 2009-10-07 09:51:38 UTC (rev 94454)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml 2009-10-07 09:54:15 UTC (rev 94455)
@@ -224,6 +224,7 @@
<include name="jboss-osgi-jndi.jar" />
<!-- web -->
<include name="jboss-osgi-webconsole.jar" />
+ <include name="pax-web-extender-war.jar" />
<include name="pax-web-jetty-bundle.jar" />
</fileset>
@@ -236,6 +237,7 @@
<include name="jboss-osgi-jndi.jar" />
<!-- web -->
<include name="jboss-osgi-webconsole.jar" />
+ <include name="pax-web-extender-war.jar" />
<include name="pax-web-jetty-bundle.jar" />
<!-- all -->
<include name="jboss-osgi-apache-xerces.jar" />
@@ -366,6 +368,7 @@
<include name="jboss-osgi-jndi.jar" />
<include name="jboss-osgi-webconsole.jar" />
<include name="jboss-osgi-xml-binding.jar" />
+ <include name="pax-web-extender-war.jar" />
<include name="pax-web-jetty-bundle.jar" />
<include name="org.apache.felix.log.jar" />
</fileset>
Modified: projects/jboss-osgi/trunk/distribution/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/pom.xml 2009-10-07 09:51:38 UTC (rev 94454)
+++ projects/jboss-osgi/trunk/distribution/pom.xml 2009-10-07 09:54:15 UTC (rev 94455)
@@ -330,6 +330,10 @@
</dependency>
<dependency>
<groupId>org.ops4j.pax.web</groupId>
+ <artifactId>pax-web-extender-war</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.ops4j.pax.web</groupId>
<artifactId>pax-web-jetty-bundle</artifactId>
</dependency>
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-10-07 09:51:38 UTC (rev 94454)
+++ projects/jboss-osgi/trunk/pom.xml 2009-10-07 09:54:15 UTC (rev 94455)
@@ -60,6 +60,7 @@
<version.jboss.osgi.spi>1.0.2-SNAPSHOT</version.jboss.osgi.spi>
<version.jboss.osgi.webconsole>1.0.1</version.jboss.osgi.webconsole>
<version.jboss.osgi.xml.binding>2.0.1.SP1</version.jboss.osgi.xml.binding>
+ <version.ops4j.pax.base>1.2.1</version.ops4j.pax.base>
<version.ops4j.pax.web>0.7.0</version.ops4j.pax.web>
<version.osgi>r4v42</version.osgi>
</properties>
@@ -204,8 +205,17 @@
<!-- Ops4j -->
<dependency>
+ <!--
+ [TODO] Invalid maven dependency on pax base
+ http://issues.ops4j.org/browse/PAXWEB-177
+ -->
+ <groupId>org.ops4j.base</groupId>
+ <artifactId>ops4j-base-util-xml</artifactId>
+ <version>${version.ops4j.pax.base}</version>
+ </dependency>
+ <dependency>
<groupId>org.ops4j.pax.web</groupId>
- <artifactId>pax-web-api</artifactId>
+ <artifactId>pax-web-extender-war</artifactId>
<version>${version.ops4j.pax.web}</version>
</dependency>
<dependency>
Modified: projects/jboss-osgi/trunk/testsuite/example/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/pom.xml 2009-10-07 09:51:38 UTC (rev 94454)
+++ projects/jboss-osgi/trunk/testsuite/example/pom.xml 2009-10-07 09:54:15 UTC (rev 94455)
@@ -169,6 +169,7 @@
<exclude>org/jboss/test/osgi/example/jndi/**</exclude>
<exclude>org/jboss/test/osgi/example/microcontainer/**</exclude>
<exclude>org/jboss/test/osgi/example/simple/**</exclude>
+ <exclude>org/jboss/test/osgi/example/webapp/**</exclude>
<exclude>org/jboss/test/osgi/example/xml/**</exclude>
</excludes>
</configuration>
Modified: projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml 2009-10-07 09:51:38 UTC (rev 94454)
+++ projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml 2009-10-07 09:54:15 UTC (rev 94455)
@@ -28,6 +28,7 @@
<include>*:org.apache.felix.configadmin:jar</include>
<include>*:org.apache.felix.log:jar</include>
<include>*:org.apache.felix.metatype:jar</include>
+ <include>*:pax-web-extender-war:jar</include>
<include>*:pax-web-jetty-bundle:jar</include>
</includes>
<useStrictFiltering>true</useStrictFiltering>
Modified: projects/jboss-osgi/trunk/testsuite/example/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-10-07 09:51:38 UTC (rev 94454)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java 2009-10-07 09:54:15 UTC (rev 94455)
@@ -21,7 +21,7 @@
*/
package org.jboss.test.osgi.example.http;
-//$Id: HttpServiceRemoteTestCase.java 87330 2009-04-15 10:57:57Z thomas.diesler at jboss.com $
+//$Id: $
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppTestCase.java 2009-10-07 09:51:38 UTC (rev 94454)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppTestCase.java 2009-10-07 09:54:15 UTC (rev 94455)
@@ -21,9 +21,15 @@
*/
package org.jboss.test.osgi.example.webapp;
-//$Id: HttpServiceRemoteTestCase.java 87330 2009-04-15 10:57:57Z thomas.diesler at jboss.com $
+//$Id: $
-import org.jboss.osgi.spi.capability.HttpServiceCapability;
+import static org.junit.Assert.assertEquals;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+import org.jboss.osgi.spi.capability.WebAppCapability;
import org.jboss.osgi.spi.testing.OSGiBundle;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
@@ -32,7 +38,7 @@
import org.junit.Test;
/**
- * A test that deployes a bundle that containes a HttpServlet
+ * A test that deployes a WAR bundle
*
* @author thomas.diesler at jboss.com
* @since 06-Oct-2009
@@ -45,9 +51,9 @@
public static void setUpClass() throws Exception
{
runtime = new OSGiTestHelper().getDefaultRuntime();
- runtime.addCapability(new HttpServiceCapability());
+ runtime.addCapability(new WebAppCapability());
- OSGiBundle bundle = runtime.installBundle("example-http.jar");
+ OSGiBundle bundle = runtime.installBundle("example-webapp.war");
bundle.start();
}
@@ -60,5 +66,24 @@
@Test
public void testServletAccess() throws Exception
{
+ URL url = new URL("http://" + runtime.getServerHost() + ":8090/example-webapp/servlet?test=plain");
+ BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+ assertEquals("Hello from Servlet", br.readLine());
}
+
+ @Test
+ public void testServletInitProps() throws Exception
+ {
+ URL url = new URL("http://" + runtime.getServerHost() + ":8090/example-webapp/servlet?test=initProp");
+ BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+ assertEquals("initProp=SomeValue", br.readLine());
+ }
+
+ @Test
+ public void testResourceAccess() throws Exception
+ {
+ URL url = new URL("http://" + runtime.getServerHost() + ":8090/example-webapp/message.txt");
+ BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+ assertEquals("Hello from Resource", br.readLine());
+ }
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2009-10-07 09:51:38 UTC (rev 94454)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2009-10-07 09:54:15 UTC (rev 94455)
@@ -18,6 +18,9 @@
<entry><key>org.osgi.framework.storage</key><value>${log4j.output.dir}/osgi-store</value></entry>
<entry><key>org.osgi.framework.storage.clean</key><value>onFirstInit</value></entry>
<entry><key>org.osgi.framework.system.packages.extra</key><value>
+
+ org.apache.log4j,
+
<!-- [JBOSGI-145] JAXB classes are loaded from the system classpath -->
com.sun.xml.internal.bind.v2,
@@ -68,6 +71,7 @@
</bean>
<bean name="OSGiFrameworkEventsPlugin" class="org.jboss.osgi.framework.plugins.internal.FrameworkEventsPluginImpl">
<constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
+ <property name="synchronous">true</property>
</bean>
<bean name="OSGiStoragePlugin" class="org.jboss.osgi.framework.plugins.internal.BundleStoragePluginImpl">
<constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/webapp/META-INF/MANIFEST.MF
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/webapp/META-INF/MANIFEST.MF 2009-10-07 09:51:38 UTC (rev 94454)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/webapp/META-INF/MANIFEST.MF 2009-10-07 09:54:15 UTC (rev 94455)
@@ -3,5 +3,5 @@
Bundle-ManifestVersion: 2
Bundle-SymbolicName: example-webapp
Bundle-ClassPath: .,WEB-INF/classes
-Import-Package: javax.servlet,javax.servlet.http
+Import-Package: org.osgi.service.http,org.ops4j.pax.web.service,javax.servlet,javax.servlet.http
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/webapp/WEB-INF/web.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/webapp/WEB-INF/web.xml 2009-10-07 09:51:38 UTC (rev 94454)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/webapp/WEB-INF/web.xml 2009-10-07 09:54:15 UTC (rev 94455)
@@ -5,7 +5,7 @@
<display-name>WebApp Sample</display-name>
<servlet>
- <servlet-name>example.servlet</servlet-name>
+ <servlet-name>servlet</servlet-name>
<servlet-class>org.jboss.test.osgi.example.webapp.bundle.EndpointServlet</servlet-class>
<init-param>
<param-name>initProp</param-name>
@@ -14,8 +14,8 @@
</servlet>
<servlet-mapping>
- <servlet-name>example.servlet</servlet-name>
- <url-pattern>/*</url-pattern>
+ <servlet-name>servlet</servlet-name>
+ <url-pattern>/servlet</url-pattern>
</servlet-mapping>
</web-app>
Modified: projects/jboss-osgi/trunk/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/pom.xml 2009-10-07 09:51:38 UTC (rev 94454)
+++ projects/jboss-osgi/trunk/testsuite/pom.xml 2009-10-07 09:54:15 UTC (rev 94455)
@@ -123,9 +123,11 @@
<artifactId>jboss-osgi-jaxb</artifactId>
<scope>provided</scope>
</dependency>
+
+ <!-- Ops4J -->
<dependency>
- <groupId>org.ops4j.pax.web</groupId>
- <artifactId>pax-web-api</artifactId>
+ <groupId>org.ops4j.base</groupId>
+ <artifactId>ops4j-base-util-xml</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
@@ -133,6 +135,11 @@
<artifactId>pax-web-jetty-bundle</artifactId>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.ops4j.pax.web</groupId>
+ <artifactId>pax-web-extender-war</artifactId>
+ <scope>provided</scope>
+ </dependency>
<!-- Test Dependencies -->
<dependency>
More information about the jboss-cvs-commits
mailing list