You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by js...@apache.org on 2009/04/17 10:46:23 UTC
svn commit: r765904 -
/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTest.java
Author: jstrachan
Date: Fri Apr 17 08:46:22 2009
New Revision: 765904
URL: http://svn.apache.org/viewvc?rev=765904&view=rev
Log:
switched to normal Camel coding style (whoops, my IDE was setup for Guice coding style :)
Modified:
camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTest.java
Modified: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTest.java?rev=765904&r1=765903&r2=765904&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTest.java (original)
+++ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTest.java Fri Apr 17 08:46:22 2009
@@ -25,85 +25,82 @@
import org.apache.commons.logging.LogFactory;
import org.junit.Test;
import org.junit.runner.RunWith;
-import static org.ops4j.pax.exam.CoreOptions.equinox;
-import static org.ops4j.pax.exam.CoreOptions.felix;
-import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
-import static org.ops4j.pax.exam.CoreOptions.options;
-import static org.ops4j.pax.exam.CoreOptions.systemProperty;
-import static org.ops4j.pax.exam.CoreOptions.wrappedBundle;
+import static org.ops4j.pax.exam.CoreOptions.*;
import org.ops4j.pax.exam.Inject;
import static org.ops4j.pax.exam.MavenUtils.asInProject;
import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.options.MavenUrlProvisionOption;
import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.logProfile;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
+import org.ops4j.pax.exam.options.MavenUrlProvisionOption;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
-/** @version $Revision: 1.1 $ */
+/**
+ * @version $Revision: 1.1 $
+ */
@RunWith(JUnit4TestRunner.class)
public class OSGiIntegrationTest {
- private static final transient Log LOG = LogFactory.getLog(OSGiIntegrationTest.class);
+ private static final transient Log LOG = LogFactory.getLog(OSGiIntegrationTest.class);
- @Inject
- BundleContext bundleContext;
+ @Inject
+ BundleContext bundleContext;
- @Test
- public void listBundles() throws Exception {
- LOG.info("************ Hello from OSGi ************");
+ @Test
+ public void listBundles() throws Exception {
+ LOG.info("************ Hello from OSGi ************");
- for (Bundle b : bundleContext.getBundles()) {
- LOG.info("Bundle " + b.getBundleId() + " : " + b.getSymbolicName());
- }
+ for (Bundle b : bundleContext.getBundles()) {
+ LOG.info("Bundle " + b.getBundleId() + " : " + b.getSymbolicName());
+ }
- // TODO we should be using Camel OSGi really to deal with class loader issues
- CamelContext camelContext = new DefaultCamelContext();
+ // TODO we should be using Camel OSGi really to deal with class loader issues
+ CamelContext camelContext = new DefaultCamelContext();
- camelContext.addRoutes(new RouteBuilder() {
- public void configure() throws Exception {
- from("seda:foo").to("seda:bar");
- }
- });
+ camelContext.addRoutes(new RouteBuilder() {
+ public void configure() throws Exception {
+ from("seda:foo").to("seda:bar");
+ }
+ });
- camelContext.start();
+ camelContext.start();
- LOG.info("CamelContext started");
+ LOG.info("CamelContext started");
- Thread.sleep(2000);
+ Thread.sleep(2000);
- LOG.info("CamelContext stopping");
+ LOG.info("CamelContext stopping");
- camelContext.stop();
+ camelContext.stop();
- LOG.info("CamelContext stopped");
- }
+ LOG.info("CamelContext stopped");
+ }
- @Configuration
- public static Option[] configure() {
- return options(
- // install log service using pax runners profile abstraction (there are more profiles, like DS)
- logProfile(),
+ @Configuration
+ public static Option[] configure() {
+ return options(
+ // install log service using pax runners profile abstraction (there are more profiles, like DS)
+ logProfile(),
- // this is how you set the default log level when using pax logging (logProfile)
- systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("INFO"),
+ // this is how you set the default log level when using pax logging (logProfile)
+ systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("INFO"),
- // TODO why can't we find these from the maven pom.xml with transitive dependency?
- mavenBundleAsInProject("org.apache.camel", "camel-core"),
+ // TODO why can't we find these from the maven pom.xml with transitive dependency?
+ mavenBundleAsInProject("org.apache.camel", "camel-core"),
- wrappedBundle(mavenBundleAsInProject("commons-logging", "commons-logging")),
+ wrappedBundle(mavenBundleAsInProject("commons-logging", "commons-logging")),
- felix(), equinox());
- }
+ felix(), equinox());
+ }
- /**
- * Adds a maven bundle for the given groupId and artifactId while deducing the version to use
- * from the <code>target/classes/META-INF/maven/dependencies.properties</code> file that is
- * generated via the
- * <a href="http://wiki.ops4j.org/display/paxexam/Pax+Exam+-+Tutorial+1">depends-maven-plugin
- * from ServiceMix</a>
- */
- public static MavenUrlProvisionOption mavenBundleAsInProject(String groupId, String artifactId) {
- return mavenBundle().groupId(groupId).artifactId(artifactId).version(asInProject());
- }
+ /**
+ * Adds a maven bundle for the given groupId and artifactId while deducing the version to use
+ * from the <code>target/classes/META-INF/maven/dependencies.properties</code> file that is
+ * generated via the
+ * <a href="http://wiki.ops4j.org/display/paxexam/Pax+Exam+-+Tutorial+1">depends-maven-plugin
+ * from ServiceMix</a>
+ */
+ public static MavenUrlProvisionOption mavenBundleAsInProject(String groupId, String artifactId) {
+ return mavenBundle().groupId(groupId).artifactId(artifactId).version(asInProject());
+ }
}
\ No newline at end of file