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.
clean up commented out code and add an IT
Signed-off-by: Andrew J. Mauer <[email protected]>
- Loading branch information
Showing
10 changed files
with
655 additions
and
29 deletions.
There are no files selected for viewing
231 changes: 231 additions & 0 deletions
231
boost-maven/boost-maven-plugin/src/it/test-conn-mgmt/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,231 @@ | ||
<?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> | ||
|
||
<groupId>io.openliberty.demo</groupId> | ||
<artifactId>myservice</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<packaging>war</packaging> | ||
|
||
<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> | ||
|
||
<repositories> | ||
<repository> | ||
<id>jitpack.io</id> | ||
<url>https://jitpack.io</url> | ||
</repository> | ||
</repositories> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.microshed.boost.boms</groupId> | ||
<artifactId>mp22-bom</artifactId> | ||
<version>0.2.2-SNAPSHOT</version> | ||
<scope>import</scope> | ||
<type>pom</type> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.microshed.boost.boosters</groupId> | ||
<artifactId>jaxrs</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.microshed.boost.boosters</groupId> | ||
<artifactId>cdi</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.microshed.boost.boosters</groupId> | ||
<artifactId>jsonb</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.microshed.boost.boosters</groupId> | ||
<artifactId>mp-rest-client</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.microshed.boost.boosters</groupId> | ||
<artifactId>mp-config</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.microshed.boost.boosters</groupId> | ||
<artifactId>mp-health</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.microshed.boost.boosters</groupId> | ||
<artifactId>bean-validation</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.microshed.boost.boosters</groupId> | ||
<artifactId>jpa</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.microshed.boost.boosters</groupId> | ||
<artifactId>jdbc</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.postgresql</groupId> | ||
<artifactId>postgresql</artifactId> | ||
<version>42.2.6</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.microshed.boost.boosters</groupId> | ||
<artifactId>mp-openapi</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<artifactId>microshed-testing-liberty</artifactId> | ||
<groupId>com.github.microshed.microshed-testing</groupId> | ||
<version>0.4.1-beta</version> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter</artifactId> | ||
<version>5.4.2</version> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.testcontainers</groupId> | ||
<artifactId>postgresql</artifactId> | ||
<version>1.12.1</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<finalName>myservice</finalName> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-war-plugin</artifactId> | ||
<version>3.2.2</version> | ||
<configuration> | ||
<failOnMissingWebXml>false</failOnMissingWebXml> | ||
</configuration> | ||
</plugin> | ||
<!-- Allows plugin prefix, e.g. `mvn liberty:dev` --> | ||
<plugin> | ||
<groupId>io.openliberty.tools</groupId> | ||
<artifactId>liberty-maven-plugin</artifactId> | ||
<version>3.0.1</version> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.microshed.boost</groupId> | ||
<artifactId>boost-maven-plugin</artifactId> | ||
<version>0.2.2-SNAPSHOT</version> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>package</goal> | ||
</goals> | ||
</execution> | ||
<execution> | ||
<id>test-start-server</id> | ||
<phase>pre-integration-test</phase> | ||
<goals> | ||
<goal>start</goal> | ||
</goals> | ||
</execution> | ||
<execution> | ||
<id>test-stop-server</id> | ||
<phase>post-integration-test</phase> | ||
<goals> | ||
<goal>stop</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<!-- Plugin to run integration tests --> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-failsafe-plugin</artifactId> | ||
<version>3.0.0-M1</version> | ||
<executions> | ||
<execution> | ||
<phase>integration-test</phase> | ||
<id>integration-test</id> | ||
<goals> | ||
<goal>integration-test</goal> | ||
</goals> | ||
<configuration> | ||
<trimStackTrace>false</trimStackTrace> | ||
<systemProperties> | ||
<microshed_hostname>localhost</microshed_hostname> | ||
<microshed_http_port>9080</microshed_http_port> | ||
<WLP_USR_DIR>${project.build.directory}/liberty/wlp/usr</WLP_USR_DIR> | ||
</systemProperties> | ||
</configuration> | ||
</execution> | ||
<execution> | ||
<id>verify-results</id> | ||
<goals> | ||
<goal>verify</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<profiles> | ||
<profile> | ||
<id>ol</id> | ||
<activation> | ||
<activeByDefault>true</activeByDefault> | ||
<property> | ||
<name>boostRuntime</name> | ||
<value>ol</value> | ||
</property> | ||
</activation> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.microshed.boost.runtimes</groupId> | ||
<artifactId>openliberty</artifactId> | ||
</dependency> | ||
</dependencies> | ||
</profile> | ||
<profile> | ||
<id>tomee</id> | ||
<activation> | ||
<property> | ||
<name>boostRuntime</name> | ||
<value>tomee</value> | ||
</property> | ||
</activation> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.microshed.boost.runtimes</groupId> | ||
<artifactId>tomee</artifactId> | ||
</dependency> | ||
</dependencies> | ||
</profile> | ||
</profiles> | ||
|
||
</project> |
68 changes: 68 additions & 0 deletions
68
.../src/it/test-conn-mgmt/src/main/java/org/eclipse/microprofile/system/test/app/Person.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 @@ | ||
/* | ||
* Copyright (c) 2019 IBM Corporation and others | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* 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 org.eclipse.microprofile.system.test.app; | ||
|
||
import java.util.Objects; | ||
import java.util.Random; | ||
|
||
import javax.json.bind.annotation.JsonbCreator; | ||
import javax.json.bind.annotation.JsonbProperty; | ||
import javax.validation.constraints.NotNull; | ||
import javax.validation.constraints.PositiveOrZero; | ||
import javax.validation.constraints.Size; | ||
|
||
public class Person { | ||
|
||
private static final Random r = new Random(); | ||
|
||
@NotNull | ||
public final long id; | ||
|
||
@NotNull | ||
@Size(min = 2, max = 50) | ||
public final String name; | ||
|
||
@NotNull | ||
@PositiveOrZero | ||
public final int age; | ||
|
||
public Person(String name, int age) { | ||
this(name, age, null); | ||
} | ||
|
||
@JsonbCreator | ||
public Person(@JsonbProperty("name") String name, @JsonbProperty("age") int age, @JsonbProperty("id") Long id) { | ||
this.name = name; | ||
this.age = age; | ||
this.id = id == null ? r.nextLong() : id; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (obj == null || !(obj instanceof Person)) | ||
return false; | ||
Person other = (Person) obj; | ||
return Objects.equals(id, other.id) && Objects.equals(name, other.name) && Objects.equals(age, other.age); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(id, name, age); | ||
} | ||
} |
Oops, something went wrong.