Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
https://github.com/BrynCooke/cdi-unit/issues/50
Added jandex test
- Loading branch information
Showing
7 changed files
with
169 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<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> | ||
<artifactId>cdi-unit-tests-jandex</artifactId> | ||
<packaging>jar</packaging> | ||
<parent> | ||
<groupId>org.jglue.cdi-unit</groupId> | ||
<artifactId>cdi-unit-parent</artifactId> | ||
<version>3.0.2-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
<name>CDI-Unit-Tests-Jandex</name> | ||
<url>http://jglue.org/cdi-unit</url> | ||
<description>CDI-Unit test suite.</description> | ||
<developers> | ||
<developer> | ||
<name>Bryn Cooke</name> | ||
</developer> | ||
</developers> | ||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<weld.test.version>2.2.0.Final</weld.test.version> | ||
</properties> | ||
|
||
<licenses> | ||
<license> | ||
<name>The Apache Software License, Version 2.0</name> | ||
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> | ||
<distribution>repo</distribution> | ||
</license> | ||
</licenses> | ||
|
||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.jglue.cdi-unit</groupId> | ||
<artifactId>cdi-unit</artifactId> | ||
<version>3.0.2-SNAPSHOT</version> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>org.jboss.weld.se</groupId> | ||
<artifactId>weld-se</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.jboss.weld.se</groupId> | ||
<artifactId>weld-se</artifactId> | ||
<version>${weld.test.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.8.2</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jboss</groupId> | ||
<artifactId>jandex</artifactId> | ||
<version>1.2.0.Final</version> | ||
</dependency> | ||
|
||
</dependencies> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.jboss.jandex</groupId> | ||
<artifactId>jandex-maven-plugin</artifactId> | ||
<version>1.0.1</version> | ||
<executions> | ||
<execution> | ||
<id>make-index</id> | ||
<goals> | ||
<goal>jandex</goal> | ||
</goals> | ||
<!-- phase is 'process-classes by default' --> | ||
<configuration> | ||
<!-- Nothing needed here for simple cases --> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
8 changes: 8 additions & 0 deletions
8
cdi-unit-tests-jandex/src/main/java/org/junit/cdiunit/NonTestClass.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package org.junit.cdiunit; | ||
|
||
public class NonTestClass { | ||
public void a() { | ||
|
||
} | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
cdi-unit-tests-jandex/src/test/java/org/jglue/cdiunit/AImplementation1.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* Copyright 2011 Bryn Cooke | ||
* | ||
* Licensed 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.jglue.cdiunit; | ||
|
||
public class AImplementation1 implements AInterface { | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
cdi-unit-tests-jandex/src/test/java/org/jglue/cdiunit/AInterface.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* Copyright 2011 Bryn Cooke | ||
* | ||
* Licensed 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.jglue.cdiunit; | ||
|
||
public interface AInterface { | ||
|
||
} |
27 changes: 27 additions & 0 deletions
27
cdi-unit-tests-jandex/src/test/java/org/jglue/cdiunit/TestCdiRunner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package org.jglue.cdiunit; | ||
|
||
import javax.inject.Inject; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
import org.junit.cdiunit.NonTestClass; | ||
import org.junit.runner.RunWith; | ||
|
||
@RunWith(CdiRunner.class) | ||
@AdditionalClasses(AImplementation1.class) | ||
public class TestCdiRunner { | ||
|
||
@Inject | ||
private NonTestClass nonTestClass; | ||
|
||
@Inject | ||
AInterface a; | ||
|
||
@Test | ||
public void testStart() { | ||
Assert.assertNotNull(a); | ||
Assert.assertNotNull(nonTestClass); | ||
nonTestClass.a(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters