This repository has been archived by the owner on Oct 14, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5826eee
commit bdd1d21
Showing
15 changed files
with
628 additions
and
44 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
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
55 changes: 55 additions & 0 deletions
55
boost-maven/boost-maven-plugin/src/it/test-dev-release/pom.xml
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,55 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" | ||
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>io.openliberty.boost.test</groupId> | ||
<artifactId>test-dev-release</artifactId> | ||
<version>@pom.version@</version> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
<maven.compiler.source>1.8</maven.compiler.source> | ||
<maven.compiler.target>1.8</maven.compiler.target> | ||
</properties> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-invoker-plugin</artifactId> | ||
<version>3.2.0</version> | ||
<configuration> | ||
<goals> | ||
<goal>install</goal> | ||
</goals> | ||
<projectsDirectory>src/it</projectsDirectory> | ||
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo> | ||
<streamLogs>true</streamLogs> | ||
<setupIncludes> | ||
<setupInclude>dev-project/pom.xml</setupInclude> | ||
</setupIncludes> | ||
<pomIncludes> | ||
<pomInclude>*/pom.xml</pomInclude> | ||
</pomIncludes> | ||
<properties> | ||
<runtimeGroupId>${runtimeGroupId}</runtimeGroupId> | ||
<runtimeArtifactId>${runtimeArtifactId}</runtimeArtifactId> | ||
<runtimeVersion>${runtimeVersion}</runtimeVersion> | ||
</properties> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<id>integration-test</id> | ||
<goals> | ||
<goal>run</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
95 changes: 95 additions & 0 deletions
95
boost-maven/boost-maven-plugin/src/it/test-dev-release/src/it/dev-project/pom.xml
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,95 @@ | ||
<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/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>io.openliberty.boost</groupId> | ||
<artifactId>dev-project</artifactId> | ||
<packaging>war</packaging> | ||
<version>1.0-SNAPSHOT</version> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
<maven.compiler.source>1.8</maven.compiler.source> | ||
<maven.compiler.target>1.8</maven.compiler.target> | ||
</properties> | ||
|
||
<pluginRepositories> | ||
<!-- Configure Sonatype OSS Maven snapshots repository --> | ||
<pluginRepository> | ||
<id>sonatype-nexus-snapshots</id> | ||
<name>Sonatype Nexus Snapshots</name> | ||
<url>https://oss.sonatype.org/content/repositories/snapshots/</url> | ||
<snapshots> | ||
<enabled>true</enabled> | ||
</snapshots> | ||
<releases> | ||
<enabled>false</enabled> | ||
</releases> | ||
</pluginRepository> | ||
</pluginRepositories> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>io.openliberty.boosters</groupId> | ||
<artifactId>ee8-bom</artifactId> | ||
<version>@pom.version@</version> | ||
<scope>import</scope> | ||
<type>pom</type> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.openliberty.boosters</groupId> | ||
<artifactId>mp20-bom</artifactId> | ||
<version>@pom.version@</version> | ||
<scope>import</scope> | ||
<type>pom</type> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.openliberty.boosters</groupId> | ||
<artifactId>jdbc</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.openliberty.boosters</groupId> | ||
<artifactId>jaxrs</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.openliberty.boosters</groupId> | ||
<artifactId>mpHealth</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.openliberty.boosters</groupId> | ||
<artifactId>cdi</artifactId> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>io.openliberty.boost</groupId> | ||
<artifactId>boost-maven-plugin</artifactId> | ||
<version>@pom.version@</version> | ||
<configuration> | ||
<runtimeArtifact> | ||
<groupId>${runtimeGroupId}</groupId> | ||
<artifactId>${runtimeArtifactId}</artifactId> | ||
<version>${runtimeVersion}</version> | ||
<type>zip</type> | ||
</runtimeArtifact> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>package</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
68 changes: 68 additions & 0 deletions
68
.../it/test-dev-release/src/it/dev-project/src/main/java/application/PopulationResource.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,68 @@ | ||
package application; | ||
|
||
import java.io.IOException; | ||
import java.sql.Connection; | ||
import java.sql.ResultSet; | ||
import java.sql.SQLException; | ||
import java.sql.Statement; | ||
|
||
import javax.enterprise.context.ApplicationScoped; | ||
import javax.annotation.Resource; | ||
import javax.sql.DataSource; | ||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.Produces; | ||
|
||
/** | ||
* Servlet implementation class JdbcServlet | ||
*/ | ||
@Path("/population") | ||
@ApplicationScoped | ||
public class PopulationResource { | ||
|
||
@Resource | ||
DataSource ds1; | ||
|
||
@GET | ||
@Produces("text/plain") | ||
public String getInformation() throws Exception, IOException { | ||
|
||
String returnValue = null; | ||
Statement stmt = null; | ||
Connection con = null; | ||
|
||
try { | ||
con = ds1.getConnection(); | ||
|
||
stmt = con.createStatement(); | ||
// create a table | ||
stmt.executeUpdate( | ||
"create table cities (name varchar(50) not null primary key, population int, county varchar(30))"); | ||
// insert a test record | ||
stmt.executeUpdate("insert into cities values ('New York City', 8550405, 'Unitest States')"); | ||
// select a record | ||
ResultSet result = stmt.executeQuery("select population from cities where name='New York City'"); | ||
result.next(); | ||
|
||
returnValue = "The population of NYC is " + result.getString(1); | ||
|
||
} catch (SQLException e) { | ||
e.printStackTrace(); | ||
} finally { | ||
try { | ||
// drop the table to clean up and to be able to rerun the test. | ||
stmt.executeUpdate("drop table cities"); | ||
} catch (SQLException e) { | ||
e.printStackTrace(); | ||
} | ||
try { | ||
con.close(); | ||
} catch (SQLException e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
|
||
return returnValue; | ||
} | ||
|
||
} |
15 changes: 15 additions & 0 deletions
15
...t-maven-plugin/src/it/test-dev-release/src/it/dev-project/src/main/webapp/WEB-INF/web.xml
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,15 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> | ||
<display-name>Java REST Sample</display-name> | ||
<servlet> | ||
<servlet-name>javax.ws.rs.core.Application</servlet-name> | ||
<load-on-startup>1</load-on-startup> | ||
</servlet> | ||
<servlet-mapping> | ||
<servlet-name>javax.ws.rs.core.Application</servlet-name> | ||
<url-pattern>/*</url-pattern> | ||
</servlet-mapping> | ||
<welcome-file-list> | ||
<welcome-file>index.html</welcome-file> | ||
</welcome-file-list> | ||
</web-app> |
Binary file added
BIN
+196 KB
.../boost-maven-plugin/src/it/test-dev-release/src/it/dev-project/src/main/webapp/index.html
Binary file not shown.
Oops, something went wrong.