- Brings JClouds Chef up to speed with latest JClouds 1.0-SNAPSHOT (approximately 1.0-beta-9b)

- Unit tests all pass
- Some broken live tests, will fix soon
This commit is contained in:
Chris Custine 2011-03-13 22:20:22 -06:00
parent 79ac66fbd4
commit cdd1636514
35 changed files with 90 additions and 155 deletions

View File

@ -25,13 +25,12 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.jclouds</groupId> <groupId>org.jclouds</groupId>
<artifactId>jclouds-chef-project</artifactId> <artifactId>jclouds-chef-pom</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../project/pom.xml</relativePath>
</parent> </parent>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-chef</artifactId> <artifactId>jclouds-chef</artifactId>
<name>jclouds Chef core</name> <name>JClouds Chef :: Core</name>
<description>jclouds components to access Chef</description> <description>jclouds components to access Chef</description>
<properties> <properties>
@ -45,120 +44,57 @@
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>${project.groupId}</groupId> <groupId>org.jclouds</groupId>
<artifactId>jclouds-core</artifactId> <artifactId>jclouds-core</artifactId>
<version>${jclouds.version}</version> <version>${jclouds.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-core</artifactId>
<version>${jclouds.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-scriptbuilder</artifactId>
<version>${jclouds.version}</version>
</dependency>
<!-- for transient chef provider -->
<dependency>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-blobstore</artifactId>
<version>${jclouds.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-compute</artifactId>
<version>${jclouds.version}</version>
</dependency>
<dependency>
<groupId>org.jclouds.driver</groupId>
<artifactId>jclouds-log4j</artifactId>
<version>${jclouds.version}</version>
<scope>test</scope>
</dependency>
<!-- only required for Pems.java and only writing a private key file --> <!-- only required for Pems.java and only writing a private key file -->
<dependency> <dependency>
<groupId>org.bouncycastle</groupId> <groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15</artifactId> <artifactId>bcprov-jdk15</artifactId>
<version>1.44</version> <version>1.44</version>
</dependency> </dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>jclouds-scriptbuilder</artifactId>
<version>${jclouds.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>jclouds-core</artifactId>
<version>${jclouds.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency> <dependency>
<groupId>log4j</groupId> <groupId>log4j</groupId>
<artifactId>log4j</artifactId> <artifactId>log4j</artifactId>
<version>1.2.14</version> <version>1.2.14</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>org.jclouds.driver</groupId>
<artifactId>jclouds-log4j</artifactId>
<version>${jclouds.version}</version>
<scope>test</scope>
</dependency>
<dependency> <dependency>
<groupId>org.danlarkin</groupId> <groupId>org.danlarkin</groupId>
<artifactId>clojure-json</artifactId> <artifactId>clojure-json</artifactId>
<version>1.1</version> <version>1.1</version>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>
<!-- for transient chef provider -->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>jclouds-blobstore</artifactId>
<version>${jclouds.version}</version>
<optional>true</optional>
</dependency>
</dependencies> </dependencies>
<!--TODO: This is borrowed from another module, the chef properties need to be filled in for the tests to work-->
<!--
<profiles>
<profile>
<id>live</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<executions>
<execution>
<id>integration</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<excludes>
<exclude>none</exclude>
</excludes>
<includes>
<include>**/*LiveTest.java</include>
</includes>
<systemProperties>
<property>
<name>jclouds.compute.provider</name>
<value>${jclouds.compute.provider}</value>
</property>
<property>
<name>jclouds.compute.endpoint</name>
<value>${jclouds.compute.endpoint}</value>
</property>
<property>
<name>jclouds.compute.identity</name>
<value>${jclouds.compute.identity}</value>
</property>
<property>
<name>jclouds.compute.credential</name>
<value>${jclouds.compute.credential}</value>
</property>
<property>
<name>jclouds.compute.tag</name>
<value>${jclouds.compute.tag}</value>
</property>
<property>
<name>jclouds.compute.credential</name>
<value>${jclouds.compute.credential}</value>
</property>
<property>
<name>jclouds.chef.credential.pem</name>
<value>${jclouds.chef.credential.pem}</value>
</property>
<property>
<name>jclouds.chef.endpoint</name>
<value>${jclouds.chef.endpoint}</value>
</property>
</systemProperties>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
-->
</project> </project>

View File

@ -92,7 +92,7 @@ public class BaseChefRestClientModule<S, A> extends RestClientModule<S, A> {
@Singleton @Singleton
public PrivateKey provideKey(Crypto crypto, @Named(PROPERTY_CREDENTIAL) String pem) throws InvalidKeySpecException, public PrivateKey provideKey(Crypto crypto, @Named(PROPERTY_CREDENTIAL) String pem) throws InvalidKeySpecException,
IOException { IOException {
return crypto.rsaKeyFactory().generatePrivate(Pems.privateKeySpec(InputSuppliers.of(pem))); return crypto.rsaKeyFactory().generatePrivate(Pems.privateKeySpec(InputSuppliers.of(pem)));
} }
@Override @Override

View File

@ -19,24 +19,22 @@
package org.jclouds.ohai; package org.jclouds.ohai;
import java.util.Properties;
import javax.inject.Inject;
import org.jclouds.ohai.config.ConfiguresOhai;
import org.jclouds.ohai.config.JMXOhaiModule;
import org.jclouds.rest.RestContext;
import org.jclouds.rest.RestContextBuilder;
import com.google.common.base.Predicate; import com.google.common.base.Predicate;
import com.google.common.collect.Iterables; import com.google.common.collect.Iterables;
import com.google.inject.Module; import com.google.inject.Module;
import org.jclouds.compute.ComputeServiceContextBuilder;
import org.jclouds.ohai.config.ConfiguresOhai;
import org.jclouds.ohai.config.JMXOhaiModule;
import org.jclouds.rest.RestContext;
import javax.inject.Inject;
import java.util.Properties;
/** /**
* *
* @see RestContext * @see RestContext
*/ */
public class OhaiContextBuilder<S, A> extends RestContextBuilder<S, A> { public class OhaiContextBuilder<S, A> extends ComputeServiceContextBuilder<S, A> {
@Inject @Inject
public OhaiContextBuilder(Class<S> syncClientClass, Class<A> asyncClientClass, Properties properties) { public OhaiContextBuilder(Class<S> syncClientClass, Class<A> asyncClientClass, Properties properties) {

View File

@ -60,7 +60,7 @@ import com.google.common.primitives.Bytes;
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
@Test(groups = "live", testName = "chef.ChefClientLiveTest") @Test(groups = { "live" })
public abstract class BaseChefClientLiveTest { public abstract class BaseChefClientLiveTest {
protected String clientKey; protected String clientKey;

View File

@ -69,7 +69,7 @@ import com.google.inject.TypeLiteral;
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
@Test(groups = "unit", testName = "chef.ChefAsyncClientTest") @Test(groups = { "unit" })
public class ChefAsyncClientTest extends RestClientTest<ChefAsyncClient> { public class ChefAsyncClientTest extends RestClientTest<ChefAsyncClient> {
public void testCommitSandbox() throws SecurityException, NoSuchMethodException, IOException { public void testCommitSandbox() throws SecurityException, NoSuchMethodException, IOException {

View File

@ -46,7 +46,7 @@ import com.google.inject.Module;
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
@Test(groups = "live", testName = "chef.ChefClientLiveTest") @Test(groups = { "live" })
public class ChefClientLiveTest extends BaseChefClientLiveTest { public class ChefClientLiveTest extends BaseChefClientLiveTest {
private ChefContext validatorConnection; private ChefContext validatorConnection;

View File

@ -19,22 +19,21 @@
package org.jclouds.chef; package org.jclouds.chef;
import org.jclouds.util.Utils;
import org.testng.annotations.Test;
import com.google.common.collect.Iterables; import com.google.common.collect.Iterables;
import org.jclouds.compute.util.ComputeServiceUtils;
import org.testng.annotations.Test;
/** /**
* *
* @author Adrian Cole * @author Adrian Cole
* *
*/ */
@Test(groups = "unit") @Test(groups = { "unit" })
public class ProvidersInPropertiesTest { public class ProvidersInPropertiesTest {
@Test @Test
public void testSupportedProviders() { public void testSupportedProviders() {
Iterable<String> providers = Utils.getSupportedProviders(); Iterable<String> providers = ComputeServiceUtils.getSupportedProviders();
assert Iterables.contains(providers, "chef") : providers; assert Iterables.contains(providers, "chef") : providers;
} }

View File

@ -39,7 +39,7 @@ import com.google.inject.Injector;
/** /**
* @author Adrian Cole * @author Adrian Cole
*/ */
@Test(groups = "unit", testName = "chef.BootstrapChefClientTest") @Test(groups = { "unit" })
public class BindHexEncodedMD5sToJsonPayloadTest { public class BindHexEncodedMD5sToJsonPayloadTest {
Injector injector = Guice.createInjector(new ChefParserModule(), new GsonModule()); Injector injector = Guice.createInjector(new ChefParserModule(), new GsonModule());

View File

@ -20,6 +20,7 @@
package org.jclouds.chef.filters; package org.jclouds.chef.filters;
import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertEqualsNoOrder;
import java.io.IOException; import java.io.IOException;
import java.net.URI; import java.net.URI;
@ -54,7 +55,7 @@ import com.google.inject.Module;
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
@Test(groups = "unit", testName = "chef.SignedHeaderAuthTest") @Test(groups = { "unit" })
public class SignedHeaderAuthTest { public class SignedHeaderAuthTest {
public static final String USER_ID = "spec-user"; public static final String USER_ID = "spec-user";
@ -77,7 +78,8 @@ public class SignedHeaderAuthTest {
"NMzYZgyooSvU85qkIUmKuCqgG2AIlvYa2Q/2ctrMhoaHhLOCWWoqYNMaEqPc", "NMzYZgyooSvU85qkIUmKuCqgG2AIlvYa2Q/2ctrMhoaHhLOCWWoqYNMaEqPc",
"3tKHE+CfvP+WuPdWk4jv4wpIkAz6ZLxToxcGhXmZbXpk56YTmqgBW2cbbw4O", "3tKHE+CfvP+WuPdWk4jv4wpIkAz6ZLxToxcGhXmZbXpk56YTmqgBW2cbbw4O",
"IWPZDHSiPcw//AYNgW1CCDptt+UFuaFYbtqZegcBd2n/jzcWODA7zL4KWEUy", "IWPZDHSiPcw//AYNgW1CCDptt+UFuaFYbtqZegcBd2n/jzcWODA7zL4KWEUy",
"9q4rlh/+1tBReg60QdsmDRsw/cdO1GZrKtuCwbuD4+nbRdVBKv72rqHX9cu0", "utju9jzczCyB+sSAQWrxSsXB/b8vV2qs0l4VD2ML+w==" }; "9q4rlh/+1tBReg60QdsmDRsw/cdO1GZrKtuCwbuD4+nbRdVBKv72rqHX9cu0",
"utju9jzczCyB+sSAQWrxSsXB/b8vV2qs0l4VD2ML+w==" };
// We expect Mixlib::Authentication::SignedHeaderAuth//sign to return this // We expect Mixlib::Authentication::SignedHeaderAuth//sign to return this
// if passed the BODY above. // if passed the BODY above.
@ -142,8 +144,8 @@ public class SignedHeaderAuthTest {
request = signing_obj.filter(request); request = signing_obj.filter(request);
Multimap<String, String> headersWithoutContentLength = LinkedHashMultimap.create(request.getHeaders()); Multimap<String, String> headersWithoutContentLength = LinkedHashMultimap.create(request.getHeaders());
headersWithoutContentLength.removeAll(HttpHeaders.CONTENT_LENGTH); headersWithoutContentLength.removeAll( HttpHeaders.CONTENT_LENGTH );
assertEquals(headersWithoutContentLength.values(), EXPECTED_SIGN_RESULT.values()); assertEqualsNoOrder( headersWithoutContentLength.values().toArray(), EXPECTED_SIGN_RESULT.values().toArray() );
} }
@Test @Test
@ -154,7 +156,7 @@ public class SignedHeaderAuthTest {
request = signing_obj.filter(request); request = signing_obj.filter(request);
Multimap<String, String> headersWithoutContentLength = LinkedHashMultimap.create(request.getHeaders()); Multimap<String, String> headersWithoutContentLength = LinkedHashMultimap.create(request.getHeaders());
assertEquals(headersWithoutContentLength.entries(), EXPECTED_SIGN_RESULT_EMPTY.entries()); assertEqualsNoOrder(headersWithoutContentLength.entries().toArray(), EXPECTED_SIGN_RESULT_EMPTY.entries().toArray());
} }
@Test @Test

View File

@ -37,7 +37,7 @@ import com.google.common.collect.ImmutableSet;
/** /**
* @author Adrian Cole * @author Adrian Cole
*/ */
@Test(groups = "unit", testName = "chef.ClientForTagTest") @Test(groups = { "unit" })
public class ClientForTagTest { public class ClientForTagTest {
public void testWhenNoClientsInList() throws IOException { public void testWhenNoClientsInList() throws IOException {

View File

@ -52,7 +52,7 @@ import com.google.inject.TypeLiteral;
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
@Test(groups = "unit", sequential = true, testName = "chef.ParseClientFromJsonTest") @Test(groups = { "unit" }, sequential = true)
public class ParseClientFromJsonTest { public class ParseClientFromJsonTest {
private static final String PRIVATE_KEY = "-----BEGIN RSA PRIVATE KEY-----\nMIIEpQIBAAKCAQEAyb2ZJJqGm0KKR+8nfQJNsSd+F9tXNMV7CfOcW6jsqs8EZgiV\nR09hD1IYOj4YqM0qJONlgyg4xRWewdSG7QTPj1lJpVAida9sXy2+kzyagZA1Am0O\nZcbqb5hoeIDgcX+eDa79s0u0DomjcfO9EKhvHLBz+zM+3QqPRkPV8nYTbfs+HjVz\nzOU6D1B0XR3+IPZZl2AnWs2d0qhnStHcDUvnRVQ0P482YwN9VgceOZtpPz0DCKEJ\n5Tx5STub8k0/zt/VAMHQafLSuQMLd2s4ZLuOZptN//uAsTmxireqd37z+8ZTdBbJ\n8LEpJ+iCXuSfm5aUh7iw6oxvToY2AL53+jK2UQIDAQABAoIBAQDA88B3i/xWn0vX\nBVxFamCYoecuNjGwXXkSyZew616A+EOCu47bh4aTurdFbYL0YFaAtaWvzlaN2eHg\nDb+HDuTefE29+WkcGk6SshPmiz5T0XOCAICWw6wSVDkHmGwS4jZvbAFm7W8nwGk9\nYhxgxFiRngswJZFopOLoF5WXs2td8guIYNslMpo7tu50iFnBHwKO2ZsPAk8t9nnS\nxlDavKruymEmqHCr3+dtio5eaenJcp3fjoXBQOKUk3ipII29XRB8NqeCVV/7Kxwq\nckqOBEbRwBclckyIbD+RiAgKvOelORjEiE9R42vuqvxRA6k9kd9o7utlX0AUtpEn\n3gZc6LepAoGBAP9ael5Y75+sK2JJUNOOhO8ae45cdsilp2yI0X+UBaSuQs2+dyPp\nkpEHAxd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ZAycLfhffAoGBAIggVsefBCvuQkF0NeUhmDCRZfhnd8y55RHR\n1HCvqKIlpv+rhcX/zmyBLuteopYyRJRsOiE2FW00i8+rIPRu4Z3Q5nybx7w3PzV9\noHN5R5baE9OyI4KpZWztpYYitZF67NcnAvVULHHOvVJQGnKYfLHJYmrJF7GA1ojM\nAuMdFbjFAoGAPxUhxwFy8gaqBahKUEZn4F81HFP5ihGhkT4QL6AFPO2e+JhIGjuR\n27+85hcFqQ+HHVtFsm81b/a+R7P4UuCRgc8eCjxQMoJ1Xl4n7VbjPbHMnIN0Ryvd\nO4ZpWDWYnCO021JTOUUOJ4J/y0416Bvkw0z59y7sNX7wDBBHHbK/XCc=\n-----END RSA PRIVATE KEY-----\n";

View File

@ -52,7 +52,7 @@ import com.google.inject.TypeLiteral;
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
@Test(groups = "unit", sequential = true, testName = "chef.ParseCookbookVersionFromJsonTest") @Test(groups = { "unit" }, sequential = true)
public class ParseCookbookVersionFromJsonTest { public class ParseCookbookVersionFromJsonTest {
private ParseJson<CookbookVersion> handler; private ParseJson<CookbookVersion> handler;

View File

@ -41,7 +41,7 @@ import com.google.inject.TypeLiteral;
/** /**
* @author AdrianCole * @author AdrianCole
*/ */
@Test(groups = "unit", testName = "chef.ParseDataBagItemFromJsonTest") @Test(groups = { "unit" })
public class ParseDataBagItemFromJsonTest { public class ParseDataBagItemFromJsonTest {
private ParseJson<DatabagItem> handler; private ParseJson<DatabagItem> handler;
private Json mapper; private Json mapper;

View File

@ -33,7 +33,7 @@ import org.testng.annotations.Test;
/** /**
* @author Adrian Cole * @author Adrian Cole
*/ */
@Test(groups = "unit", testName = "chef.ParseErrorFromJsonOrReturnBodyTest") @Test(groups = { "unit" })
public class ParseErrorFromJsonOrReturnBodyTest { public class ParseErrorFromJsonOrReturnBodyTest {
@Test @Test

View File

@ -39,7 +39,7 @@ import com.google.inject.Injector;
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
@Test(groups = "unit", sequential = true, testName = "chef.ParseKeySetFromJsonTest") @Test(groups = { "unit" }, sequential = true)
public class ParseKeySetFromJsonTest { public class ParseKeySetFromJsonTest {
private ParseKeySetFromJson handler; private ParseKeySetFromJson handler;

View File

@ -45,7 +45,7 @@ import com.google.inject.TypeLiteral;
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
@Test(groups = "unit", sequential = true, testName = "chef.ParseNodeFromJsonTest") @Test(groups = { "unit" }, sequential = true)
public class ParseNodeFromJsonTest { public class ParseNodeFromJsonTest {
private ParseJson<Node> handler; private ParseJson<Node> handler;

View File

@ -44,7 +44,7 @@ import com.google.inject.TypeLiteral;
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
@Test(groups = "unit", sequential = true, testName = "chef.ParseSandboxFromJsonTest") @Test(groups = { "unit" }, sequential = true)
public class ParseSandboxFromJsonTest { public class ParseSandboxFromJsonTest {
private ParseJson<Sandbox> handler; private ParseJson<Sandbox> handler;

View File

@ -48,7 +48,7 @@ import com.google.inject.TypeLiteral;
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
@Test(groups = "unit", sequential = true, testName = "chef.ParseUploadSiteFromJsonTest") @Test(groups = { "unit" }, sequential = true)
public class ParseUploadSandboxFromJsonTest { public class ParseUploadSandboxFromJsonTest {
private ParseJson<UploadSandbox> handler; private ParseJson<UploadSandbox> handler;

View File

@ -42,7 +42,7 @@ import com.google.inject.Injector;
/** /**
* @author Adrian Cole * @author Adrian Cole
*/ */
@Test(groups = "unit", testName = "chef.RunListForTagTest") @Test(groups = { "unit" })
public class RunListForTagTest { public class RunListForTagTest {
Injector injector = Guice.createInjector(new ChefParserModule(), new GsonModule()); Injector injector = Guice.createInjector(new ChefParserModule(), new GsonModule());
Json json = injector.getInstance(Json.class); Json json = injector.getInstance(Json.class);

View File

@ -50,7 +50,7 @@ import com.google.inject.Injector;
/** /**
* @author Adrian Cole * @author Adrian Cole
*/ */
@Test(groups = "unit", testName = "chef.TagToBootScriptTest") @Test(groups = { "unit" })
public class TagToBootScriptTest { public class TagToBootScriptTest {
Injector injector = Guice.createInjector(new ChefParserModule(), new GsonModule()); Injector injector = Guice.createInjector(new ChefParserModule(), new GsonModule());

View File

@ -38,7 +38,7 @@ import org.testng.annotations.Test;
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
@Test(groups = "unit", testName = "chef.ChefClientErrorRetryHandlerTest") @Test(groups = { "unit" })
public class ChefClientErrorRetryHandlerTest { public class ChefClientErrorRetryHandlerTest {
@Test @Test
public void test401DoesNotRetry() { public void test401DoesNotRetry() {

View File

@ -46,7 +46,7 @@ import com.google.inject.Module;
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
@Test(groups = "live", testName = "chef.BaseChefStrategyLiveTest") @Test(groups = { "live" })
public abstract class BaseChefStrategyLiveTest { public abstract class BaseChefStrategyLiveTest {
protected Injector injector; protected Injector injector;

View File

@ -30,13 +30,13 @@ import com.google.common.collect.ImmutableSet;
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
@Test(groups = "live", testName = "chef.CleanupStaleNodesAndClientsImplLiveTest") @Test(groups = { "live" })
public class CleanupStaleNodesAndClientsImplLiveTest extends BaseChefStrategyLiveTest { public class CleanupStaleNodesAndClientsImplLiveTest extends BaseChefStrategyLiveTest {
private CreateNodeAndPopulateAutomaticAttributesImpl creater; private CreateNodeAndPopulateAutomaticAttributesImpl creater;
private CleanupStaleNodesAndClientsImpl strategy; private CleanupStaleNodesAndClientsImpl strategy;
private ChefClient chef; private ChefClient chef;
@BeforeTest(groups = "live", dependsOnMethods = "setupClient") @BeforeTest(groups = { "live" }, dependsOnMethods = "setupClient")
void setupStrategy() { void setupStrategy() {
this.creater = injector.getInstance(CreateNodeAndPopulateAutomaticAttributesImpl.class); this.creater = injector.getInstance(CreateNodeAndPopulateAutomaticAttributesImpl.class);
this.strategy = injector.getInstance(CleanupStaleNodesAndClientsImpl.class); this.strategy = injector.getInstance(CleanupStaleNodesAndClientsImpl.class);

View File

@ -45,7 +45,7 @@ import com.google.inject.Module;
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
@Test(groups = "live", testName = "chef.CreateNodeAndPopulateAutomaticAttributesImplLiveTest") @Test(groups = { "live" })
public class CreateNodeAndPopulateAutomaticAttributesImplLiveTest extends BaseChefStrategyLiveTest { public class CreateNodeAndPopulateAutomaticAttributesImplLiveTest extends BaseChefStrategyLiveTest {
private CreateNodeAndPopulateAutomaticAttributesImpl strategy; private CreateNodeAndPopulateAutomaticAttributesImpl strategy;
@ -64,7 +64,7 @@ public class CreateNodeAndPopulateAutomaticAttributesImplLiveTest extends BaseCh
modules.add(new TestOhaiModule()); modules.add(new TestOhaiModule());
} }
@BeforeTest(groups = "live", dependsOnMethods = "setupClient") @BeforeTest(groups = { "live" }, dependsOnMethods = "setupClient")
void setupStrategy() { void setupStrategy() {
this.strategy = injector.getInstance(CreateNodeAndPopulateAutomaticAttributesImpl.class); this.strategy = injector.getInstance(CreateNodeAndPopulateAutomaticAttributesImpl.class);
this.chef = injector.getInstance(ChefClient.class); this.chef = injector.getInstance(ChefClient.class);

View File

@ -40,7 +40,7 @@ import com.google.common.collect.ImmutableSet;
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
@Test(groups = "unit", testName = "ohai.CreateNodeAndPopulateAutomaticAttributesImplTest") @Test(groups = { "unit" })
public class CreateNodeAndPopulateAutomaticAttributesImplTest { public class CreateNodeAndPopulateAutomaticAttributesImplTest {
@Test @Test

View File

@ -30,13 +30,13 @@ import com.google.common.collect.ImmutableSet;
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
@Test(groups = "live", testName = "chef.DeleteAllClientsAndNodesInListImplTest") @Test(groups = { "live" })
public class DeleteAllClientsAndNodesInListImplLiveTest extends BaseChefStrategyLiveTest { public class DeleteAllClientsAndNodesInListImplLiveTest extends BaseChefStrategyLiveTest {
private DeleteAllNodesInListImpl strategy; private DeleteAllNodesInListImpl strategy;
private CreateNodeAndPopulateAutomaticAttributesImpl creater; private CreateNodeAndPopulateAutomaticAttributesImpl creater;
private ChefClient chef; private ChefClient chef;
@BeforeTest(groups = "live", dependsOnMethods = "setupClient") @BeforeTest(groups = { "live" }, dependsOnMethods = "setupClient")
void setupStrategy() { void setupStrategy() {
this.creater = injector.getInstance(CreateNodeAndPopulateAutomaticAttributesImpl.class); this.creater = injector.getInstance(CreateNodeAndPopulateAutomaticAttributesImpl.class);
this.strategy = injector.getInstance(DeleteAllNodesInListImpl.class); this.strategy = injector.getInstance(DeleteAllNodesInListImpl.class);

View File

@ -37,20 +37,20 @@ import com.google.common.collect.ImmutableSet;
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
@Test(groups = "live", testName = "chef.GetNodesImplLiveTest") @Test(groups = { "live" })
public class GetNodesImplLiveTest extends BaseChefStrategyLiveTest { public class GetNodesImplLiveTest extends BaseChefStrategyLiveTest {
private ListNodesImpl strategy; private ListNodesImpl strategy;
private CreateNodeAndPopulateAutomaticAttributesImpl creater; private CreateNodeAndPopulateAutomaticAttributesImpl creater;
private ChefClient chef; private ChefClient chef;
@BeforeTest(groups = "live", dependsOnMethods = "setupClient") @BeforeTest(groups = { "live" }, dependsOnMethods = "setupClient")
void setupStrategy() { void setupStrategy() {
this.creater = injector.getInstance(CreateNodeAndPopulateAutomaticAttributesImpl.class); this.creater = injector.getInstance(CreateNodeAndPopulateAutomaticAttributesImpl.class);
this.strategy = injector.getInstance(ListNodesImpl.class); this.strategy = injector.getInstance(ListNodesImpl.class);
this.chef = injector.getInstance(ChefClient.class); this.chef = injector.getInstance(ChefClient.class);
} }
@BeforeTest(groups = "live", dependsOnMethods = "setupStrategy") @BeforeTest(groups = { "live" }, dependsOnMethods = "setupStrategy")
void setupNodes() { void setupNodes() {
creater.execute(prefix, ImmutableSet.<String> of()); creater.execute(prefix, ImmutableSet.<String> of());
creater.execute(prefix + 1, ImmutableSet.<String> of()); creater.execute(prefix + 1, ImmutableSet.<String> of());

View File

@ -44,7 +44,7 @@ import com.google.inject.Module;
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
@Test(groups = "live", testName = "chef.UpdateAutomaticAttributesOnNodeImplLiveTest") @Test(groups = { "live" })
public class UpdateAutomaticAttributesOnNodeImplLiveTest extends BaseChefStrategyLiveTest { public class UpdateAutomaticAttributesOnNodeImplLiveTest extends BaseChefStrategyLiveTest {
private UpdateAutomaticAttributesOnNodeImpl strategy; private UpdateAutomaticAttributesOnNodeImpl strategy;
private ChefClient chef; private ChefClient chef;
@ -61,7 +61,7 @@ public class UpdateAutomaticAttributesOnNodeImplLiveTest extends BaseChefStrateg
modules.add(new TestOhaiModule()); modules.add(new TestOhaiModule());
} }
@BeforeTest(groups = "live", dependsOnMethods = "setupClient") @BeforeTest(groups = { "live" }, dependsOnMethods = "setupClient")
void setupStrategy() { void setupStrategy() {
this.strategy = injector.getInstance(UpdateAutomaticAttributesOnNodeImpl.class); this.strategy = injector.getInstance(UpdateAutomaticAttributesOnNodeImpl.class);
this.chef = injector.getInstance(ChefClient.class); this.chef = injector.getInstance(ChefClient.class);

View File

@ -41,7 +41,7 @@ import com.google.common.collect.ImmutableSet;
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
@Test(groups = "unit", testName = "ohai.UpdateAutomaticAttributesOnNodeImplTest") @Test(groups = { "unit" })
public class UpdateAutomaticAttributesOnNodeImplTest { public class UpdateAutomaticAttributesOnNodeImplTest {
@Test @Test

View File

@ -45,7 +45,7 @@ import com.google.inject.Guice;
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
@Test(groups = "integration", testName = "chef.TransientChefClientIntegrationTest") @Test(groups = { "integration" })
public class TransientChefClientIntegrationTest extends BaseChefClientLiveTest { public class TransientChefClientIntegrationTest extends BaseChefClientLiveTest {
public void testCreateDatabag1() throws Exception { public void testCreateDatabag1() throws Exception {
getAdminConnection().deleteDatabag(PREFIX); getAdminConnection().deleteDatabag(PREFIX);

View File

@ -34,7 +34,7 @@ import com.google.common.collect.ImmutableList;
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
@Test(groups = "unit", sequential = true, testName = "ohai.ChefUtilsTest") @Test(groups = { "unit" }, sequential = true)
public class ChefUtilsTest { public class ChefUtilsTest {
public static long millis = 1280251180727l; public static long millis = 1280251180727l;
public static String millisString = "1280251180727"; public static String millisString = "1280251180727";

View File

@ -46,7 +46,7 @@ import com.google.inject.Injector;
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
@Test(groups = "unit", testName = "ohai.JMXTest") @Test(groups = { "unit" })
public class JMXTest { public class JMXTest {
@Test @Test

View File

@ -49,7 +49,7 @@ import com.google.inject.util.Providers;
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
@Test(groups = "unit", testName = "ohai.OhaiModuleTest") @Test(groups = { "unit" })
public class OhaiModuleTest { public class OhaiModuleTest {
@Test @Test

View File

@ -35,7 +35,7 @@ import com.google.inject.Injector;
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
@Test(groups = "unit", sequential = true, testName = "ohai.ByteArrayToMacAddressTest") @Test(groups = { "unit" }, sequential = true)
public class ByteArrayToMacAddressTest { public class ByteArrayToMacAddressTest {
private ByteArrayToMacAddress converter; private ByteArrayToMacAddress converter;

View File

@ -41,7 +41,7 @@ import com.google.inject.Injector;
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
@Test(groups = "unit", sequential = true, testName = "ohai.NestSlashKeysTest") @Test(groups = { "unit" }, sequential = true)
public class NestSlashKeysTest { public class NestSlashKeysTest {
private NestSlashKeys converter; private NestSlashKeys converter;