-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#PAXCDI-197 #22
base: master
Are you sure you want to change the base?
#PAXCDI-197 #22
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package org.ops4j.pax.cdi.test; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import static org.ops4j.pax.cdi.test.support.TestConfiguration.cdiProviderBundles; | ||
import static org.ops4j.pax.cdi.test.support.TestConfiguration.paxCdiProviderAdapter; | ||
import static org.ops4j.pax.cdi.test.support.TestConfiguration.regressionDefaults; | ||
import static org.ops4j.pax.cdi.test.support.TestConfiguration.workspaceBundle; | ||
import org.ops4j.pax.exam.Configuration; | ||
import static org.ops4j.pax.exam.CoreOptions.options; | ||
import org.ops4j.pax.exam.Option; | ||
import org.ops4j.pax.exam.junit.PaxExam; | ||
import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy; | ||
import org.ops4j.pax.exam.spi.reactors.PerClass; | ||
|
||
@RunWith(PaxExam.class) | ||
@ExamReactorStrategy(PerClass.class) | ||
public class InterBundleProducesTest { | ||
|
||
// @Inject | ||
// @OsgiService | ||
// private Logger logger; | ||
@Configuration | ||
public Option[] config() { | ||
return options( | ||
regressionDefaults(), | ||
workspaceBundle("org.ops4j.pax.cdi.samples", "pax-cdi-sample10"), | ||
workspaceBundle("org.ops4j.pax.cdi.samples", "pax-cdi-sample10-client"), | ||
paxCdiProviderAdapter(), | ||
cdiProviderBundles()); | ||
} | ||
|
||
@Test | ||
public void testParameterizedTypeSupported() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this by intention that this test doesn't do anything? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The issue happens even when the method is empty. The test can be enhanced later. |
||
// assertNotNull(logger); | ||
// assertEquals(InterBundleProducesTest.class.getName(), logger.getName()); | ||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<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/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.ops4j.pax.cdi</groupId> | ||
<artifactId>pax-cdi-samples</artifactId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
</parent> | ||
<groupId>org.ops4j.pax.cdi.samples</groupId> | ||
<artifactId>pax-cdi-sample10-client</artifactId> | ||
<packaging>bundle</packaging> | ||
|
||
<name>OPS4J Pax CDI Sample10 Client</name> | ||
|
||
<dependencies> | ||
|
||
<dependency> | ||
<groupId>org.ops4j.pax.cdi</groupId> | ||
<artifactId>pax-cdi-api</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>javax.enterprise</groupId> | ||
<artifactId>cdi-api</artifactId> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.felix</groupId> | ||
<artifactId>maven-bundle-plugin</artifactId> | ||
<configuration> | ||
<instructions> | ||
<Bundle-SymbolicName>org.ops4j.pax.cdi.sample10.client</Bundle-SymbolicName> | ||
<Require-Capability> | ||
org.ops4j.pax.cdi.extension; | ||
filter:="(&(extension=pax-cdi-extension)(version>=${version;==;${pax.cdi.osgi.version.clean}})(!(version>=${version;=+;${pax.cdi.osgi.version.clean}})))", | ||
osgi.extender; filter:="(osgi.extender=pax.cdi)" | ||
</Require-Capability> | ||
</instructions> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<id>versions</id> | ||
<phase>validate</phase> | ||
<goals> | ||
<goal>cleanVersions</goal> | ||
</goals> | ||
<configuration> | ||
<versions> | ||
<pax.cdi.osgi.version.clean>${project.version}</pax.cdi.osgi.version.clean> | ||
</versions> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice | ||
* | ||
* The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) | ||
* Version 1.0 (the "License"); you may not use this file except in | ||
* compliance with the License. A copy of the License is available at | ||
* http://www.opensource.org/licenses/cddl1.txt | ||
* | ||
* The Original Code is Drombler.org. The Initial Developer of the | ||
* Original Code is Florian Brunner (Sourceforge.net user: puce). | ||
* Copyright 2014 Drombler.org. All Rights Reserved. | ||
* | ||
* Contributor(s): . | ||
*/ | ||
package org.ops4j.pax.cdi.sample10.impl; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry but wrong license, OPS4j projects are Apache License 2 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't know how this ended up here, but again: This not code to merge. The test case fails obviously because of the issue. It's just a test case reproducing the issue. |
||
import javax.inject.Inject; | ||
import org.ops4j.pax.cdi.api.OsgiService; | ||
import org.slf4j.Logger; | ||
|
||
|
||
public class LoggerConsumer { | ||
|
||
@Inject | ||
@OsgiService | ||
private Logger logger; | ||
|
||
public void setUp() { | ||
logger.info(logger.getName()); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<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/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.ops4j.pax.cdi</groupId> | ||
<artifactId>pax-cdi-samples</artifactId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
</parent> | ||
<groupId>org.ops4j.pax.cdi.samples</groupId> | ||
<artifactId>pax-cdi-sample10</artifactId> | ||
<packaging>bundle</packaging> | ||
|
||
<name>OPS4J Pax CDI Sample10</name> | ||
|
||
<dependencies> | ||
|
||
<dependency> | ||
<groupId>org.ops4j.pax.cdi</groupId> | ||
<artifactId>pax-cdi-api</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>javax.enterprise</groupId> | ||
<artifactId>cdi-api</artifactId> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.felix</groupId> | ||
<artifactId>maven-bundle-plugin</artifactId> | ||
<configuration> | ||
<instructions> | ||
<Bundle-SymbolicName>org.ops4j.pax.cdi.sample10</Bundle-SymbolicName> | ||
<Require-Capability> | ||
org.ops4j.pax.cdi.extension; | ||
filter:="(&(extension=pax-cdi-extension)(version>=${version;==;${pax.cdi.osgi.version.clean}})(!(version>=${version;=+;${pax.cdi.osgi.version.clean}})))", | ||
osgi.extender; filter:="(osgi.extender=pax.cdi)" | ||
</Require-Capability> | ||
</instructions> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<id>versions</id> | ||
<phase>validate</phase> | ||
<goals> | ||
<goal>cleanVersions</goal> | ||
</goals> | ||
<configuration> | ||
<versions> | ||
<pax.cdi.osgi.version.clean>${project.version}</pax.cdi.osgi.version.clean> | ||
</versions> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice | ||
* | ||
* The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) | ||
* Version 1.0 (the "License"); you may not use this file except in | ||
* compliance with the License. A copy of the License is available at | ||
* http://www.opensource.org/licenses/cddl1.txt | ||
* | ||
* The Original Code is Drombler.org. The Initial Developer of the | ||
* Original Code is Florian Brunner (Sourceforge.net user: puce). | ||
* Copyright 2014 Drombler.org. All Rights Reserved. | ||
* | ||
* Contributor(s): . | ||
*/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. again wrong license header, would need to be corrected |
||
package org.ops4j.pax.cdi.sample10.impl; | ||
|
||
import javax.enterprise.inject.Produces; | ||
import javax.enterprise.inject.spi.InjectionPoint; | ||
import org.ops4j.pax.cdi.api.OsgiServiceProvider; | ||
import org.ops4j.pax.cdi.api.PrototypeScoped; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
|
||
public class LoggerProducer { | ||
|
||
@Produces | ||
@OsgiServiceProvider | ||
@PrototypeScoped | ||
public Logger getLogger(InjectionPoint injectionPoint) { | ||
return LoggerFactory.getLogger(injectionPoint.getMember().getDeclaringClass()); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
license?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This not code to merge. The test case fails obviously because of the issue. It's just a test case reproducing the issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see the issue: https://ops4j1.jira.com/browse/PAXCDI-197