You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by zo...@apache.org on 2010/05/28 18:45:12 UTC

svn commit: r949225 - in /incubator/aries/trunk/samples/blog/blog-itests: ./ src/ src/test/ src/test/java/ src/test/java/org/ src/test/java/org/apache/ src/test/java/org/apache/aries/ src/test/java/org/apache/aries/samples/ src/test/java/org/apache/ari...

Author: zoe
Date: Fri May 28 16:45:12 2010
New Revision: 949225

URL: http://svn.apache.org/viewvc?rev=949225&view=rev
Log:
ARIES-313 Test for the blog sample

Added:
    incubator/aries/trunk/samples/blog/blog-itests/
    incubator/aries/trunk/samples/blog/blog-itests/pom.xml
    incubator/aries/trunk/samples/blog/blog-itests/src/
    incubator/aries/trunk/samples/blog/blog-itests/src/test/
    incubator/aries/trunk/samples/blog/blog-itests/src/test/java/
    incubator/aries/trunk/samples/blog/blog-itests/src/test/java/org/
    incubator/aries/trunk/samples/blog/blog-itests/src/test/java/org/apache/
    incubator/aries/trunk/samples/blog/blog-itests/src/test/java/org/apache/aries/
    incubator/aries/trunk/samples/blog/blog-itests/src/test/java/org/apache/aries/samples/
    incubator/aries/trunk/samples/blog/blog-itests/src/test/java/org/apache/aries/samples/blog/
    incubator/aries/trunk/samples/blog/blog-itests/src/test/java/org/apache/aries/samples/blog/itests/
    incubator/aries/trunk/samples/blog/blog-itests/src/test/java/org/apache/aries/samples/blog/itests/AbstractIntegrationTest.java
    incubator/aries/trunk/samples/blog/blog-itests/src/test/java/org/apache/aries/samples/blog/itests/BlogSampleTest.java

