Skip to content
Merged
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
@@ -1,10 +1,13 @@
package org.janelia.saalfeldlab.n5.s3;

import static org.junit.Assume.assumeTrue;

import org.janelia.saalfeldlab.n5.KeyValueAccess;
import org.janelia.saalfeldlab.n5.N5URI;
import org.janelia.saalfeldlab.n5.kva.AbstractKeyValueAccessTest;
import org.janelia.saalfeldlab.n5.s3.mock.MockS3Factory;
import org.junit.After;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration;
Expand All @@ -16,7 +19,14 @@
import java.util.ArrayList;

public class AmazonS3KeyValueAccessTest extends AbstractKeyValueAccessTest {


@BeforeClass
public static void before() {

MockS3Factory.getOrCreateS3();
assumeTrue("mock s3 server not running", MockS3Factory.isMinioServerRunning());
}

private ArrayList<AmazonS3KeyValueAccess> kvas;

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
package org.janelia.saalfeldlab.n5.s3;

import org.janelia.saalfeldlab.n5.s3.mock.MockS3Factory;
import static org.junit.Assume.assumeTrue;

import org.janelia.saalfeldlab.n5.s3.mock.MockS3Factory;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;

import software.amazon.awssdk.services.s3.S3Client;

public class N5AmazonS3MockTests extends N5AmazonS3Tests {

@BeforeClass
public static void before() {

MockS3Factory.getOrCreateS3();
assumeTrue("mock s3 server not running", MockS3Factory.isMinioServerRunning());
}

@Override
protected S3Client getS3() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ public static void startMinioServer() throws Exception {
return;
}

// TODO if the server fails to start for some reason
// e.g. minio server not installed
// probably should not fail, but report "mock test skipped" or something
minioServerDirectory = createTmpServerDirectory();
ProcessBuilder processBuilder = new ProcessBuilder("minio", "server", ".");
processBuilder.directory(minioServerDirectory.toFile());
Expand Down Expand Up @@ -104,7 +101,7 @@ private static Path createTmpServerDirectory() throws IOException {
return tempDirectory;
}

private static boolean isMinioServerRunning() {
public static boolean isMinioServerRunning() {

try {
minioUri.toURL().openConnection().connect();
Expand Down
Loading