Skip to content

Commit

Permalink
Check style (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
rkass committed Oct 10, 2018
1 parent 44a3cfe commit 5dee23d
Show file tree
Hide file tree
Showing 17 changed files with 675 additions and 340 deletions.
280 changes: 151 additions & 129 deletions pom.xml
@@ -1,71 +1,73 @@
<?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>com.disney.pg2k4j</groupId>
<artifactId>pg2k4j</artifactId>
<version>${revision}</version>
<packaging>jar</packaging>

<name>pg2k4j</name>
<description>Use Postgres logical replication to publish changes to the WAL to kinesis.</description>

<distributionManagement>
<repository>
<id>p13n.maven</id>
<name>p13n.maven</name>
<url>https://artifactory.us-east-1.bamgrid.net/p13n-maven-local</url>
</repository>
<snapshotRepository>
<id>p13n.maven</id>
<name>p13n.maven</name>
<url>https://artifactory.us-east-1.bamgrid.net/p13n-maven-local</url>
</snapshotRepository>
</distributionManagement>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<kpl.version>0.12.9</kpl.version>
<jackson.version>2.9.6</jackson.version>
<postgres.version>42.2.2</postgres.version>
<junit.version>4.11</junit.version>
<powermock.version>1.7.3</powermock.version>
<jacoco.version>0.7.6.201602180812</jacoco.version>
<coveralls.version>4.3.0</coveralls.version>
</properties>

<dependencies>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson.version}</version>
</dependency>

<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>amazon-kinesis-producer</artifactId>
<version>${kpl.version}</version>
</dependency>

<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${postgres.version}</version>
</dependency>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
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>com.disney.pg2k4j</groupId>
<artifactId>pg2k4j</artifactId>
<version>${revision}</version>
<packaging>jar</packaging>

<name>pg2k4j</name>
<description>Use Postgres logical replication to publish changes to the WAL to kinesis.</description>

<distributionManagement>
<repository>
<id>p13n.maven</id>
<name>p13n.maven</name>
<url>https://artifactory.us-east-1.bamgrid.net/p13n-maven-local</url>
</repository>
<snapshotRepository>
<id>p13n.maven</id>
<name>p13n.maven</name>
<url>https://artifactory.us-east-1.bamgrid.net/p13n-maven-local</url>
</snapshotRepository>
</distributionManagement>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<kpl.version>0.12.9</kpl.version>
<jackson.version>2.9.6</jackson.version>
<postgres.version>42.2.2</postgres.version>
<junit.version>4.11</junit.version>
<powermock.version>1.7.3</powermock.version>
<jacoco.version>0.7.6.201602180812</jacoco.version>
<coveralls.version>4.3.0</coveralls.version>
<checkstyle.version>3.0.0</checkstyle.version>
</properties>

<dependencies>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson.version}</version>
</dependency>

<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>amazon-kinesis-producer</artifactId>
<version>${kpl.version}</version>
</dependency>

<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${postgres.version}</version>
</dependency>

<dependency>
<groupId>org.powermock</groupId>
Expand All @@ -81,67 +83,87 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes>
<include>**/Test*.java</include>
<include>**/*Test.java</include>
<include>**/*Tests.java</include>
<include>**/*TestCase.java</include>
</includes>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
<configuration>
<excludes>
<exclude>**/models/*</exclude>
<exclude>**/*Callback*</exclude>
<exclude>**/*Configuration*</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.eluder.coveralls</groupId>
<artifactId>coveralls-maven-plugin</artifactId>
<version>${coveralls.version}</version>
<configuration>
<repoToken>${env.COVERALLS_TOKEN}</repoToken>
</configuration>
</plugin>
</plugins>
</build>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes>
<include>**/Test*.java</include>
<include>**/*Test.java</include>
<include>**/*Tests.java</include>
<include>**/*TestCase.java</include>
</includes>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
<configuration>
<excludes>
<exclude>**/models/*</exclude>
<exclude>**/*Callback*</exclude>
<exclude>**/*Configuration*</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.eluder.coveralls</groupId>
<artifactId>coveralls-maven-plugin</artifactId>
<version>${coveralls.version}</version>
<configuration>
<repoToken>${env.COVERALLS_TOKEN}</repoToken>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${checkstyle.version}</version>
<executions>
<execution>
<id>validate</id>
<phase>validate</phase>
<configuration>
<encoding>UTF-8</encoding>
<consoleOutput>true</consoleOutput>
<failsOnError>true</failsOnError>
<configLocation>style.xml</configLocation>
</configuration>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
Expand Up @@ -21,7 +21,7 @@
KIND, either express or implied. See the Apache License for the specific
language governing permissions and limitations under the Apache License.
*******************************************************************************/
******************************************************************************/

package com.disney.pg2k4j;

Expand Down
12 changes: 7 additions & 5 deletions src/main/java/com/disney/pg2k4j/PostgresConfiguration.java
Expand Up @@ -21,7 +21,7 @@
KIND, either express or implied. See the Apache License for the specific
language governing permissions and limitations under the Apache License.
*******************************************************************************/
******************************************************************************/

package com.disney.pg2k4j;

Expand All @@ -31,8 +31,8 @@

public interface PostgresConfiguration {

static final String DEFAULT_PORT = "5432";
static final String MIN_SERVER_VERSION = "10.3";
String DEFAULT_PORT = "5432";
String MIN_SERVER_VERSION = "10.3";

default String getPort() {
return DEFAULT_PORT;
Expand All @@ -51,7 +51,8 @@ default String getQueryMode() {
}

default String getUrl() {
return String.format("jdbc:postgresql://%s:%s/%s", getHost(), getPort(), getDatabase());
return String.format("jdbc:postgresql://%s:%s/%s", getHost(),
getPort(), getDatabase());
}

default Properties getReplicationProperties() {
Expand All @@ -65,7 +66,8 @@ default Properties getQueryConnectionProperties() {
Properties properties = new Properties();
PGProperty.USER.set(properties, getUsername());
PGProperty.PASSWORD.set(properties, getPassword());
PGProperty.ASSUME_MIN_SERVER_VERSION.set(properties, getMinServerVersion());
PGProperty.ASSUME_MIN_SERVER_VERSION.set(properties,
getMinServerVersion());
return properties;
}

Expand Down

0 comments on commit 5dee23d

Please sign in to comment.