Skip to content

Commit

Permalink
Use Geronimo AtInject, fix BundleContext usage.
Browse files Browse the repository at this point in the history
Conflicts:
	environments/osgi/tests/tester/src/test/java/org/jboss/weld/environment/osgi/tests/event/EventTest.java
	environments/osgi/tests/tester/src/test/java/org/jboss/weld/environment/osgi/tests/framework/InfrastructureTest.java
	environments/osgi/tests/tester/src/test/java/org/jboss/weld/environment/osgi/tests/jsr299/ExtensionTest.java
	environments/osgi/tests/tester/src/test/java/org/jboss/weld/environment/osgi/tests/service/MetaFilterTest.java
	environments/osgi/tests/tester/src/test/java/org/jboss/weld/environment/osgi/tests/service/ServiceConsumingTest.java
	pom.xml
  • Loading branch information
alesj authored and jharting committed Jul 18, 2013
1 parent 8487a27 commit c335e21
Show file tree
Hide file tree
Showing 12 changed files with 73 additions and 40 deletions.
5 changes: 0 additions & 5 deletions environments/osgi/tests/tester/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,6 @@
<artifactId>guava</artifactId>
</dependency>

<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@

package org.jboss.weld.environment.osgi.tests.event;

import org.junit.Ignore;
import javax.inject.Inject;

import org.jboss.weld.environment.osgi.tests.util.Environment;
import org.jboss.weld.osgi.tests.bundle1.api.MovingService;
import org.jboss.weld.osgi.tests.bundle1.util.EventListener;
import org.junit.Assert;
Expand Down Expand Up @@ -46,10 +48,12 @@ public static Option[] configure() {
);
}

@Inject
private BundleContext context;

