Skip to content

Commit

Permalink
fix merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
aozarov committed Apr 25, 2016
2 parents 965f7a6 + 8e914de commit 6639c66
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,17 @@ public class LocalPubsubHelper {
private final int port;
private final LocalServiceHelper serviceHelper;


// Local server settings
private static final int DEFAULT_PORT = 8080;
private static final String DEFAULT_HOST = "localhost";
private static final URL EMULATE_URL;
private static final URL EMULATOR_URL;

// GCloud emulator settings
private static final String GCLOUD_CMD_TEXT = "gcloud beta emulators pubsub start --host-port";
private static final String GCLOUD_CMD_TEXT = "gcloud beta emulators pubsub start";
private static final String GCLOUD_CMD_PORT_FLAG = "--host-port=";
private static final String VERSION_PREFIX = "pubsub-emulator";
private static final String MIN_VERSION = "2016.01.13";
private static final String BIN_CMD_PORT_FLAG = "--port=";

// Downloadable emulator settings
private static final String FILENAME = "pubsub-emulator-20160113-2.zip";
Expand All @@ -57,7 +58,7 @@ public class LocalPubsubHelper {

static {
try {
EMULATE_URL = new URL("http://storage.googleapis.com/pubsub/tools/" + FILENAME);
EMULATOR_URL = new URL("http://storage.googleapis.com/pubsub/tools/" + FILENAME);
} catch (MalformedURLException ex) {
throw new IllegalStateException(ex);
}
Expand All @@ -70,11 +71,12 @@ public class LocalPubsubHelper {
public LocalPubsubHelper() {
port = LocalServiceHelper.findAvailablePort(DEFAULT_PORT);
List<String> gcloudCommand = new ArrayList<>(Arrays.asList(GCLOUD_CMD_TEXT.split(" ")));
gcloudCommand.add(DEFAULT_HOST);
gcloudCommand.add(GCLOUD_CMD_PORT_FLAG + port);
GCloudEmulatorRunner gcloudRunner =
new GCloudEmulatorRunner(gcloudCommand, VERSION_PREFIX, MIN_VERSION);
DownloadableEmulatorRunner downloadRunner =
new DownloadableEmulatorRunner(Arrays.asList(BIN_NAME), EMULATE_URL, MD5_CHECKSUM);
new DownloadableEmulatorRunner(Arrays.asList(BIN_NAME, BIN_CMD_PORT_FLAG + port),
EMULATOR_URL, MD5_CHECKSUM);
serviceHelper =
new LocalServiceHelper(Arrays.asList(gcloudRunner, downloadRunner), port);
}
Expand Down

0 comments on commit 6639c66

Please sign in to comment.