Skip to content

Commit

Permalink
#36 Move main module into subfolder
Browse files Browse the repository at this point in the history
  • Loading branch information
ljacqu committed Nov 2, 2016
1 parent 321ffc5 commit 7128fd6
Show file tree
Hide file tree
Showing 117 changed files with 36 additions and 62 deletions.
10 changes: 8 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,11 @@ jdk: oraclejdk7
# - coveralls:report send the coverage reports to the coveralls service
# Switches:
# - B: batch mode (no UI)
# - U: force update, download everytime the dependencies
script: mvn clean test jacoco:report coveralls:report -B -U
# - U: force update, download the dependencies every time
script:
- mvn clean -B -f core/pom.xml
- mvn clean -B -f extras/pom.xml
- mvn clean -B -f test-module/pom.xml
- mvn install jacoco:report coveralls:report -B -U -f core/pom.xml
- mvn install jacoco:report coveralls:report -B -U -f extras/pom.xml
- mvn test -B -U -f test-module/pom.xml
4 changes: 2 additions & 2 deletions pom.xml → core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
<connection>scm:git:git@github.com:ljacqu/DependencyInjector.git</connection>
<developerConnection>scm:git:git@github.com:ljacqu/DependencyInjector.git</developerConnection>
<url>git@github.com:ljacqu/DependencyInjector.git</url>
<tag>HEAD</tag>
</scm>
<tag>HEAD</tag>
</scm>

<distributionManagement>
<snapshotRepository>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package ch.jalu.injector.samples.inheritance;

/**
* Created by ljacques on 01.11.2016.
*/

public class DependencyC {
}
20 changes: 11 additions & 9 deletions extras/pom.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<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>


<groupId>ch.jalu</groupId>
<artifactId>injector-extras</artifactId>
<artifactId>injector.extras</artifactId>
<version>0.4-SNAPSHOT</version>

<name>DependencyInjector extras</name>
<description>Lightweight dependency injector (JSR-330 implementation)</description>
<description>Additional features for the dependency injector</description>
<url>https://github.com/ljacqu/DependencyInjector</url>

<issueManagement>
Expand Down Expand Up @@ -167,17 +168,18 @@

<dependencies>
<!-- Runtime dependencies -->
<dependency>
<groupId>ch.jalu</groupId>
<artifactId>injector</artifactId>
<version>0.4-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>ch.jalu</groupId>
<artifactId>injector</artifactId>
<version>0.4-SNAPSHOT</version>
</dependency>
<!-- Compiler-only dependencies -->
<dependency>
<groupId>com.google.code.findbugs</groupId>
Expand All @@ -197,14 +199,14 @@
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>compile</scope>
<scope>test</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>2.2.7</version>
<scope>compile</scope>
<scope>test</scope>
<optional>true</optional>
</dependency>
<!-- Testing-only dependencies -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package ch.jalu.injector.extras.handlers;

import ch.jalu.injector.extras.annotations.AllInstances;
import ch.jalu.injector.Injector;
import ch.jalu.injector.exceptions.InjectorException;
import ch.jalu.injector.extras.annotations.AllInstances;
import ch.jalu.injector.handlers.dependency.TypeSafeAnnotationHandler;
import ch.jalu.injector.handlers.instantiation.DependencyDescription;
import ch.jalu.injector.utils.InjectorUtils;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package ch.jalu.injector.extras.handlers;

import ch.jalu.injector.extras.annotations.AllTypes;
import ch.jalu.injector.Injector;
import ch.jalu.injector.extras.annotations.AllTypes;
import ch.jalu.injector.handlers.dependency.TypeSafeAnnotationHandler;
import ch.jalu.injector.handlers.instantiation.DependencyDescription;
import ch.jalu.injector.utils.InjectorUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@
*/
public class AutowiringHandlerTest {

private static final String SAMPLE_PACKAGE = "ch.jalu.injector.extras";

@Test
public void shouldFindUniqueImplementation() {
// given
String pkg = "ch.jalu.injector.extra";
Injector injector = new InjectorBuilder()
.addHandlers(new AutowiringHandler(pkg))
.addDefaultHandlers(pkg)
.addHandlers(new AutowiringHandler(SAMPLE_PACKAGE))
.addDefaultHandlers(SAMPLE_PACKAGE)
.create();

// when
Expand All @@ -42,8 +43,7 @@ public void shouldFindUniqueImplementation() {
@Test
public void shouldReturnNullForZeroOrMultipleImplementations() throws Exception {
// given
String pkg = "ch.jalu.injector.extra";
AutowiringHandler autowiringHandler = new AutowiringHandler(pkg);
AutowiringHandler autowiringHandler = new AutowiringHandler(SAMPLE_PACKAGE);

// when
Class<?> noImpl = autowiringHandler.accept(NoImpl.class);
Expand All @@ -59,13 +59,12 @@ public void shouldReturnNullForZeroOrMultipleImplementations() throws Exception
@Test
public void shouldThrowForMultipleImplementations() {
// given
String pkg = "ch.jalu.injector.extra";
AutowiringHandler autowiringHandler = new AutowiringHandler(pkg);
AutowiringHandler autowiringHandler = new AutowiringHandler(SAMPLE_PACKAGE);
autowiringHandler.setThrowIfNoUniqueSubtypeFound(true);

Injector injector = new InjectorBuilder()
.addHandlers(autowiringHandler)
.addDefaultHandlers(pkg)
.addDefaultHandlers(SAMPLE_PACKAGE)
.create();

// when / then
Expand All @@ -80,13 +79,12 @@ public void shouldThrowForMultipleImplementations() {
@Test
public void shouldThrowForNoImplementation() {
// given
String pkg = "ch.jalu.injector.extra";
AutowiringHandler autowiringHandler = new AutowiringHandler(pkg);
AutowiringHandler autowiringHandler = new AutowiringHandler(SAMPLE_PACKAGE);
autowiringHandler.setThrowIfNoUniqueSubtypeFound(true);

Injector injector = new InjectorBuilder()
.addHandlers(autowiringHandler)
.addDefaultHandlers(pkg)
.addDefaultHandlers(SAMPLE_PACKAGE)
.create();

// when / then
Expand All @@ -98,9 +96,11 @@ public void shouldThrowForNoImplementation() {
}
}

/** Interface with no concrete implementation. */
private interface NoImpl {
}

/** Abstract class with no concrete extension. */
private abstract class AbstrNoImpl implements NoImpl {
}

Expand Down
34 changes: 1 addition & 33 deletions test-module/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,10 @@

<groupId>ch.jalu</groupId>
<artifactId>injector.testmodule</artifactId>
<!-- Keep version in sync with ch.jalu.injector -->
<version>0.4-SNAPSHOT</version>

<name>Dependency Injector test module</name>
<description>Test for the ch.jalu.injector project</description>
<url>https://github.com/ljacqu/DependencyInjector</url>

<issueManagement>
<url>https://github.com/ljacqu/DependencyInjector/issues</url>
<system>GitHub Issues</system>
</issueManagement>

<licenses>
<license>
<name>MIT License</name>
<url>http://www.opensource.org/licenses/mit-license.php</url>
<distribution>repo</distribution>
</license>
</licenses>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
Expand All @@ -51,7 +19,7 @@
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.1.0.Final</version>
<scope>provided</scope>
<scope>compile</scope>
</dependency>
</dependencies>
</project>

0 comments on commit 7128fd6

Please sign in to comment.