Skip to content
This repository was archived by the owner on Mar 3, 2026. It is now read-only.

Commit 605316b

Browse files
committed
Move integration tests to main project to increase/better report for coverage
1 parent f26bb28 commit 605316b

File tree

101 files changed

+2295
-528
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+2295
-528
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ dependency-reduced-pom.xml
1818
*.iml
1919
*.idea
2020
*.versionsBackup
21+
pom.xml.versionsBackup
22+
jacoco.exec

jooby-archetype/src/main/resources/archetype-resources/src/main/java/App.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class App extends Jooby {
1212

1313
assets("/assets/**");
1414

15-
get("/", file("welcome.html"));
15+
get("/", staticFile("welcome.html"));
1616
}
1717

1818
public static void main(final String[] args) throws Exception {

jooby-maven-plugin/src/main/java/org/jooby/JoobyRun.java

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,12 @@
2929
import static org.twdata.maven.mojoexecutor.MojoExecutor.plugin;
3030
import static org.twdata.maven.mojoexecutor.MojoExecutor.version;
3131

32+
import java.util.LinkedHashSet;
33+
import java.util.List;
34+
import java.util.Set;
35+
3236
import org.apache.maven.execution.MavenSession;
37+
import org.apache.maven.model.Resource;
3338
import org.apache.maven.plugin.AbstractMojo;
3439
import org.apache.maven.plugin.BuildPluginManager;
3540
import org.apache.maven.plugin.MojoExecutionException;
@@ -99,20 +104,35 @@ public class JoobyRun extends AbstractMojo {
99104

100105
@Override
101106
public void execute() throws MojoExecutionException, MojoFailureException {
107+
List<Resource> resources = mavenProject.getResources();
108+
Set<String> cp = new LinkedHashSet<String>();
109+
for (Resource resource : resources) {
110+
cp.add(resource.getDirectory());
111+
}
112+
113+
getLog().info("CP: " + cp);
114+
115+
102116
executeMojo(
103117
plugin(
104118
groupId("org.codehaus.mojo"),
105119
artifactId("exec-maven-plugin"),
106120
version(execVersion)
107121
),
108-
goal("java"),
122+
goal("exec"),
109123
configuration(
124+
element(name("executable"), "java"),
125+
element("arguments",
126+
element("argument", "-classpath"),
127+
element("classpath")
128+
),
110129
element(name("mainClass"), "${application.main}"),
111130
element(name("killAfter"), "-1"),
112131
element(name("arguments"), "${jooby.arguments}"),
113132
element(name("skip"), Boolean.toString(skip)),
114133
element(name("cleanupDaemonThreads"), Boolean.toString(cleanupDaemonThreads)),
115134
element(name("daemonThreadJoinTimeout"), Long.toString(daemonThreadJoinTimeout))
135+
// element("additionalClasspathElements", additionalClasspathElements)
116136
),
117137
executionEnvironment(
118138
mavenProject,

jooby-tests/pom.xml

Lines changed: 0 additions & 102 deletions
This file was deleted.

jooby-tests/src/main/java/org/jooby/test/App.java

Lines changed: 0 additions & 32 deletions
This file was deleted.

jooby-tests/src/test/java/org/jooby/test/CookiesFeature.java

Lines changed: 0 additions & 43 deletions
This file was deleted.

jooby-tests/src/test/java/org/jooby/test/SendFileFeature.java

Lines changed: 0 additions & 43 deletions
This file was deleted.

jooby-tests/src/test/resources/logback-test.xml

Lines changed: 0 additions & 12 deletions
This file was deleted.

jooby/pom.xml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@
2929
</executions>
3030
</plugin>
3131

32+
<!-- sure-fire -->
33+
<plugin>
34+
<groupId>org.apache.maven.plugins</groupId>
35+
<artifactId>maven-surefire-plugin</artifactId>
36+
<configuration>
37+
<includes>
38+
<include>**/*Test.java</include>
39+
<include>**/*Feature.java</include>
40+
</includes>
41+
</configuration>
42+
</plugin>
43+
3244
</plugins>
3345
</build>
3446

@@ -116,6 +128,25 @@
116128
<scope>test</scope>
117129
</dependency>
118130

131+
<!-- Fluent HC -->
132+
<dependency>
133+
<groupId>org.apache.httpcomponents</groupId>
134+
<artifactId>fluent-hc</artifactId>
135+
<scope>test</scope>
136+
</dependency>
137+
138+
<dependency>
139+
<groupId>org.apache.httpcomponents</groupId>
140+
<artifactId>httpmime</artifactId>
141+
<scope>test</scope>
142+
</dependency>
143+
144+
<!-- Async Http Client -->
145+
<dependency>
146+
<groupId>com.ning</groupId>
147+
<artifactId>async-http-client</artifactId>
148+
</dependency>
149+
119150
</dependencies>
120151

121152
</project>

jooby/src/main/java/org/jooby/Err.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public Err(final Status status, final String message) {
174174
* @param cause The cause of the problem.
175175
*/
176176
public Err(final Status status, final Exception cause) {
177-
super(message(status, ""), cause);
177+
super(message(status, null), cause);
178178
this.status = status.value();
179179
}
180180

@@ -184,7 +184,7 @@ public Err(final Status status, final Exception cause) {
184184
* @param status A HTTP status. Required.
185185
*/
186186
public Err(final Status status) {
187-
super(message(status, ""));
187+
super(message(status, null));
188188
this.status = status.value();
189189
}
190190

@@ -204,6 +204,6 @@ public int statusCode() {
204204
*/
205205
private static String message(final Status status, final String tail) {
206206
requireNonNull(status, "A HTTP Status is required.");
207-
return status.reason() + "(" + status.value() + "): " + tail;
207+
return status.reason() + "(" + status.value() + ")" + (tail == null ? "" : ": " + tail);
208208
}
209209
}

0 commit comments

Comments
 (0)