Skip to content
This repository has been archived by the owner on Oct 14, 2020. It is now read-only.

connMgr config prototype #400

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public final class ConfigConstants {
public static final String PROPERTIES = "properties";
public static final String CONTAINER_AUTH_DATA_REF = "containerAuthDataRef";
public static final String URL = "url";
public static final String CONNECTION_MANAGEMENT = "connectionManager";
public static final String BOOST_CONNECTION_MANAGEMENT_REF = "boostConnectionManager";

// Datasource configuration values
public static final String DEFAULT_DATASOURCE = "DefaultDataSource";
Expand Down
247 changes: 247 additions & 0 deletions boost-maven/boost-maven-plugin/src/it/test-conn-mgmt/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,247 @@
<?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>org.microshed.boost.test</groupId>
<artifactId>test-conn-mgmt</artifactId>
<packaging>war</packaging>
<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>

<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-M3</version>
<executions>
<execution>
<phase>integration-test</phase>
<id>integration-test1</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>
<!-- <phase>integration-test</phase> -->
<id>integration-test2</id>
<goals>
<goal>integration-test</goal>
</goals>
<configuration>
<trimStackTrace>false</trimStackTrace>
<systemProperties>
<microshed_hostname>localhost</microshed_hostname>
<microshed_http_port>9080</microshed_http_port>
<microshed_manual_env>true</microshed_manual_env>
<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>
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);
}
}
Loading