HelloWorld now runs with gretty plugin
parent
eb1230d719
commit
16ec188f68
|
@ -1,14 +1,15 @@
|
|||
|
||||
plugins {
|
||||
id "us.kirchmeier.capsule" version "1.0.1"
|
||||
id 'com.google.protobuf' version '0.7.0'
|
||||
id "us.kirchmeier.capsule" version "1.0.1"
|
||||
id 'com.google.protobuf' version '0.7.0'
|
||||
id "org.akhikhl.gretty" version "1.2.4"
|
||||
}
|
||||
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'eclipse'
|
||||
apply plugin: 'idea'
|
||||
|
||||
apply plugin: 'jetty'
|
||||
//apply plugin: 'jetty'
|
||||
//mainClassName = 'Demo'
|
||||
|
||||
apply plugin: 'maven-publish'
|
||||
|
@ -29,7 +30,7 @@ ext {
|
|||
description = "TODO: Add a description"
|
||||
|
||||
// Your project version
|
||||
version = "0.0"
|
||||
version = "0.0.1"
|
||||
|
||||
version += "${isSnapshot ? '-SNAPSHOT' : ''}"
|
||||
|
||||
|
@ -62,25 +63,11 @@ test {
|
|||
|
||||
task integrationTest(type: Test) {
|
||||
include '**/*IntegrationTest*'
|
||||
jettyRun {
|
||||
httpPort = 8081 // Port for test
|
||||
daemon = true
|
||||
stopPort = 8091 // Port for stop signal
|
||||
stopKey = 'stopKey'
|
||||
}
|
||||
jettyStop {
|
||||
stopPort = 8091 // Port for stop signal
|
||||
stopKey = 'stopKey'
|
||||
}
|
||||
|
||||
doFirst {
|
||||
jettyRun.execute()
|
||||
}
|
||||
|
||||
doLast {
|
||||
jettyStop.execute()
|
||||
}
|
||||
}
|
||||
|
||||
gretty {
|
||||
httpPort = 8081
|
||||
integrationTestTask = 'integrationTest'
|
||||
}
|
||||
|
||||
|
||||
|
@ -164,6 +151,8 @@ repositories {
|
|||
// Use local maven repository
|
||||
mavenLocal()
|
||||
|
||||
jcenter()
|
||||
|
||||
// Use 'maven central' for other dependencies.
|
||||
mavenCentral()
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ import service.HelloWorldService;
|
|||
public class HelloWebApp {
|
||||
private static HelloWorldService helloWorldService = new HelloWorldService();
|
||||
|
||||
@GET()
|
||||
@GET
|
||||
public String hello() {
|
||||
return helloWorldService.sayHello();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<web-app>
|
||||
<servlet>
|
||||
<servlet-name>Jersey Hello World Application</servlet-name>
|
||||
<servlet-name>Jersey Hello World</servlet-name>
|
||||
<servlet-class>
|
||||
org.glassfish.jersey.servlet.ServletContainer
|
||||
</servlet-class>
|
||||
|
@ -11,7 +11,7 @@
|
|||
<load-on-startup>1</load-on-startup>
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>Jersey Hello World Application</servlet-name>
|
||||
<servlet-name>Jersey Hello World</servlet-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
</web-app>
|
||||
|
|
|
@ -7,7 +7,9 @@ import org.junit.Test;
|
|||
|
||||
public class HelloIntegrationTest {
|
||||
|
||||
private static String HELLO_URL = "http://localhost:8080/hello";
|
||||
private static String PROP_GETTY_URL = "gretty.httpBaseURI";
|
||||
private static String BASE_URL = System.getProperty(PROP_GETTY_URL);
|
||||
private static String HELLO_URL = BASE_URL + "/hello";
|
||||
|
||||
@Test
|
||||
public void testHello() throws Exception {
|
||||
|
|
Loading…
Reference in New Issue