Added: incubator/aries/trunk/samples/blog/blog-itests/pom.xml
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/blog/blog-itests/pom.xml?rev=949225&view=auto
==============================================================================
--- incubator/aries/trunk/samples/blog/blog-itests/pom.xml (added)
+++ incubator/aries/trunk/samples/blog/blog-itests/pom.xml Fri May 28 16:45:12 2010
@@ -0,0 +1,423 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<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>
+    <parent>
+        <groupId>org.apache.aries.samples.blog</groupId>
+        <artifactId>blog</artifactId>
+        <version>0.2-incubating-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>org.apache.aries.samples.blog.itests</artifactId>
+    <name>Apache Aries Blog sample iTests</name>
+    <description>
+        Integration test for the blog sample
+    </description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.eclipse</groupId>
+            <artifactId>osgi</artifactId>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.aries.blueprint</groupId>
+            <artifactId>org.apache.aries.blueprint</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.aries</groupId>
+            <artifactId>org.apache.aries.util</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.aries.samples.blog</groupId>
+            <artifactId>org.apache.aries.samples.blog.api</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.aries.samples.blog</groupId>
+            <artifactId>org.apache.aries.samples.blog.web</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.aries.samples.blog</groupId>
+            <artifactId>org.apache.aries.samples.blog.biz</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.aries.samples.blog</groupId>
+            <artifactId>org.apache.aries.samples.blog.persistence.jpa</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-container-default</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-junit-extender-impl</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.ops4j.pax.runner</groupId>
+            <artifactId>pax-runner-no-jcl</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.ops4j.pax.swissbox</groupId>
+            <artifactId>pax-swissbox-tinybundles</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.configadmin</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.ops4j.pax.logging</groupId>
+            <artifactId>pax-logging-api</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.ops4j.pax.logging</groupId>
+            <artifactId>pax-logging-service</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.ops4j.pax.url</groupId>
+            <artifactId>pax-url-mvn</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.servicemix.bundles</groupId>
+            <artifactId>org.apache.servicemix.bundles.cglib</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>asm</groupId>
+            <artifactId>asm-all</artifactId>
+            <scope>test</scope>
+        </dependency>
+		<dependency>
+			<groupId>org.eclipse</groupId>
+			<artifactId>osgi</artifactId>
+            <scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.eclipse.equinox</groupId>
+			<artifactId>cm</artifactId>
+            <scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.eclipse.osgi</groupId>
+			<artifactId>services</artifactId>
+            <scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.ops4j.pax.web</groupId>
+			<artifactId>pax-web-extender-war</artifactId>
+            <scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.ops4j.pax.web</groupId>
+			<artifactId>pax-web-jetty-bundle</artifactId>
+            <scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.ops4j.pax.web</groupId>
+			<artifactId>pax-web-jsp</artifactId>
+            <scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.derby</groupId>
+			<artifactId>derby</artifactId>
+            <scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.felix</groupId>
+			<artifactId>org.apache.felix.fileinstall</artifactId>
+            <scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.geronimo.specs</groupId>
+			<artifactId>geronimo-jpa_2.0_spec</artifactId>
+            <scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.geronimo.specs</groupId>
+			<artifactId>geronimo-jta_1.1_spec</artifactId>
+            <scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.geronimo.specs</groupId>
+			<artifactId>geronimo-j2ee-connector_1.5_spec</artifactId>
+            <scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.geronimo.components</groupId>
+			<artifactId>geronimo-transaction</artifactId>
+            <scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.openjpa</groupId>
+			<artifactId>openjpa</artifactId>
+            <scope>test</scope>
+		</dependency>
+		
+		 <dependency>
+            <groupId>commons-lang</groupId>
+            <artifactId>commons-lang</artifactId>
+            <scope>test</scope>
+        </dependency>
+        
+        <dependency>
+            <groupId>commons-collections</groupId>
+            <artifactId>commons-collections</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>commons-pool</groupId>
+            <artifactId>commons-pool</artifactId>
+            <scope>test</scope>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.servicemix.bundles</groupId>
+            <artifactId>org.apache.servicemix.bundles.serp</artifactId>
+            <scope>test</scope>
+        </dependency>
+		
+		<dependency>
+			<groupId>org.apache.aries.blueprint</groupId>
+			<artifactId>org.apache.aries.blueprint</artifactId>
+            <scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.aries</groupId>
+			<artifactId>org.apache.aries.util</artifactId>
+            <scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.aries.jndi</groupId>
+			<artifactId>org.apache.aries.jndi</artifactId>
+            <scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.aries.application</groupId>
+			<artifactId>org.apache.aries.application.install</artifactId>
+            <scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.aries.application</groupId>
+			<artifactId>org.apache.aries.application.api</artifactId>
+            <scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.aries.application</groupId>
+			<artifactId>org.apache.aries.application.management</artifactId>
+            <scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.aries.application</groupId>
+			<artifactId>org.apache.aries.application.runtime</artifactId>
+            <scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.aries.application</groupId>
+			<artifactId>org.apache.aries.application.utils</artifactId>
+            <scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.aries.jpa</groupId>
+			<artifactId>org.apache.aries.jpa.api</artifactId>
+            <scope>test</scope>
+		</dependency>
+		
+		<dependency>
+			<groupId>org.apache.aries.jpa</groupId>
+			<artifactId>org.apache.aries.jpa.container</artifactId>
+            <scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.aries.jpa</groupId>
+			<artifactId>org.apache.aries.jpa.blueprint.aries</artifactId>
+            <scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.aries.jpa</groupId>
+			<artifactId>org.apache.aries.jpa.container.context</artifactId>
+            <scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.aries.transaction</groupId>
+			<artifactId>org.apache.aries.transaction.manager</artifactId>
+            <scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.aries.transaction</groupId>
+			<artifactId>org.apache.aries.transaction.blueprint</artifactId>
+            <scope>test</scope>
+		</dependency>
+		
+		<dependency>
+			<groupId>org.apache.aries.transaction</groupId>
+			<artifactId>org.apache.aries.transaction.wrappers</artifactId>
+            <scope>test</scope>
+		</dependency>
+		
+		<dependency>
+			<groupId>org.apache.aries.samples.blog</groupId>
+			<artifactId>org.apache.aries.samples.blog.datasource</artifactId>
+            <scope>test</scope>
+		</dependency>
+		
+	</dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <forkMode>pertest</forkMode>
+                    <excludes>
+                        <exclude>**/*$*</exclude>
+                        <exclude>**/Abstract*.java</exclude>
+                    </excludes>
+                    <includes>
+                        <include>**/Test*.java</include>
+                        <include>**/*Test.java</include>
+                    </includes>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.ops4j.pax.exam</groupId>
+                <artifactId>maven-paxexam-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>generate-config</id>
+                        <goals>
+                            <goal>generate-depends-file</goal>
+                        </goals>
+                        <configuration>
+                            <outputFile>${project.build.directory}/test-classes/META-INF/maven/dependencies.properties</outputFile>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+    <profiles>
+        <profile>
+            <id>ci-build-profile</id>
+            <activation>
+                <property>
+                    <name>maven.repo.local</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-surefire-plugin</artifactId>
+                        <configuration>
+                            <!--
+                                when the local repo location has been specified, we need to pass
+                                on this information to PAX mvn url
+                            -->
+                            <argLine>-Dorg.ops4j.pax.url.mvn.localRepository=${maven.repo.local}</argLine>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
+</project>

Added: incubator/aries/trunk/samples/blog/blog-itests/src/test/java/org/apache/aries/samples/blog/itests/AbstractIntegrationTest.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/blog/blog-itests/src/test/java/org/apache/aries/samples/blog/itests/AbstractIntegrationTest.java?rev=949225&view=auto
==============================================================================
--- incubator/aries/trunk/samples/blog/blog-itests/src/test/java/org/apache/aries/samples/blog/itests/AbstractIntegrationTest.java (added)
+++ incubator/aries/trunk/samples/blog/blog-itests/src/test/java/org/apache/aries/samples/blog/itests/AbstractIntegrationTest.java Fri May 28 16:45:12 2010
@@ -0,0 +1,216 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.aries.samples.blog.itests;
+
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.wrappedBundle;
+import static org.ops4j.pax.exam.OptionUtils.combine;
+
+import java.io.BufferedReader;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import org.junit.After;
+import org.junit.Before;
+import org.ops4j.pax.exam.CoreOptions;
+import org.ops4j.pax.exam.Inject;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.options.MavenArtifactProvisionOption;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Filter;
+import org.osgi.framework.ServiceReference;
+import org.osgi.util.tracker.ServiceTracker;
+
+
+public abstract class AbstractIntegrationTest {
+
+    private static final int CONNECTION_TIMEOUT = 30000;
+    public static final long DEFAULT_TIMEOUT = 30000;
+
+	@Inject
+  	protected BundleContext bundleContext;
+
+    private List<ServiceTracker> srs;
+
+    @Before
+    public void setUp() {
+        srs = new ArrayList<ServiceTracker>();
+    }
+    
+    @After
+    public void tearDown() throws Exception{
+        for (ServiceTracker st : srs) {
+            if (st != null) {
+                st.close();
+            }  
+        }
+    }
+
+	public static MavenArtifactProvisionOption mavenBundle(String groupId, String artifactId) {
+        return CoreOptions.mavenBundle().groupId(groupId).artifactId(artifactId).versionAsInProject();
+    }
+
+    public static MavenArtifactProvisionOption mavenBundleInTest(String groupId, String artifactId) {
+        return CoreOptions.mavenBundle().groupId(groupId).artifactId(artifactId).version(getArtifactVersion(groupId, artifactId));
+    }
+
+	public static String getArtifactVersion( final String groupId,
+                                             final String artifactId )
+    {
+        final Properties dependencies = new Properties();
+        try
+        {
+            InputStream in = getFileFromClasspath("META-INF/maven/dependencies.properties");
+            try {
+                dependencies.load(in);
+            } finally {
+                in.close();
+            }
+            final String version = dependencies.getProperty( groupId + "/" + artifactId + "/version" );
+            if( version == null )
+            {
+                throw new RuntimeException(
+                    "Could not resolve version. Do you have a dependency for " + groupId + "/" + artifactId
+                    + " in your maven project?"
+                );
+            }
+            return version;
+        }
+        catch( IOException e )
+        {
+            // TODO throw a better exception
+            throw new RuntimeException(
+             "Could not resolve version. Did you configured the plugin in your maven project?"
+             + "Or maybe you did not run the maven build and you are using an IDE?"
+            );
+        }
+     }
+
+
+	protected Bundle getInstalledBundle(String symbolicName) {
+        for (Bundle b : bundleContext.getBundles()) {
+            if (b.getSymbolicName().equals(symbolicName)) {
+                return b;
+            }
+        }
+        return null;
+    }
+
+	private static InputStream getFileFromClasspath( final String filePath )
+        throws FileNotFoundException
+    {
+        try
+        {
+            URL fileURL = AbstractIntegrationTest.class.getClassLoader().getResource( filePath );
+            if( fileURL == null )
+            {
+                throw new FileNotFoundException( "File [" + filePath + "] could not be found in classpath" );
+            }
+            return fileURL.openStream();
+        }
+        catch (IOException e)
+        {
+            throw new FileNotFoundException( "File [" + filePath + "] could not be found: " + e.getMessage() );
+        }
+    }
+
+
+	protected Boolean isServiceRegistered(Bundle b) {
+	ServiceReference []srb = b.getRegisteredServices();
+
+    	if(srb == null) {
+			return false;
+    	}else {
+    		for(ServiceReference sr:srb){
+            	System.out.println(" ZZZZZZ SERVICES "+sr);
+        	}
+    	}
+    	return true;
+	}
+
+    protected void waitForServices(Bundle b, String sclass) {
+		try {
+			BundleContext bc = b.getBundleContext();
+    		String bsn = b.getSymbolicName();
+    		Filter filter = bc
+    			.createFilter("(&(objectClass="
+        		+ sclass
+        		+ ")(Bundle-SymbolicName="
+        		+ bsn
+        		+ "))");
+
+    		ServiceTracker st = new ServiceTracker(bc, filter, null);
+    		st.open();
+    		Object bac = st.waitForService(DEFAULT_TIMEOUT);
+			st.close();
+			return;
+		} 
+		catch (Exception e) {
+			//and do something with it
+		}
+	}
+
+
+	protected static Option[] updateOptions(Option[] options) {
+	if ("IBM Corporation".equals(System.getProperty("java.vendor"))) {
+            Option[] ibmOptions = options(
+                wrappedBundle(mavenBundle("org.ops4j.pax.exam", "pax-exam-junit"))
+            );
+            options = combine(ibmOptions, options);
+        }
+
+        return options;
+    }
+
+  public static String getHTTPResponse(HttpURLConnection conn) throws IOException
+  {
+    StringBuilder response = new StringBuilder();
+    BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream(),
+        "ISO-8859-1"));
+    try {
+      for (String s = reader.readLine(); s != null; s = reader.readLine()) {
+        response.append(s).append("\r\n");
+      }
+    } finally {
+      reader.close();
+    }
+
+    return response.toString();
+  }
+
+  public static HttpURLConnection makeConnection(String contextPath) throws IOException
+  {
+    URL url = new URL(contextPath);
+    HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+
+    conn.setConnectTimeout(CONNECTION_TIMEOUT);
+    conn.connect();
+
+    return conn;
+  }
+
+}

Added: incubator/aries/trunk/samples/blog/blog-itests/src/test/java/org/apache/aries/samples/blog/itests/BlogSampleTest.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/blog/blog-itests/src/test/java/org/apache/aries/samples/blog/itests/BlogSampleTest.java?rev=949225&view=auto
==============================================================================
--- incubator/aries/trunk/samples/blog/blog-itests/src/test/java/org/apache/aries/samples/blog/itests/BlogSampleTest.java (added)
+++ incubator/aries/trunk/samples/blog/blog-itests/src/test/java/org/apache/aries/samples/blog/itests/BlogSampleTest.java Fri May 28 16:45:12 2010
@@ -0,0 +1,165 @@
+/*
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.aries.samples.blog.itests;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.ops4j.pax.exam.CoreOptions.bootDelegationPackages;
+import static org.ops4j.pax.exam.CoreOptions.equinox;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.systemProperty;
+import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.vmOption;
+
+import java.net.HttpURLConnection;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.JUnit4TestRunner;
+import org.osgi.framework.Bundle;
+
+
+@RunWith(JUnit4TestRunner.class)
+public class BlogSampleTest extends AbstractIntegrationTest {
+
+    @Test
+    public void test() throws Exception {
+
+	Bundle bapi = getInstalledBundle("org.apache.aries.samples.blog.api");
+    assertNotNull(bapi);
+    bapi.start();
+
+	Bundle bweb = getInstalledBundle("org.apache.aries.samples.blog.web");
+    assertNotNull(bweb);
+    bweb.start();
+
+	Bundle bbiz = getInstalledBundle("org.apache.aries.samples.blog.biz");
+    assertNotNull(bbiz);
+    bbiz.start();
+
+	Bundle bper = getInstalledBundle("org.apache.aries.samples.blog.persistence.jpa");
+    assertNotNull(bper);
+    bper.start();
+
+	Bundle bds = getInstalledBundle("org.apache.aries.samples.blog.datasource");
+	Bundle txs = getInstalledBundle("org.apache.aries.transaction.manager");
+
+
+    waitForServices(bbiz, "org.apache.aries.samples.api.BloggingService");
+    waitForServices(bper, "org.apache.aries.samples.api.BloggingService");
+    waitForServices(bds, "java.sql.XADataSource");
+    waitForServices(txs, "javax.transaction.TransactionManager");
+
+
+
+	if(!isServiceRegistered(bbiz)) {
+		System.out.println("ZZZZZ No services registered for " +  bbiz.getSymbolicName());
+	}
+
+	if(!isServiceRegistered(bper)) {
+		System.out.println("ZZZZZ No services registered for " + bper.getSymbolicName());
+	}
+
+	if(!isServiceRegistered(bds)) {
+		System.out.println("ZZZZZ No services registered for " + bds.getSymbolicName());
+	}
+    
+
+	if(!isServiceRegistered(txs)) {
+		System.out.println("ZZZZZ No services registered for " + txs.getSymbolicName());
+	}
+
+
+	System.out.println("ZZZZZ in test and trying to get connection....");
+	HttpURLConnection conn = makeConnection("http://localhost:8080/org.apache.aries.samples.blog.web/ViewBlog");
+    String response = getHTTPResponse(conn);
+	System.out.println("ZZZZZ " + response);
+    System.out.println("ZZZZZ " + conn.getResponseCode());
+    System.out.println("ZZZZZ " + HttpURLConnection.HTTP_OK);
+
+
+
+    assertEquals(HttpURLConnection.HTTP_OK,
+        conn.getResponseCode());
+
+    assertTrue("The response did not contain the expected content", response.contains("Blog home"));
+    }
+
+
+    @org.ops4j.pax.exam.junit.Configuration
+    public static Option[] configuration() {
+        Option[] options = options(
+bootDelegationPackages("javax.transaction", "javax.transaction.*"),
+			vmOption("-Dorg.osgi.framework.system.packages=javax.accessibility,javax.activation,javax.activity,javax.annotation,javax.annotation.processing,javax.crypto,javax.crypto.interfaces,javax.crypto.spec,javax.imageio,javax.imageio.event,javax.imageio.metadata,javax.imageio.plugins.bmp,javax.imageio.plugins.jpeg,javax.imageio.spi,javax.imageio.stream,javax.jws,javax.jws.soap,javax.lang.model,javax.lang.model.element,javax.lang.model.type,javax.lang.model.util,javax.management,javax.management.loading,javax.management.modelmbean,javax.management.monitor,javax.management.openmbean,javax.management.relation,javax.management.remote,javax.management.remote.rmi,javax.management.timer,javax.naming,javax.naming.directory,javax.naming.event,javax.naming.ldap,javax.naming.spi,javax.net,javax.net.ssl,javax.print,javax.print.attribute,javax.print.attribute.standard,javax.print.event,javax.rmi,javax.rmi.CORBA,javax.rmi.ssl,javax.script,javax.security.auth,javax.security.auth.callback,javax
 .security.auth.kerberos,javax.security.auth.login,javax.security.auth.spi,javax.security.auth.x500,javax.security.cert,javax.security.sasl,javax.sound.midi,javax.sound.midi.spi,javax.sound.sampled,javax.sound.sampled.spi,javax.sql,javax.sql.rowset,javax.sql.rowset.serial,javax.sql.rowset.spi,javax.swing,javax.swing.border,javax.swing.colorchooser,javax.swing.event,javax.swing.filechooser,javax.swing.plaf,javax.swing.plaf.basic,javax.swing.plaf.metal,javax.swing.plaf.multi,javax.swing.plaf.synth,javax.swing.table,javax.swing.text,javax.swing.text.html,javax.swing.text.html.parser,javax.swing.text.rtf,javax.swing.tree,javax.swing.undo,javax.tools,javax.xml,javax.xml.bind,javax.xml.bind.annotation,javax.xml.bind.annotation.adapters,javax.xml.bind.attachment,javax.xml.bind.helpers,javax.xml.bind.util,javax.xml.crypto,javax.xml.crypto.dom,javax.xml.crypto.dsig,javax.xml.crypto.dsig.dom,javax.xml.crypto.dsig.keyinfo,javax.xml.crypto.dsig.spec,javax.xml.datatype,javax.xml.namespace
 ,javax.xml.parsers,javax.xml.soap,javax.xml.stream,javax.xml.stream.events,javax.xml.stream.util,javax.xml.transform,javax.xml.transform.dom,javax.xml.transform.sax,javax.xml.transform.stax,javax.xml.transform.stream,javax.xml.validation,javax.xml.ws,javax.xml.ws.handler,javax.xml.ws.handler.soap,javax.xml.ws.http,javax.xml.ws.soap,javax.xml.ws.spi,javax.xml.xpath,org.ietf.jgss,org.omg.CORBA,org.omg.CORBA.DynAnyPackage,org.omg.CORBA.ORBPackage,org.omg.CORBA.TypeCodePackage,org.omg.CORBA.portable,org.omg.CORBA_2_3,org.omg.CORBA_2_3.portable,org.omg.CosNaming,org.omg.CosNaming.NamingContextExtPackage,org.omg.CosNaming.NamingContextPackage,org.omg.Dynamic,org.omg.DynamicAny,org.omg.DynamicAny.DynAnyFactoryPackage,org.omg.DynamicAny.DynAnyPackage,org.omg.IOP,org.omg.IOP.CodecFactoryPackage,org.omg.IOP.CodecPackage,org.omg.Messaging,org.omg.PortableInterceptor,org.omg.PortableInterceptor.ORBInitInfoPackage,org.omg.PortableServer,org.omg.PortableServer.CurrentPackage,org.omg.Porta
 bleServer.POAManagerPackage,org.omg.PortableServer.POAPackage,org.omg.PortableServer.ServantLocatorPackage,org.omg.PortableServer.portable,org.omg.SendingContext,org.omg.stub.java.rmi,org.w3c.dom,org.w3c.dom.bootstrap,org.w3c.dom.css,org.w3c.dom.events,org.w3c.dom.html,org.w3c.dom.ls,org.w3c.dom.ranges,org.w3c.dom.stylesheets,org.w3c.dom.traversal,org.w3c.dom.views,org.xml.sax,org.xml.sax.ext,org.xml.sax.helpers,javax.transaction;partial=true;mandatory:=partial,javax.transaction.xa;partial=true;mandatory:=partial"),
+            // Log
+            mavenBundle("org.ops4j.pax.logging", "pax-logging-api"),
+            mavenBundle("org.ops4j.pax.logging", "pax-logging-service"),
+            // Felix mvn url handler - do we need this?
+            mavenBundle("org.ops4j.pax.url", "pax-url-mvn"),
+
+
+            // this is how you set the default log level when using pax logging (logProfile)
+            systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("DEBUG"),
+
+            // Bundles
+            mavenBundle("org.eclipse.equinox", "cm"),
+            mavenBundle("org.eclipse.osgi", "services"),
+
+            mavenBundle("org.ops4j.pax.web", "pax-web-extender-war"),
+            mavenBundle("org.ops4j.pax.web", "pax-web-jetty-bundle"),
+            mavenBundle("org.ops4j.pax.web", "pax-web-jsp"),
+            mavenBundle("org.apache.derby", "derby"),
+            mavenBundle("org.apache.geronimo.specs", "geronimo-jpa_2.0_spec"),
+
+            mavenBundle("org.apache.geronimo.specs", "geronimo-jta_1.1_spec"),
+            mavenBundle("org.apache.geronimo.specs", "geronimo-j2ee-connector_1.5_spec"),
+            mavenBundle("org.apache.geronimo.components", "geronimo-transaction"),
+            mavenBundle("org.apache.openjpa", "openjpa"),
+            mavenBundle("commons-lang", "commons-lang"),
+            mavenBundle("commons-collections", "commons-collections"),
+            mavenBundle("commons-pool", "commons-pool"),
+            mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.serp"),
+            mavenBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint" ),
+            mavenBundle("org.apache.aries", "org.apache.aries.util" ),
+            mavenBundle("org.apache.aries.jndi", "org.apache.aries.jndi" ),
+            mavenBundle("org.apache.aries.application", "org.apache.aries.application.install" ),
+            mavenBundle("org.apache.aries.application", "org.apache.aries.application.api" ),
+            mavenBundle("org.apache.aries.application", "org.apache.aries.application.management" ),
+            mavenBundle("org.apache.aries.application", "org.apache.aries.application.runtime" ),
+            mavenBundle("org.apache.aries.application", "org.apache.aries.application.utils" ),
+            mavenBundle("org.apache.aries.jpa", "org.apache.aries.jpa.api" ),
+            mavenBundle("org.apache.aries.jpa", "org.apache.aries.jpa.container" ),
+            mavenBundle("org.apache.aries.jpa", "org.apache.aries.jpa.blueprint.aries" ),
+            mavenBundle("org.apache.aries.jpa", "org.apache.aries.jpa.container.context" ),
+            mavenBundle("org.apache.aries.transaction", "org.apache.aries.transaction.manager" ),
+            mavenBundle("org.apache.aries.transaction", "org.apache.aries.transaction.blueprint" ),
+            mavenBundle("org.apache.aries.transaction", "org.apache.aries.transaction.wrappers" ),
+            mavenBundle("org.apache.aries.samples.blog", "org.apache.aries.samples.blog.datasource" ),
+            mavenBundle("org.apache.aries.samples.blog", "org.apache.aries.samples.blog.api" ).noStart(),
+            mavenBundle("org.apache.aries.samples.blog", "org.apache.aries.samples.blog.web" ).noStart(),
+            mavenBundle("org.apache.aries.samples.blog", "org.apache.aries.samples.blog.biz" ).noStart(),
+            mavenBundle("org.apache.aries.samples.blog", "org.apache.aries.samples.blog.persistence.jpa" ).noStart(),
+            mavenBundle("asm", "asm-all" ),
+            equinox().version("3.5.0")
+        );
+        options = updateOptions(options);
+        return options;
+    }
+
+}