Skip to content

Commit

Permalink
checkstyle fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hgschmie committed Oct 21, 2023
1 parent 9df87bc commit d542a0d
Show file tree
Hide file tree
Showing 28 changed files with 57 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package de.softwareforge.testing.postgres.embedded;

import static com.google.common.base.Preconditions.checkState;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ public DataSource createDefaultDataSource() throws SQLException {
/**
* Creates a {@link DataSource} with a specific user and database name.
* <p>
* Creating the DataSource does <b>not</b> create the database or the user itself. This must be done by the calling code (e.g. with a {@link
* EmbeddedPostgresPreparer}).
* Creating the DataSource does <b>not</b> create the database or the user itself. This must be done by the calling code (e.g. with a
* {@link EmbeddedPostgresPreparer}).
*/
@Nonnull
public DataSource createDataSource(@Nonnull String user, @Nonnull String databaseName) throws SQLException {
Expand Down Expand Up @@ -912,9 +912,9 @@ public Builder setNativeBinaryManager(@Nonnull NativeBinaryManager nativeBinaryM

/**
* Use a locally installed PostgreSQL server for tests. The tests will still spin up a new instance and locate the data in the data directory but it
* will use the locally installed binaries for starting and stopping. Calling this method sets a binary manager, so it overrides {@link
* Builder#setNativeBinaryManager(NativeBinaryManager)}. Calling this method makes the builder ignore the {@link
* Builder#setInstallationBaseDirectory(File)} setting.
* will use the locally installed binaries for starting and stopping. Calling this method sets a binary manager, so it overrides
* {@link Builder#setNativeBinaryManager(NativeBinaryManager)}. Calling this method makes the builder ignore the
* {@link Builder#setInstallationBaseDirectory(File)} setting.
*
* @param directory A local directory that contains a standard PostgreSQL installation. The directory must exist and read and executable.
* @return The builder itself.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package de.softwareforge.testing.postgres.embedded;

import jakarta.annotation.Nonnull;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package de.softwareforge.testing.postgres.embedded;

import static com.google.common.base.Preconditions.checkNotNull;
Expand Down Expand Up @@ -48,15 +49,15 @@ public static FlywayPreparer forClasspathLocation(String... locations) {
}

/**
* Create a new, uninitialized preparer instance. Use {@link FlywayPreparer#addCustomizer(Consumer)} to modify the configuration for the {@link
* FluentConfiguration} object.
* Create a new, uninitialized preparer instance. Use {@link FlywayPreparer#addCustomizer(Consumer)} to modify the configuration for the
* {@link FluentConfiguration} object.
*/
public FlywayPreparer() {
}

/**
* Add a customizer instance. Each customizer is called once with the {@link FluentConfiguration} instance before setting the datasource and calling {@link
* FluentConfiguration#load()} and {@link Flyway#migrate()}.
* Add a customizer instance. Each customizer is called once with the {@link FluentConfiguration} instance before setting the datasource and calling
* {@link FluentConfiguration#load()} and {@link Flyway#migrate()}.
*
* @param customizer A {@link Consumer<FluentConfiguration>} instance. Must not be null.
* @return This object.
Expand All @@ -71,8 +72,8 @@ public FlywayPreparer addCustomizer(@Nonnull Consumer<FluentConfiguration> custo
}

/**
* Add customizer instances. Each customizer is called once with the {@link FluentConfiguration} instance before setting the datasource and calling {@link
* FluentConfiguration#load()} and {@link Flyway#migrate()}.
* Add customizer instances. Each customizer is called once with the {@link FluentConfiguration} instance before setting the datasource and calling
* {@link FluentConfiguration#load()} and {@link Flyway#migrate()}.
*
* @param customizers A set of {@link Consumer<FluentConfiguration>} instances. Must not be null.
* @return This object.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package de.softwareforge.testing.postgres.embedded;

import static com.google.common.base.Preconditions.checkState;
Expand All @@ -28,8 +29,8 @@
/**
* Locates a native binary on the Filesystem. If necessary, it should download the binary first from the network.
* <p>
* Implementations of this class <b>must</b> implement {@link Object#hashCode()} and {@link Object#equals(Object)} and <i>should</i> implement {@link
* Object#toString()}.
* Implementations of this class <b>must</b> implement {@link Object#hashCode()} and {@link Object#equals(Object)} and <i>should</i> implement
* {@link Object#toString()}.
*
* @since 3.0
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package de.softwareforge.testing.postgres.embedded;

import jakarta.annotation.Nonnull;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package de.softwareforge.testing.postgres.embedded;

import static com.google.common.base.Preconditions.checkNotNull;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@
/**
* PostgreSQL management code. Contains all the test-framework independent pieces to start, stop and manage database instances and schemas.
*/

package de.softwareforge.testing.postgres.embedded;
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package de.softwareforge.testing.postgres.junit5;

import static com.google.common.base.Preconditions.checkNotNull;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package de.softwareforge.testing.postgres.junit5;

import de.softwareforge.testing.postgres.embedded.DatabaseManager;
Expand Down Expand Up @@ -62,8 +63,8 @@ public static DatabaseManager.Builder<EmbeddedPgExtension> preparedInstance(@Non
}

/**
* Create a builder with standard initializations ({@link EmbeddedPostgres.Builder#withDefaults()}) applied and register a {@link
* EmbeddedPostgresPreparer<DataSource>} to set up the template database.
* Create a builder with standard initializations ({@link EmbeddedPostgres.Builder#withDefaults()}) applied and register a
* {@link EmbeddedPostgresPreparer<DataSource>} to set up the template database.
*
* @param databasePreparer A {@link EmbeddedPostgresPreparer<DataSource>} instance. Must not be null.
* @return A {@link DatabaseManager.Builder<EmbeddedPgExtension>} instance that can be customized further.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package de.softwareforge.testing.postgres.junit5;

import static com.google.common.base.Preconditions.checkNotNull;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package de.softwareforge.testing.postgres.junit5;

import java.lang.annotation.ElementType;
Expand All @@ -21,8 +22,8 @@
import org.junit.jupiter.api.extension.ExtendWith;

/**
* {@code RequirePostgresVersion} signals the annotated test class or method that it only should execute if the PostgreSQL server is within a specific range.
* If the version is outside the range, the annotated test class or method is skipped.
* {@code RequirePostgresVersion} signals the annotated test class or method that it only should execute if the PostgreSQL server is within a specific range. If
* the version is outside the range, the annotated test class or method is skipped.
* <p>
* PostgreSQL versions are interpreted as described in the <a href="https://www.postgresql.org/support/versioning/">Versioning Policy</a> and structured as
* "major.minor.patch". Versions can be abbreviated, e.g. "13" is interpreted as "13.0.0".
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package de.softwareforge.testing.postgres.junit5;

import de.softwareforge.testing.postgres.embedded.DatabaseManager;
Expand All @@ -21,7 +22,6 @@
import javax.sql.DataSource;



/**
* Create a new PostgreSQL server that supports a single database.
*/
Expand Down Expand Up @@ -64,8 +64,8 @@ public static DatabaseManager.Builder<EmbeddedPgExtension> preparedInstance(@Non
}

/**
* Create a builder with standard initializations ({@link EmbeddedPostgres.Builder#withDefaults()}) applied and register a {@link
* EmbeddedPostgresPreparer<DataSource>} to set up the database.
* Create a builder with standard initializations ({@link EmbeddedPostgres.Builder#withDefaults()}) applied and register a
* {@link EmbeddedPostgresPreparer<DataSource>} to set up the database.
*
* @param databasePreparer A {@link EmbeddedPostgresPreparer<DataSource>} instance. Must not be null.
* @return A {@link DatabaseManager.Builder<EmbeddedPgExtension>} instance that can be customized further.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@
/**
* JUnit 5 integration code. Requires the Jupiter API on the class path.
*/

package de.softwareforge.testing.postgres.junit5;
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package de.softwareforge.testing.postgres.embedded;

import static org.junit.jupiter.api.Assertions.assertEquals;
Expand All @@ -26,8 +27,7 @@
import org.junit.jupiter.api.Test;

/**
* Requires a compatible postgres binary on the classpath (as part of the dependencies in test
* scope in the project pom.
* Requires a compatible postgres binary on the classpath (as part of the dependencies in test scope in the project pom.
*/

public class ClasspathLocatorTest {
Expand All @@ -51,6 +51,7 @@ public void testClasspathLocator() throws Exception {
}

static class ClasspathLocator implements NativeBinaryLocator {

private final String name;

ClasspathLocator(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package de.softwareforge.testing.postgres.embedded;

import static com.google.common.base.Preconditions.checkState;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package de.softwareforge.testing.postgres.embedded;

import static org.junit.jupiter.api.Assertions.assertEquals;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package de.softwareforge.testing.postgres.embedded;

import static org.junit.jupiter.api.Assertions.assertEquals;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package de.softwareforge.testing.postgres.embedded;

import static org.junit.jupiter.api.Assertions.assertArrayEquals;
Expand All @@ -21,6 +22,8 @@
import static org.junit.jupiter.api.Assertions.fail;
import static org.postgresql.PGProperty.CONNECT_TIMEOUT;

import de.softwareforge.testing.postgres.junit5.RequirePostgresVersion;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
Expand All @@ -31,7 +34,6 @@
import java.util.Map;
import javax.sql.DataSource;

import de.softwareforge.testing.postgres.junit5.RequirePostgresVersion;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
import org.postgresql.ds.PGSimpleDataSource;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,22 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package de.softwareforge.testing.postgres.embedded;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;

import de.softwareforge.testing.postgres.junit5.RequirePostgresVersion;

import java.io.IOException;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import de.softwareforge.testing.postgres.junit5.RequirePostgresVersion;
import org.flywaydb.core.api.FlywayException;
import org.junit.jupiter.api.Test;

Expand Down Expand Up @@ -59,7 +61,7 @@ public void testMissing() throws Exception {
.forClasspathLocation("db/non-existing")
.addCustomizer(c -> c.failOnMissingLocations(true)))
.build()
) {
) {

IOException e = assertThrows(IOException.class, manager::start);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package de.softwareforge.testing.postgres.embedded;

import static java.lang.String.format;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,19 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package de.softwareforge.testing.postgres.embedded;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

public class PostgresVersionTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package de.softwareforge.testing.postgres.junit5;

import static java.lang.String.format;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package de.softwareforge.testing.postgres.junit5;

import static de.softwareforge.testing.postgres.junit5.Junit5ClassMemberTest.createTable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package de.softwareforge.testing.postgres.junit5;

import static java.lang.String.format;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package de.softwareforge.testing.postgres.junit5;

import static org.junit.jupiter.api.Assertions.assertEquals;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package de.softwareforge.testing.postgres.junit5;

import static de.softwareforge.testing.postgres.junit5.Junit5ClassMemberTest.createTable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package de.softwareforge.testing.postgres.junit5;

import static de.softwareforge.testing.postgres.junit5.Junit5ClassMemberTest.createTable;
Expand Down

0 comments on commit d542a0d

Please sign in to comment.