@Override public int run(InputStream in, PrintStream out, PrintStream err, List<String> args) throws Exception { InputStream input = getClass().getResourceAsStream("/version-banner.txt"); if (input == null) { err.printf("Cannot determine version number\n"); return -1; } out.write(IOUtils.toByteArray(input)); out.println("jclouds " + JcloudsVersion.get().toString()); return 0; }
@VisibleForTesting JcloudsVersion(ClassLoader resourceLoader) { this(readVersionPropertyFromClasspath(resourceLoader)); }
@Test(expectedExceptions = { IllegalArgumentException.class }) public void testFailsIfNonSemverReleaseCandidate() { // no longer supported after the 1.3.0 RC cycle new JcloudsVersion("1.2.3-rc-4"); }
String.format("s3proxy/%s jclouds/%s java/%s", Main.class.getPackage().getImplementationVersion(), JcloudsVersion.get(), System.getProperty("java.version")));
@Test public void testExtractsVersionFromResourceFile() { JcloudsVersion version = new JcloudsVersion(); assertEquals("0.0.0-SNAPSHOT", version.toString()); }
public static Properties defaultProperties() { Properties props = new Properties(); // TODO: move this to ApiMetadata final int numUserThreads = 50; props.setProperty(PROPERTY_ISO3166_CODES, ""); props.setProperty(PROPERTY_MAX_CONNECTIONS_PER_CONTEXT, 20 + ""); props.setProperty(PROPERTY_MAX_CONNECTIONS_PER_HOST, 0 + ""); props.setProperty(PROPERTY_SO_TIMEOUT, 60000 + ""); props.setProperty(PROPERTY_CONNECTION_TIMEOUT, 60000 + ""); // Successfully tested 50 user threads with BlobStore.clearContainer. props.setProperty(PROPERTY_USER_THREADS, numUserThreads + ""); props.setProperty(PROPERTY_SCHEDULER_THREADS, 10 + ""); props.setProperty(PROPERTY_MAX_CONNECTION_REUSE, 75 + ""); props.setProperty(PROPERTY_MAX_SESSION_FAILURES, 2 + ""); props.setProperty(PROPERTY_SESSION_INTERVAL, 60 + ""); props.setProperty(PROPERTY_PRETTY_PRINT_PAYLOADS, "true"); props.setProperty(PROPERTY_STRIP_EXPECT_HEADER, "false"); props.setProperty(PROPERTY_USER_AGENT, String.format("jclouds/%s java/%s", JcloudsVersion.get(), System.getProperty("java.version"))); props.setProperty(PROPERTY_CONNECTION_CLOSE_HEADER, "false"); // By default, we allow maximum parallel deletes to be equal to the number // of user threads since one thread is used to delete on blob. props.setProperty(PROPERTY_MAX_PARALLEL_DELETES, numUserThreads + ""); props.setProperty(PROPERTY_IDEMPOTENT_METHODS, "DELETE,GET,HEAD,OPTIONS,PUT"); return props; }
@Test public void testExtractsVersionFromResourceFile() { JcloudsVersion version = new JcloudsVersion(); assertEquals("0.0.0-SNAPSHOT", version.toString()); }
@Override public int run(InputStream in, PrintStream out, PrintStream err, List<String> args) throws Exception { InputStream input = getClass().getResourceAsStream("/version-banner.txt"); if (input == null) { err.printf("Cannot determine version number\n"); return -1; } out.write(IOUtils.toByteArray(input)); out.println("jclouds " + JcloudsVersion.get().toString()); return 0; }
public static Properties defaultProperties() { Properties props = new Properties(); // TODO: move this to ApiMetadata final int numUserThreads = 50; props.setProperty(PROPERTY_ISO3166_CODES, ""); props.setProperty(PROPERTY_MAX_CONNECTIONS_PER_CONTEXT, 20 + ""); props.setProperty(PROPERTY_MAX_CONNECTIONS_PER_HOST, 0 + ""); props.setProperty(PROPERTY_SO_TIMEOUT, 60000 + ""); props.setProperty(PROPERTY_CONNECTION_TIMEOUT, 60000 + ""); // Successfully tested 50 user threads with BlobStore.clearContainer. props.setProperty(PROPERTY_USER_THREADS, numUserThreads + ""); props.setProperty(PROPERTY_SCHEDULER_THREADS, 10 + ""); props.setProperty(PROPERTY_MAX_CONNECTION_REUSE, 75 + ""); props.setProperty(PROPERTY_MAX_SESSION_FAILURES, 2 + ""); props.setProperty(PROPERTY_SESSION_INTERVAL, 60 + ""); props.setProperty(PROPERTY_PRETTY_PRINT_PAYLOADS, "true"); props.setProperty(PROPERTY_STRIP_EXPECT_HEADER, "false"); props.setProperty(PROPERTY_USER_AGENT, String.format("jclouds/%s java/%s", JcloudsVersion.get(), System.getProperty("java.version"))); props.setProperty(PROPERTY_CONNECTION_CLOSE_HEADER, "false"); // By default, we allow maximum parallel deletes to be equal to the number // of user threads since one thread is used to delete on blob. props.setProperty(PROPERTY_MAX_PARALLEL_DELETES, numUserThreads + ""); props.setProperty(PROPERTY_IDEMPOTENT_METHODS, "DELETE,GET,HEAD,OPTIONS,PUT"); return props; }
@VisibleForTesting JcloudsVersion(ClassLoader resourceLoader) { this(readVersionPropertyFromClasspath(resourceLoader)); }
@Test(expectedExceptions = { IllegalArgumentException.class }) public void testFailsIfReleaseCandidateSnapshot() { new JcloudsVersion("1.2.3-rc.4-SNAPSHOT"); }
protected Builder() { id("byon") .name("Bring Your Own Node (BYON) API") .identityName("Unused") .defaultIdentity("foo") .defaultCredential("bar") .defaultEndpoint("file://byon.yaml") .documentation(URI.create("https://github.com/jclouds/jclouds/tree/master/apis/byon")) .version(String.format("%s.%s", JcloudsVersion.get().majorVersion, JcloudsVersion.get().minorVersion)) .buildVersion(JcloudsVersion.get().toString()) .view(ComputeServiceContext.class) .defaultModules(ImmutableSet.<Class<? extends Module>>of(YamlNodeStoreModule.class, BYONComputeServiceContextModule.class)); }
String.format("s3proxy/%s jclouds/%s java/%s", Main.class.getPackage().getImplementationVersion(), JcloudsVersion.get(), System.getProperty("java.version")));
@VisibleForTesting JcloudsVersion(ClassLoader resourceLoader) { this(readVersionPropertyFromClasspath(resourceLoader)); }
@Test(expectedExceptions = { IllegalArgumentException.class }) public void testFailsIfInvalidVersion() { new JcloudsVersion("${project.version}"); }
protected Builder() { id("byon") .name("Bring Your Own Node (BYON) API") .identityName("Unused") .defaultIdentity("foo") .defaultCredential("bar") .defaultEndpoint("file://byon.yaml") .documentation(URI.create("https://github.com/jclouds/jclouds/tree/master/apis/byon")) .version(String.format("%s.%s", JcloudsVersion.get().majorVersion, JcloudsVersion.get().minorVersion)) .buildVersion(JcloudsVersion.get().toString()) .view(ComputeServiceContext.class) .defaultModules(ImmutableSet.<Class<? extends Module>>of(YamlNodeStoreModule.class, BYONComputeServiceContextModule.class)); }
String.format("s3proxy/%s jclouds/%s java/%s", Main.class.getPackage().getImplementationVersion(), JcloudsVersion.get(), System.getProperty("java.version")));
@VisibleForTesting JcloudsVersion(ClassLoader resourceLoader) { this(readVersionPropertyFromClasspath(resourceLoader)); }
@Test(expectedExceptions = { IllegalArgumentException.class }) public void testFailsIfAlphaSnapshot() { new JcloudsVersion("1.2.3-alpha.5-SNAPSHOT"); }
protected Builder() { id("byon") .name("Bring Your Own Node (BYON) API") .identityName("Unused") .defaultIdentity("foo") .defaultCredential("bar") .defaultEndpoint("file://byon.yaml") .documentation(URI.create("https://github.com/jclouds/jclouds/tree/master/apis/byon")) .version(String.format("%s.%s", JcloudsVersion.get().majorVersion, JcloudsVersion.get().minorVersion)) .buildVersion(JcloudsVersion.get().toString()) .view(ComputeServiceContext.class) .defaultModules(ImmutableSet.<Class<? extends Module>>of(YamlNodeStoreModule.class, BYONComputeServiceContextModule.class)); }