@SuppressWarnings("unchecked")
@Test
//@Ignore
public void eventTest(BundleContext context) throws InterruptedException, InvalidSyntaxException, BundleException {
public void eventTest() throws InterruptedException, InvalidSyntaxException, BundleException {
Environment.waitForEnvironment(context);

Bundle bundle1 = null, bundle2 = null, bundle3 = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import org.junit.Ignore;
import java.util.Collection;

import javax.inject.Inject;

import org.jboss.weld.environment.osgi.spi.CDIContainer;
import org.jboss.weld.environment.osgi.spi.CDIContainerFactory;
import org.junit.Assert;
Expand Down Expand Up @@ -47,9 +49,11 @@ public static Option[] configure() {
);
}

@Inject
private BundleContext context;

@Test
//@Ignore
public void bundleScannerTest(BundleContext context) throws InterruptedException, BundleException, InvalidSyntaxException {
public void bundleScannerTest() throws InterruptedException, BundleException, InvalidSyntaxException {
Environment.waitForEnvironment(context);

Bundle bundleScanner = null, bundleScannerInner = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@

package org.jboss.weld.environment.osgi.tests.framework;

import org.junit.Ignore;
import javax.inject.Inject;

import junit.framework.Assert;
import org.jboss.weld.environment.osgi.api.BundleState;
import org.jboss.weld.environment.osgi.api.annotation.BundleDataFile;
import org.jboss.weld.environment.osgi.api.events.AbstractBundleContainerEvent;
Expand Down Expand Up @@ -48,9 +50,11 @@ public static Option[] configure() {
);
}

@Inject
private BundleContext context;

@Test
//@Ignore
public void fiveBundlesTest(BundleContext context) throws InterruptedException, BundleException {
public void fiveBundlesTest() throws InterruptedException, BundleException {
Environment.waitForEnvironment(context);

Bundle extAPI = null, intAPI = null, extImpl = null, intImpl = null, mand = null;
Expand All @@ -75,8 +79,7 @@ public void fiveBundlesTest(BundleContext context) throws InterruptedException,
}

@Test
//@Ignore
public void interactionsTest(BundleContext context) throws InterruptedException {
public void interactionsTest() throws InterruptedException {
Environment.waitForEnvironment(context);

Bundle importingBundle = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import java.lang.reflect.Field;

import javax.inject.Inject;

import org.jboss.weld.environment.osgi.tests.util.Environment;
import org.junit.Assert;
import org.junit.Ignore;
Expand All @@ -24,9 +26,11 @@ public static Option[] configure() {
return options(Environment.toCDIOSGiEnvironment());
}

@Inject
private BundleContext context;

@Test
//@Ignore
public void bundleLifeCycleTest(BundleContext context) throws InterruptedException, BundleException, ClassNotFoundException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException {
public void bundleLifeCycleTest() throws InterruptedException, BundleException, ClassNotFoundException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException {
Environment.waitForEnvironment(context);

Bundle bundle = context.installBundle("mvn:org.jboss.weld.osgi.tests/weld-osgi-life-cycle/1.1.3-SNAPSHOT");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import javax.enterprise.event.Event;
import javax.enterprise.inject.Instance;
import javax.enterprise.inject.spi.BeanManager;
import javax.inject.Inject;

import org.jboss.weld.environment.osgi.spi.CDIContainer;
import org.jboss.weld.environment.osgi.spi.CDIContainerFactory;
Expand Down Expand Up @@ -52,9 +53,11 @@ public static Option[] configure() {
);
}

@Inject
private BundleContext context;

@Test
//@Ignore
public void launchTest(BundleContext context) throws InterruptedException, BundleException, InvalidSyntaxException {
public void launchTest() throws InterruptedException, BundleException, InvalidSyntaxException {
Environment.waitForEnvironment(context);

Bundle bundle1 = null, bundle2 = null, bundle3 = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import java.util.ArrayList;
import java.util.Collection;

import javax.inject.Inject;

import junit.framework.Assert;
import org.jboss.weld.environment.osgi.spi.CDIContainer;
import org.jboss.weld.environment.osgi.spi.CDIContainerFactory;
Expand Down Expand Up @@ -47,9 +49,11 @@ public static Option[] configure() {
);
}

@Inject
private BundleContext context;

@Test
//@Ignore
public void CDIContainerFactoryTest(BundleContext context) throws InterruptedException {
public void CDIContainerFactoryTest() throws InterruptedException {
Environment.waitForEnvironment(context);

ServiceReference factoryReference = context.getServiceReference(CDIContainerFactory.class.getName());
Expand Down Expand Up @@ -83,8 +87,7 @@ public void CDIContainerFactoryTest(BundleContext context) throws InterruptedExc
}

@Test
//@Ignore
public void CDIContainerTest(BundleContext context) throws InterruptedException, InvalidSyntaxException {
public void CDIContainerTest() throws InterruptedException, InvalidSyntaxException {
Environment.waitForEnvironment(context);

ServiceReference factoryReference = context.getServiceReference(CDIContainerFactory.class.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@

package org.jboss.weld.environment.osgi.tests.jsr299;

import org.junit.Ignore;
import javax.inject.Inject;

import org.jboss.weld.environment.osgi.tests.util.Environment;
import org.jboss.weld.osgi.tests.cdispi.ServiceExtensionProvider;
import org.junit.Assert;
import org.junit.Test;
Expand All @@ -44,9 +46,11 @@ public static Option[] configure() {
);
}

@Inject
private BundleContext context;

@Test
//@Ignore
public void eventTest(BundleContext context) throws InterruptedException, InvalidSyntaxException, BundleException {
public void eventTest() throws InterruptedException, InvalidSyntaxException, BundleException {
Environment.waitForEnvironment(context);

Bundle bundle1 = null, bundleExtension = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import java.util.Dictionary;
import java.util.Map;

import javax.inject.Inject;

import org.jboss.weld.environment.osgi.tests.util.Environment;
import org.jboss.weld.osgi.tests.bundle1.util.BundleProvider;
import org.junit.Assert;
Expand Down Expand Up @@ -56,9 +58,11 @@ public static Option[] configure() {
);
}

@Inject
private BundleContext context;

@Test
//@Ignore
public void osgiUtilitiesTest(BundleContext context) throws InterruptedException, InvalidSyntaxException {
public void osgiUtilitiesTest() throws InterruptedException, InvalidSyntaxException {
Environment.waitForEnvironment(context);

Bundle bundle1 = null, bundle2 = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@

package org.jboss.weld.environment.osgi.tests.service;

import org.junit.Ignore;
import javax.inject.Inject;

import org.jboss.weld.environment.osgi.tests.util.Environment;
import org.jboss.weld.osgi.tests.bundle1.api.PropertyService;
import org.jboss.weld.osgi.tests.bundle1.api.TestPublished;
import org.junit.Assert;
Expand Down Expand Up @@ -49,9 +51,11 @@ public static Option[] configure() {
);
}

@Inject
private BundleContext context;

@Test
//@Ignore
public void metaFilterTest(BundleContext context) throws InterruptedException, InvalidSyntaxException, BundleException {
public void metaFilterTest() throws InterruptedException, InvalidSyntaxException, BundleException {
Environment.waitForEnvironment(context);
ServiceReference ref = context.getServiceReference(TestPublished.class.getName());
TestPublished test = (TestPublished) context.getService(ref);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@

package org.jboss.weld.environment.osgi.tests.service;

import org.junit.Ignore;
import javax.inject.Inject;

import org.jboss.weld.environment.osgi.api.Service;
import org.jboss.weld.osgi.tests.bundle1.api.PersonalizedHashCodeService;
import org.jboss.weld.osgi.tests.bundle1.api.PropertyService;
Expand Down Expand Up @@ -50,9 +51,11 @@ public static Option[] configure() {
);
}

@Inject
private BundleContext context;

@Test
//@Ignore
public void serviceOSGiConsumingTest(BundleContext context) throws InterruptedException, InvalidSyntaxException {
public void serviceOSGiConsumingTest() throws InterruptedException, InvalidSyntaxException {
Environment.waitForEnvironment(context);

ServiceReference[] propertyServiceReferences = context.getServiceReferences(PropertyService.class.getName(),null);
Expand All @@ -75,8 +78,7 @@ public void serviceOSGiConsumingTest(BundleContext context) throws InterruptedEx
}

@Test
//@Ignore
public void serviceCDIConsumingTest(BundleContext context) throws InterruptedException, InvalidSyntaxException {
public void serviceCDIConsumingTest() throws InterruptedException, InvalidSyntaxException {
Environment.waitForEnvironment(context);

ServiceReference[] serviceProviderReferences = context.getServiceReferences(ServiceProvider.class.getName(),null);
Expand Down Expand Up @@ -258,8 +260,7 @@ public void serviceCDIConsumingTest(BundleContext context) throws InterruptedExc
}

@Test
//@Ignore
public void hashCodeCallTest(BundleContext context) throws InterruptedException, InvalidSyntaxException {
public void hashCodeCallTest() throws InterruptedException, InvalidSyntaxException {
Environment.waitForEnvironment(context);

ServiceReference[] serviceProviderReferences = context.getServiceReferences(ServiceProvider.class.getName(),null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import java.io.Serializable;
import java.io.Serializable;

import javax.inject.Inject;

import org.jboss.weld.environment.osgi.tests.util.Environment;
import org.jboss.weld.osgi.tests.bundle1.api.AutoPublishedService;
import org.jboss.weld.osgi.tests.bundle1.api.ContractInterface;
Expand Down Expand Up @@ -56,9 +58,11 @@ public static Option[] configure() {
);
}

@Inject
private BundleContext context;

@Test
//@Ignore
public void servicePublishingTest(BundleContext context) throws InterruptedException, InvalidSyntaxException, BundleException {
public void servicePublishingTest() throws InterruptedException, InvalidSyntaxException, BundleException {
Environment.waitForEnvironment(context);

Bundle bundle1 = null, bundle2 = null, bundle3 = null;
Expand Down

0 comments on commit c335e21

Please sign in to comment.