Skip to content
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
30 changes: 7 additions & 23 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,30 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.nesscomputing</groupId>
<artifactId>ness-oss-parent</artifactId>
<version>34</version>
<artifactId>ness-root</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>

<scm>
<connection>scm:git:git://github.com/NessComputing/components-ness-pg.git</connection>
<developerConnection>scm:git:git@github.com:NessComputing/components-ness-pg.git</developerConnection>
<url>http://github.com/NessComputing/components-ness-pg</url>
<tag>HEAD</tag>
</scm>

<groupId>com.nesscomputing.components</groupId>
<artifactId>ness-pg-embedded</artifactId>
<version>2.6.2-SNAPSHOT</version>
<description>Embedded PostgreSQL driver</description>

<dependencies>
<dependency>
<groupId>com.nesscomputing.components</groupId>
<artifactId>ness-config</artifactId>
<version>2.3.0</version>
</dependency>

<dependency>
<groupId>org.jdbi</groupId>
<artifactId>jdbi</artifactId>
<version>2.38.1</version>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>


<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
Expand All @@ -65,29 +54,25 @@
<artifactId>commons-configuration</artifactId>
</dependency>


<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<artifactId>annotations</artifactId>
<optional>true</optional>
</dependency>

<dependency>
<groupId>postgresql</groupId>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.1-901-1.jdbc4</version>
</dependency>

<dependency>
<groupId>com.nesscomputing.migratory</groupId>
<artifactId>migratory-core</artifactId>
<version>3.1.1</version>
</dependency>

<dependency>
<groupId>com.nesscomputing.components</groupId>
<artifactId>ness-integration-testing</artifactId>
<version>3.3.0</version>
<optional>true</optional>
</dependency>

Expand All @@ -99,8 +84,8 @@
</dependency>

<dependency>
<groupId>com.nesscomputing.testing</groupId>
<artifactId>kawala-lessio</artifactId>
<groupId>org.kitei.testing</groupId>
<artifactId>kitei-lessio</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
Expand All @@ -114,7 +99,6 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>1.9.0</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,9 @@ private void checkReady() throws SQLException
try (final Connection c = getPostgresDatabase().getConnection()) {
try (final Statement s = c.createStatement()) {
try (final ResultSet rs = s.executeQuery("SELECT 1")) { // NOPMD
Preconditions.checkState(rs.next() == true, "expecting single row");
Preconditions.checkState(rs.next(), "expecting single row");
Preconditions.checkState(1 == rs.getInt(1), "expecting 1");
Preconditions.checkState(rs.next() == false, "expecting single row");
Preconditions.checkState(!rs.next(), "expecting single row");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@
import com.google.common.collect.Maps;
import com.google.common.util.concurrent.ThreadFactoryBuilder;

import org.apache.commons.configuration.MapConfiguration;
import org.apache.commons.lang3.RandomStringUtils;
import org.skife.jdbi.v2.DBI;
import org.skife.jdbi.v2.Handle;
import org.skife.jdbi.v2.tweak.HandleCallback;

import com.nesscomputing.config.Config;
import com.nesscomputing.migratory.Migratory;
import com.nesscomputing.migratory.MigratoryConfig;
import com.nesscomputing.migratory.MigratoryContext;
import com.nesscomputing.migratory.locator.AbstractSqlResourceLocator;
import com.nesscomputing.migratory.migration.MigrationPlan;

import org.apache.commons.configuration.MapConfiguration;
import org.apache.commons.lang3.RandomStringUtils;
import org.skife.jdbi.v2.DBI;
import org.skife.jdbi.v2.Handle;
import org.skife.jdbi.v2.tweak.HandleCallback;

public class EmbeddedPostgreSQLController
{
private static final String JDBC_FORMAT = "jdbc:postgresql://localhost:%d/%s";
Expand All @@ -74,7 +74,7 @@ public EmbeddedPostgreSQLController(URI baseUrl, String[] personalities)
* Each schema set has its own database cluster. The template1 database has the schema preloaded so that
* each test case need only create a new database and not re-invoke Migratory.
*/
private synchronized static Cluster getCluster(URI baseUrl, String[] personalities) throws IOException
private static synchronized Cluster getCluster(URI baseUrl, String[] personalities) throws IOException
{
final Entry<URI, Set<String>> key = Maps.immutableEntry(baseUrl, (Set<String>)ImmutableSet.copyOf(personalities));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

import java.io.IOException;

import org.junit.rules.ExternalResource;

import com.google.common.base.Preconditions;
import com.nesscomputing.testing.lessio.AllowAll;

import org.junit.rules.ExternalResource;
import org.kitei.testing.lessio.AllowAll;

@AllowAll
public class EmbeddedPostgreSQLRule extends ExternalResource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@

import javax.annotation.Nonnull;

import org.junit.rules.TestRule;

import com.nesscomputing.config.Config;

public class EmbeddedPostgresRules
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@

import java.net.URI;

import org.junit.rules.ExternalResource;

import com.nesscomputing.config.Config;
import com.nesscomputing.db.postgres.embedded.EmbeddedPostgreSQLController;
import com.nesscomputing.testing.lessio.AllowAll;

import org.junit.rules.ExternalResource;
import org.kitei.testing.lessio.AllowAll;

@AllowAll
public class EmbeddedPostgresTestDatabaseRule extends ExternalResource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@

import org.junit.Rule;
import org.junit.Test;

import com.nesscomputing.db.postgres.embedded.EmbeddedPostgreSQLRule;
import com.nesscomputing.testing.lessio.AllowNetworkAccess;
import org.kitei.testing.lessio.AllowNetworkAccess;

@AllowNetworkAccess(endpoints = {"127.0.0.1:*"})
public class EmbeddedPostgreSQLRuleTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,13 @@
import java.sql.Statement;

import org.junit.Test;

import com.nesscomputing.db.postgres.embedded.EmbeddedPostgreSQL;
import com.nesscomputing.testing.lessio.AllowExternalProcess;
import com.nesscomputing.testing.lessio.AllowLocalFileAccess;
import com.nesscomputing.testing.lessio.AllowNetworkAccess;
import com.nesscomputing.testing.lessio.AllowNetworkListen;
import org.kitei.testing.lessio.AllowExternalProcess;
import org.kitei.testing.lessio.AllowTmpDirAccess;
import org.kitei.testing.lessio.AllowNetworkAccess;
import org.kitei.testing.lessio.AllowNetworkListen;

@AllowExternalProcess
@AllowLocalFileAccess(paths = {"*"})
@AllowTmpDirAccess
@AllowNetworkListen(ports = {0})
@AllowNetworkAccess(endpoints = {"127.0.0.1:*"})
public class EmbeddedPostgreSQLTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@

import org.junit.Rule;
import org.junit.Test;

import com.nesscomputing.db.postgres.embedded.EmbeddedPostgreSQLRule;
import com.nesscomputing.testing.lessio.AllowNetworkAccess;
import org.kitei.testing.lessio.AllowNetworkAccess;

@AllowNetworkAccess(endpoints = {"127.0.0.1:*"})
public class IsolationTest
Expand Down