Skip to content

Commit

Permalink
add GradleRunIntegrationTest (fixes quarkusio#1623)
Browse files Browse the repository at this point in the history
  • Loading branch information
vorburger committed Apr 11, 2019
1 parent fc89d2f commit 8858104
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 2 deletions.
56 changes: 56 additions & 0 deletions devtools/gradle-it-run/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>io.quarkus</groupId>
<artifactId>quarkus-build-parent</artifactId>
<version>999-SNAPSHOT</version>
<relativePath>../../build-parent/pom.xml</relativePath>
</parent>

<artifactId>quarkus-gradle-plugin-integration-test-run</artifactId>
<name>Quarkus - Gradle Plugin Run App IT</name>
<description>Quarkus - Gradle Plugin Run Application Integration Test</description>

<properties>
<maven.deploy.skip>true</maven.deploy.skip>
</properties>

<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>${nexus-staging-maven-plugin.version}</version>
<configuration>
<skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* Copyright 2019 Red Hat, Inc.
*
* 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 io.quarkus.gradle.it;

import static io.restassured.RestAssured.given;
import static org.hamcrest.CoreMatchers.is;

import java.io.IOException;

import org.junit.jupiter.api.Test;

/**
* Integration Test which runs the sample app built by Gradle.
*
* @author <a href="mailto:[email protected]">Michael Vorburger.ch</a>
*/
public class GradleRunIntegrationTest {
// do not rename this to *IT because we want it to run on regular mvn test without requiring failsafe

@Test
public void testHelloEndpoint() throws IOException {
Process process = new ProcessBuilder()
// .directory("../")
.command("java", "-jar", "../gradle-it/build/gradle-it-runner.jar")
.start();
try {
given()
.when().get("/hello")
.then()
.statusCode(200)
.body(is("hello"));

} finally {
process.destroy();
}
}
}
4 changes: 2 additions & 2 deletions devtools/gradle-it/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

<artifactId>quarkus-gradle-plugin-integration-test</artifactId>
<packaging>pom</packaging>
<name>Quarkus - Gradle Plugin IT</name>
<description>Quarkus - Gradle Plugin Integration Test Dependencies</description>
<name>Quarkus - Gradle Plugin Build IT</name>
<description>Quarkus - Gradle Plugin Build Integration Test</description>

<properties>
<gradle.executable>${project.basedir}/../gradle/gradlew</gradle.executable>
Expand Down
1 change: 1 addition & 0 deletions devtools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
<module>maven</module>
<module>gradle</module>
<module>gradle-it</module>
<module>gradle-it-run</module>
<module>aesh</module>
<module>reflection-agent</module>
</modules>
Expand Down

0 comments on commit 8858104

Please sign in to comment.