You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whirr.apache.org by as...@apache.org on 2012/02/07 22:22:51 UTC
svn commit: r1241633 - in /whirr/trunk: ./
core/src/test/java/org/apache/whirr/
core/src/test/java/org/apache/whirr/actions/integration/
core/src/test/java/org/apache/whirr/service/jclouds/integration/
core/src/test/java/org/apache/whirr/state/integrat...
Author: asavu
Date: Tue Feb 7 21:22:45 2012
New Revision: 1241633
URL: http://svn.apache.org/viewvc?rev=1241633&view=rev
Log:
WHIRR-422. Integration tests should fail or succeed in a limited amount of time (asavu)
Added:
whirr/trunk/core/src/test/java/org/apache/whirr/TestConstants.java
Modified:
whirr/trunk/CHANGES.txt
whirr/trunk/core/src/test/java/org/apache/whirr/actions/integration/PhaseExecutionBarrierTest.java
whirr/trunk/core/src/test/java/org/apache/whirr/service/jclouds/integration/FirewallManagerTest.java
whirr/trunk/core/src/test/java/org/apache/whirr/state/integration/BlobClusterStateStoreTest.java
whirr/trunk/services/cassandra/src/test/java/org/apache/whirr/service/cassandra/integration/CassandraServiceTest.java
whirr/trunk/services/cdh/src/test/java/org/apache/whirr/service/cdh/integration/CdhHBaseServiceTest.java
whirr/trunk/services/cdh/src/test/java/org/apache/whirr/service/cdh/integration/CdhHadoopServiceTest.java
whirr/trunk/services/cdh/src/test/java/org/apache/whirr/service/cdh/integration/CdhZooKeeperServiceTest.java
whirr/trunk/services/chef/src/test/java/org/apache/whirr/service/chef/integration/ChefServiceTest.java
whirr/trunk/services/elasticsearch/src/test/java/org/apache/whirr/service/elasticsearch/integration/ElasticSearchTest.java
whirr/trunk/services/ganglia/src/test/java/org/apache/whirr/service/ganglia/integration/GangliaServiceTest.java
whirr/trunk/services/hadoop/src/test/java/org/apache/whirr/service/hadoop/integration/AbstractHadoopServiceTest.java
whirr/trunk/services/hama/src/test/java/org/apache/whirr/service/hama/integration/HamaServiceTest.java
whirr/trunk/services/hbase/src/test/java/org/apache/whirr/service/hbase/integration/HBaseServiceTest.java
whirr/trunk/services/mahout/pom.xml
whirr/trunk/services/mahout/src/test/java/org/apache/whirr/service/mahout/integration/MahoutServiceTest.java
whirr/trunk/services/puppet/src/test/java/org/apache/whirr/service/puppet/integration/PuppetServiceTest.java
whirr/trunk/services/voldemort/src/test/java/org/apache/whirr/service/voldemort/integration/VoldemortServiceTest.java
whirr/trunk/services/zookeeper/src/test/java/org/apache/whirr/service/zookeeper/integration/ZooKeeperServiceTest.java
Modified: whirr/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/whirr/trunk/CHANGES.txt?rev=1241633&r1=1241632&r2=1241633&view=diff
==============================================================================
--- whirr/trunk/CHANGES.txt (original)
+++ whirr/trunk/CHANGES.txt Tue Feb 7 21:22:45 2012
@@ -50,6 +50,9 @@ Trunk (unreleased changes)
WHIRR-436. Allow Whirr to run from inside OSGi (Ioannis Canellos via asavu)
+ WHIRR-422. Integration tests should fail or succeed in a limited
+ amount of time (asavu)
+
BUG FIXES
WHIRR-367. Wrong groupId for zookeeper (Joe Crobak via asavu)
Added: whirr/trunk/core/src/test/java/org/apache/whirr/TestConstants.java
URL: http://svn.apache.org/viewvc/whirr/trunk/core/src/test/java/org/apache/whirr/TestConstants.java?rev=1241633&view=auto
==============================================================================
--- whirr/trunk/core/src/test/java/org/apache/whirr/TestConstants.java (added)
+++ whirr/trunk/core/src/test/java/org/apache/whirr/TestConstants.java Tue Feb 7 21:22:45 2012
@@ -0,0 +1,28 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.whirr;
+
+public class TestConstants {
+
+ /**
+ * Any integration test should timeout if it takes more
+ */
+ public static final int ITEST_TIMEOUT = 900000; // 15 minutes
+
+}
Modified: whirr/trunk/core/src/test/java/org/apache/whirr/actions/integration/PhaseExecutionBarrierTest.java
URL: http://svn.apache.org/viewvc/whirr/trunk/core/src/test/java/org/apache/whirr/actions/integration/PhaseExecutionBarrierTest.java?rev=1241633&r1=1241632&r2=1241633&view=diff
==============================================================================
--- whirr/trunk/core/src/test/java/org/apache/whirr/actions/integration/PhaseExecutionBarrierTest.java (original)
+++ whirr/trunk/core/src/test/java/org/apache/whirr/actions/integration/PhaseExecutionBarrierTest.java Tue Feb 7 21:22:45 2012
@@ -28,6 +28,7 @@ import org.apache.commons.ssl.asn1.Strin
import org.apache.whirr.ClusterController;
import org.apache.whirr.ClusterControllerFactory;
import org.apache.whirr.ClusterSpec;
+import org.apache.whirr.TestConstants;
import org.apache.whirr.service.ClusterActionEvent;
import org.apache.whirr.service.ClusterActionHandlerSupport;
import org.jclouds.compute.domain.ExecResponse;
@@ -128,7 +129,7 @@ public class PhaseExecutionBarrierTest {
return ClusterSpec.withTemporaryKeys(getTestConfiguration());
}
- @Test
+ @Test(timeout = TestConstants.ITEST_TIMEOUT)
public void testNoRemoteExecutionOverlap() throws Exception {
ClusterSpec spec = getTestClusterSpec();
ClusterController controller =
Modified: whirr/trunk/core/src/test/java/org/apache/whirr/service/jclouds/integration/FirewallManagerTest.java
URL: http://svn.apache.org/viewvc/whirr/trunk/core/src/test/java/org/apache/whirr/service/jclouds/integration/FirewallManagerTest.java?rev=1241633&r1=1241632&r2=1241633&view=diff
==============================================================================
--- whirr/trunk/core/src/test/java/org/apache/whirr/service/jclouds/integration/FirewallManagerTest.java (original)
+++ whirr/trunk/core/src/test/java/org/apache/whirr/service/jclouds/integration/FirewallManagerTest.java Tue Feb 7 21:22:45 2012
@@ -22,6 +22,7 @@ import com.google.common.collect.Sets;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.whirr.Cluster;
import org.apache.whirr.ClusterSpec;
+import org.apache.whirr.TestConstants;
import org.apache.whirr.service.ComputeCache;
import org.apache.whirr.service.FirewallManager;
import org.jclouds.compute.ComputeServiceContext;
@@ -68,7 +69,7 @@ public class FirewallManagerTest {
manager = new FirewallManager(context, clusterSpec, new Cluster(instances));
}
- @Test
+ @Test(timeout = TestConstants.ITEST_TIMEOUT)
public void testFirewallAuthorizationIsIdempotent() throws IOException {
if (context.getProviderSpecificContext().getApi() instanceof EC2Client) {
EC2Client ec2Client = EC2Client.class.cast(
Modified: whirr/trunk/core/src/test/java/org/apache/whirr/state/integration/BlobClusterStateStoreTest.java
URL: http://svn.apache.org/viewvc/whirr/trunk/core/src/test/java/org/apache/whirr/state/integration/BlobClusterStateStoreTest.java?rev=1241633&r1=1241632&r2=1241633&view=diff
==============================================================================
--- whirr/trunk/core/src/test/java/org/apache/whirr/state/integration/BlobClusterStateStoreTest.java (original)
+++ whirr/trunk/core/src/test/java/org/apache/whirr/state/integration/BlobClusterStateStoreTest.java Tue Feb 7 21:22:45 2012
@@ -26,6 +26,7 @@ import org.apache.commons.configuration.
import org.apache.commons.lang.RandomStringUtils;
import org.apache.whirr.Cluster;
import org.apache.whirr.ClusterSpec;
+import org.apache.whirr.TestConstants;
import org.apache.whirr.state.BlobClusterStateStore;
import org.apache.whirr.service.BlobStoreContextBuilder;
import org.jclouds.blobstore.BlobStoreContext;
@@ -55,7 +56,7 @@ public class BlobClusterStateStoreTest {
return ClusterSpec.withTemporaryKeys(getTestConfiguration());
}
- @Test
+ @Test(timeout = TestConstants.ITEST_TIMEOUT)
public void testStoreAndLoadState() throws Exception {
ClusterSpec spec = getTestClusterSpec();
@@ -91,7 +92,7 @@ public class BlobClusterStateStoreTest {
}
}
- @Test(expected = IllegalArgumentException.class)
+ @Test(expected = IllegalArgumentException.class, timeout = TestConstants.ITEST_TIMEOUT)
public void testInvalidContainerName() throws Exception {
ClusterSpec spec = getTestClusterSpec();
Modified: whirr/trunk/services/cassandra/src/test/java/org/apache/whirr/service/cassandra/integration/CassandraServiceTest.java
URL: http://svn.apache.org/viewvc/whirr/trunk/services/cassandra/src/test/java/org/apache/whirr/service/cassandra/integration/CassandraServiceTest.java?rev=1241633&r1=1241632&r2=1241633&view=diff
==============================================================================
--- whirr/trunk/services/cassandra/src/test/java/org/apache/whirr/service/cassandra/integration/CassandraServiceTest.java (original)
+++ whirr/trunk/services/cassandra/src/test/java/org/apache/whirr/service/cassandra/integration/CassandraServiceTest.java Tue Feb 7 21:22:45 2012
@@ -18,15 +18,7 @@
package org.apache.whirr.service.cassandra.integration;
-import static org.junit.Assert.assertTrue;
-
import com.google.common.collect.Sets;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
import org.apache.cassandra.thrift.Cassandra;
import org.apache.commons.configuration.CompositeConfiguration;
import org.apache.commons.configuration.PropertiesConfiguration;
@@ -39,6 +31,7 @@ import org.apache.whirr.Cluster;
import org.apache.whirr.Cluster.Instance;
import org.apache.whirr.ClusterController;
import org.apache.whirr.ClusterSpec;
+import org.apache.whirr.TestConstants;
import org.apache.whirr.service.cassandra.CassandraClusterActionHandler;
import org.junit.After;
import org.junit.Before;
@@ -46,6 +39,13 @@ import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import static org.junit.Assert.assertTrue;
+
public class CassandraServiceTest {
private static final Logger LOG = LoggerFactory.getLogger(CassandraServiceTest.class);
@@ -106,7 +106,7 @@ public class CassandraServiceTest {
}
}
- @Test
+ @Test(timeout = TestConstants.ITEST_TIMEOUT)
public void testInstances() throws Exception {
Set<String> endPoints = Sets.newLinkedHashSet();
for (Instance instance : cluster.getInstances()) {
Modified: whirr/trunk/services/cdh/src/test/java/org/apache/whirr/service/cdh/integration/CdhHBaseServiceTest.java
URL: http://svn.apache.org/viewvc/whirr/trunk/services/cdh/src/test/java/org/apache/whirr/service/cdh/integration/CdhHBaseServiceTest.java?rev=1241633&r1=1241632&r2=1241633&view=diff
==============================================================================
--- whirr/trunk/services/cdh/src/test/java/org/apache/whirr/service/cdh/integration/CdhHBaseServiceTest.java (original)
+++ whirr/trunk/services/cdh/src/test/java/org/apache/whirr/service/cdh/integration/CdhHBaseServiceTest.java Tue Feb 7 21:22:45 2012
@@ -18,25 +18,25 @@
package org.apache.whirr.service.cdh.integration;
-import static org.hamcrest.Matchers.is;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
-
import com.google.common.collect.Lists;
-
-import java.util.ArrayList;
-import java.util.List;
-
import org.apache.hadoop.hbase.thrift.generated.ColumnDescriptor;
import org.apache.hadoop.hbase.thrift.generated.Hbase;
import org.apache.hadoop.hbase.thrift.generated.Mutation;
import org.apache.hadoop.hbase.thrift.generated.TRowResult;
import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.whirr.TestConstants;
import org.apache.whirr.service.hbase.integration.HBaseServiceController;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.hamcrest.Matchers.is;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+
public class CdhHBaseServiceTest {
private static final byte[] FIRST = Bytes.toBytes("");
@@ -60,7 +60,7 @@ public class CdhHBaseServiceTest {
controller.shutdown();
}
- @Test
+ @Test(timeout = TestConstants.ITEST_TIMEOUT)
public void test() throws Exception {
ArrayList<ColumnDescriptor> columns = new ArrayList<ColumnDescriptor>();
ColumnDescriptor cd = new ColumnDescriptor();
Modified: whirr/trunk/services/cdh/src/test/java/org/apache/whirr/service/cdh/integration/CdhHadoopServiceTest.java
URL: http://svn.apache.org/viewvc/whirr/trunk/services/cdh/src/test/java/org/apache/whirr/service/cdh/integration/CdhHadoopServiceTest.java?rev=1241633&r1=1241632&r2=1241633&view=diff
==============================================================================
--- whirr/trunk/services/cdh/src/test/java/org/apache/whirr/service/cdh/integration/CdhHadoopServiceTest.java (original)
+++ whirr/trunk/services/cdh/src/test/java/org/apache/whirr/service/cdh/integration/CdhHadoopServiceTest.java Tue Feb 7 21:22:45 2012
@@ -18,19 +18,6 @@
package org.apache.whirr.service.cdh.integration;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNull;
-import static junit.framework.Assert.failNotEquals;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.util.Map;
-import java.util.Map.Entry;
-
import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
import org.apache.commons.configuration.CompositeConfiguration;
@@ -51,6 +38,7 @@ import org.apache.hadoop.mapred.lib.Toke
import org.apache.whirr.Cluster;
import org.apache.whirr.ClusterController;
import org.apache.whirr.ClusterSpec;
+import org.apache.whirr.TestConstants;
import org.apache.whirr.service.hadoop.HadoopProxy;
import org.jclouds.compute.domain.ExecResponse;
import org.jclouds.compute.domain.NodeMetadata;
@@ -62,6 +50,19 @@ import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertNull;
+import static junit.framework.Assert.failNotEquals;
+
public class CdhHadoopServiceTest {
private static final Logger LOG = LoggerFactory
@@ -101,7 +102,7 @@ public class CdhHadoopServiceTest {
controller.destroyCluster(clusterSpec);
}
- @Test
+ @Test(timeout = TestConstants.ITEST_TIMEOUT)
public void testVersion() throws Exception {
Statement checkVersion = Statements.exec("ls /etc/alternatives/hadoop-lib");
Map<? extends NodeMetadata, ExecResponse> responses =
@@ -111,7 +112,7 @@ public class CdhHadoopServiceTest {
assertResponsesContain(responses, checkVersion, "cdh3u2");
}
- @Test
+ @Test(timeout = TestConstants.ITEST_TIMEOUT)
public void testJobExecution() throws Exception {
Configuration conf = getConfiguration();
Modified: whirr/trunk/services/cdh/src/test/java/org/apache/whirr/service/cdh/integration/CdhZooKeeperServiceTest.java
URL: http://svn.apache.org/viewvc/whirr/trunk/services/cdh/src/test/java/org/apache/whirr/service/cdh/integration/CdhZooKeeperServiceTest.java?rev=1241633&r1=1241632&r2=1241633&view=diff
==============================================================================
--- whirr/trunk/services/cdh/src/test/java/org/apache/whirr/service/cdh/integration/CdhZooKeeperServiceTest.java (original)
+++ whirr/trunk/services/cdh/src/test/java/org/apache/whirr/service/cdh/integration/CdhZooKeeperServiceTest.java Tue Feb 7 21:22:45 2012
@@ -18,16 +18,12 @@
package org.apache.whirr.service.cdh.integration;
-import static junit.framework.Assert.assertEquals;
-
-import java.io.IOException;
-import java.util.concurrent.CountDownLatch;
-
import org.apache.commons.configuration.CompositeConfiguration;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.whirr.Cluster;
import org.apache.whirr.ClusterController;
import org.apache.whirr.ClusterSpec;
+import org.apache.whirr.TestConstants;
import org.apache.whirr.service.zookeeper.ZooKeeperCluster;
import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.WatchedEvent;
@@ -39,6 +35,11 @@ import org.junit.After;
import org.junit.Before;
import org.junit.Test;
+import java.io.IOException;
+import java.util.concurrent.CountDownLatch;
+
+import static junit.framework.Assert.assertEquals;
+
public class CdhZooKeeperServiceTest {
private ClusterSpec clusterSpec;
@@ -60,7 +61,7 @@ public class CdhZooKeeperServiceTest {
hosts = ZooKeeperCluster.getHosts(cluster);
}
- @Test
+ @Test (timeout = TestConstants.ITEST_TIMEOUT)
public void test() throws Exception {
class ConnectionWatcher implements Watcher {
Modified: whirr/trunk/services/chef/src/test/java/org/apache/whirr/service/chef/integration/ChefServiceTest.java
URL: http://svn.apache.org/viewvc/whirr/trunk/services/chef/src/test/java/org/apache/whirr/service/chef/integration/ChefServiceTest.java?rev=1241633&r1=1241632&r2=1241633&view=diff
==============================================================================
--- whirr/trunk/services/chef/src/test/java/org/apache/whirr/service/chef/integration/ChefServiceTest.java (original)
+++ whirr/trunk/services/chef/src/test/java/org/apache/whirr/service/chef/integration/ChefServiceTest.java Tue Feb 7 21:22:45 2012
@@ -18,14 +18,8 @@
package org.apache.whirr.service.chef.integration;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertTrue;
-import static junit.framework.Assert.failNotEquals;
-
-import java.io.IOException;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
+import com.google.common.base.Predicate;
+import com.google.common.base.Predicates;
import org.apache.commons.configuration.CompositeConfiguration;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.commons.httpclient.HttpClient;
@@ -33,6 +27,7 @@ import org.apache.commons.httpclient.Htt
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.whirr.ClusterController;
import org.apache.whirr.ClusterSpec;
+import org.apache.whirr.TestConstants;
import org.apache.whirr.service.chef.Recipe;
import org.jclouds.compute.RunScriptOnNodesException;
import org.jclouds.compute.domain.ExecResponse;
@@ -46,8 +41,13 @@ import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.google.common.base.Predicate;
-import com.google.common.base.Predicates;
+import java.io.IOException;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertTrue;
+import static junit.framework.Assert.failNotEquals;
/**
* Integration test for chef.
@@ -78,7 +78,7 @@ public class ChefServiceTest {
controller.launchCluster(clusterSpec);
}
- @Test
+ @Test(timeout = TestConstants.ITEST_TIMEOUT)
public void testRecipesWereRanInServiceBootstrap() throws Exception {
// and shoudl be installed by the main handlers
@@ -101,7 +101,7 @@ public class ChefServiceTest {
assertResponsesContain(responses, testMaven, "Apache Maven");
}
- @Test
+ @Test(timeout = TestConstants.ITEST_TIMEOUT)
public void testChefRunRecipeFromURL() throws Exception {
// As chef will be mostly used indirectly in other services
// this test tests chef's ability to run a recipe, specifically to
@@ -148,7 +148,7 @@ public class ChefServiceTest {
*
* @throws Exception
*/
- @Test
+ @Test(timeout = TestConstants.ITEST_TIMEOUT)
public void testChefRunRecipesFromProvidedCookbooks() throws Exception {
Recipe java = new Recipe("java");
java.attribs.put("install_flavor", "sun");
Modified: whirr/trunk/services/elasticsearch/src/test/java/org/apache/whirr/service/elasticsearch/integration/ElasticSearchTest.java
URL: http://svn.apache.org/viewvc/whirr/trunk/services/elasticsearch/src/test/java/org/apache/whirr/service/elasticsearch/integration/ElasticSearchTest.java?rev=1241633&r1=1241632&r2=1241633&view=diff
==============================================================================
--- whirr/trunk/services/elasticsearch/src/test/java/org/apache/whirr/service/elasticsearch/integration/ElasticSearchTest.java (original)
+++ whirr/trunk/services/elasticsearch/src/test/java/org/apache/whirr/service/elasticsearch/integration/ElasticSearchTest.java Tue Feb 7 21:22:45 2012
@@ -17,22 +17,13 @@
*/
package org.apache.whirr.service.elasticsearch.integration;
-import static org.apache.whirr.RolePredicates.role;
-
import com.google.common.collect.Iterables;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
import org.apache.commons.configuration.CompositeConfiguration;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.whirr.Cluster;
import org.apache.whirr.ClusterController;
import org.apache.whirr.ClusterSpec;
+import org.apache.whirr.TestConstants;
import org.apache.whirr.service.elasticsearch.ElasticSearchHandler;
import org.junit.After;
import org.junit.Before;
@@ -40,6 +31,15 @@ import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import static org.apache.whirr.RolePredicates.role;
+
public class ElasticSearchTest {
private static final Logger LOG =
@@ -61,7 +61,7 @@ public class ElasticSearchTest {
cluster = controller.launchCluster(clusterSpec);
}
- @Test
+ @Test(timeout = TestConstants.ITEST_TIMEOUT)
public void testCheckNumberOfNodes() throws Exception {
for(int i = 0; i<20; i++) {
int nodes = getNumberOfNodes();
Modified: whirr/trunk/services/ganglia/src/test/java/org/apache/whirr/service/ganglia/integration/GangliaServiceTest.java
URL: http://svn.apache.org/viewvc/whirr/trunk/services/ganglia/src/test/java/org/apache/whirr/service/ganglia/integration/GangliaServiceTest.java?rev=1241633&r1=1241632&r2=1241633&view=diff
==============================================================================
--- whirr/trunk/services/ganglia/src/test/java/org/apache/whirr/service/ganglia/integration/GangliaServiceTest.java (original)
+++ whirr/trunk/services/ganglia/src/test/java/org/apache/whirr/service/ganglia/integration/GangliaServiceTest.java Tue Feb 7 21:22:45 2012
@@ -18,15 +18,8 @@
package org.apache.whirr.service.ganglia.integration;
-import static org.apache.whirr.RolePredicates.anyRoleIn;
-import static org.apache.whirr.service.ganglia.GangliaMetadClusterActionHandler.GANGLIA_METAD_ROLE;
-import static org.apache.whirr.service.ganglia.GangliaMonitorClusterActionHandler.GANGLIA_MONITOR_ROLE;
-
-import java.io.IOException;
-import java.net.Socket;
-
+import com.google.common.collect.Sets;
import junit.framework.TestCase;
-
import org.apache.commons.configuration.CompositeConfiguration;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.commons.httpclient.HttpClient;
@@ -39,13 +32,19 @@ import org.apache.whirr.ClusterControlle
import org.apache.whirr.ClusterControllerFactory;
import org.apache.whirr.ClusterSpec;
import org.apache.whirr.RolePredicates;
+import org.apache.whirr.TestConstants;
import org.apache.whirr.service.ganglia.GangliaMetadClusterActionHandler;
import org.apache.whirr.service.ganglia.GangliaMonitorClusterActionHandler;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import com.google.common.collect.Sets;
+import java.io.IOException;
+import java.net.Socket;
+
+import static org.apache.whirr.RolePredicates.anyRoleIn;
+import static org.apache.whirr.service.ganglia.GangliaMetadClusterActionHandler.GANGLIA_METAD_ROLE;
+import static org.apache.whirr.service.ganglia.GangliaMonitorClusterActionHandler.GANGLIA_MONITOR_ROLE;
public class GangliaServiceTest extends TestCase {
@@ -66,7 +65,7 @@ public class GangliaServiceTest extends
cluster = controller.launchCluster(clusterSpec);
}
- @Test
+ @Test(timeout = TestConstants.ITEST_TIMEOUT)
public void test() throws Exception {
Instance metad = cluster.getInstanceMatching(RolePredicates.role(GangliaMetadClusterActionHandler.GANGLIA_METAD_ROLE));
String metadHostname = metad.getPublicHostName();
Modified: whirr/trunk/services/hadoop/src/test/java/org/apache/whirr/service/hadoop/integration/AbstractHadoopServiceTest.java
URL: http://svn.apache.org/viewvc/whirr/trunk/services/hadoop/src/test/java/org/apache/whirr/service/hadoop/integration/AbstractHadoopServiceTest.java?rev=1241633&r1=1241632&r2=1241633&view=diff
==============================================================================
--- whirr/trunk/services/hadoop/src/test/java/org/apache/whirr/service/hadoop/integration/AbstractHadoopServiceTest.java (original)
+++ whirr/trunk/services/hadoop/src/test/java/org/apache/whirr/service/hadoop/integration/AbstractHadoopServiceTest.java Tue Feb 7 21:22:45 2012
@@ -18,17 +18,6 @@
package org.apache.whirr.service.hadoop.integration;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNull;
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
-
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSDataInputStream;
import org.apache.hadoop.fs.FileSystem;
@@ -41,9 +30,21 @@ import org.apache.hadoop.mapred.JobClien
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.lib.LongSumReducer;
import org.apache.hadoop.mapred.lib.TokenCountMapper;
+import org.apache.whirr.TestConstants;
import org.junit.AfterClass;
import org.junit.Test;
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertNull;
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
/**
* Subclasses should implement @BeforeClass static void setUp()
* to set the controller.
@@ -61,7 +62,7 @@ public abstract class AbstractHadoopServ
super();
}
- @Test
+ @Test(timeout = TestConstants.ITEST_TIMEOUT)
public void test() throws Exception {
Configuration conf = controller.getConfiguration();
JobConf job = new JobConf(conf, HadoopServiceTest.class);
@@ -91,7 +92,7 @@ public abstract class AbstractHadoopServ
}
- @Test
+ @Test(timeout = TestConstants.ITEST_TIMEOUT)
public void testExistsTemporaryFolderAndHiveWarehouse() throws Exception {
Configuration conf = controller.getConfiguration();
FileSystem fs = FileSystem.get(conf);
Modified: whirr/trunk/services/hama/src/test/java/org/apache/whirr/service/hama/integration/HamaServiceTest.java
URL: http://svn.apache.org/viewvc/whirr/trunk/services/hama/src/test/java/org/apache/whirr/service/hama/integration/HamaServiceTest.java?rev=1241633&r1=1241632&r2=1241633&view=diff
==============================================================================
--- whirr/trunk/services/hama/src/test/java/org/apache/whirr/service/hama/integration/HamaServiceTest.java (original)
+++ whirr/trunk/services/hama/src/test/java/org/apache/whirr/service/hama/integration/HamaServiceTest.java Tue Feb 7 21:22:45 2012
@@ -17,20 +17,21 @@
*/
package org.apache.whirr.service.hama.integration;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
import org.apache.hama.HamaConfiguration;
import org.apache.hama.bsp.BSPJob;
import org.apache.hama.bsp.BSPJobClient;
import org.apache.hama.bsp.ClusterStatus;
import org.apache.hama.examples.PiEstimator;
import org.apache.hama.examples.PiEstimator.MyEstimator;
+import org.apache.whirr.TestConstants;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
public class HamaServiceTest {
private static HamaServiceController controller = HamaServiceController
.getInstance();
@@ -46,7 +47,7 @@ public class HamaServiceTest {
controller.shutdown();
}
- @Test
+ @Test(timeout = TestConstants.ITEST_TIMEOUT)
public void test() throws Exception {
HamaConfiguration conf = controller.getConfiguration();
Modified: whirr/trunk/services/hbase/src/test/java/org/apache/whirr/service/hbase/integration/HBaseServiceTest.java
URL: http://svn.apache.org/viewvc/whirr/trunk/services/hbase/src/test/java/org/apache/whirr/service/hbase/integration/HBaseServiceTest.java?rev=1241633&r1=1241632&r2=1241633&view=diff
==============================================================================
--- whirr/trunk/services/hbase/src/test/java/org/apache/whirr/service/hbase/integration/HBaseServiceTest.java (original)
+++ whirr/trunk/services/hbase/src/test/java/org/apache/whirr/service/hbase/integration/HBaseServiceTest.java Tue Feb 7 21:22:45 2012
@@ -18,23 +18,23 @@
package org.apache.whirr.service.hbase.integration;
-import static org.hamcrest.Matchers.is;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
-
import com.google.common.collect.Lists;
-
-import java.util.ArrayList;
-import java.util.List;
-
import org.apache.hadoop.hbase.thrift.generated.ColumnDescriptor;
import org.apache.hadoop.hbase.thrift.generated.Hbase;
import org.apache.hadoop.hbase.thrift.generated.Mutation;
import org.apache.hadoop.hbase.thrift.generated.TRowResult;
import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.whirr.TestConstants;
import org.junit.AfterClass;
import org.junit.Test;
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.hamcrest.Matchers.is;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+
public abstract class HBaseServiceTest {
private static final byte[] FIRST = Bytes.toBytes("");
@@ -52,7 +52,7 @@ public abstract class HBaseServiceTest {
controller.shutdown();
}
- @Test
+ @Test(timeout = TestConstants.ITEST_TIMEOUT)
public void test() throws Exception {
ArrayList<ColumnDescriptor> columns = new ArrayList<ColumnDescriptor>();
ColumnDescriptor cd = new ColumnDescriptor();
Modified: whirr/trunk/services/mahout/pom.xml
URL: http://svn.apache.org/viewvc/whirr/trunk/services/mahout/pom.xml?rev=1241633&r1=1241632&r2=1241633&view=diff
==============================================================================
--- whirr/trunk/services/mahout/pom.xml (original)
+++ whirr/trunk/services/mahout/pom.xml Tue Feb 7 21:22:45 2012
@@ -46,6 +46,13 @@
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
+ <artifactId>whirr-core</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
<artifactId>whirr-hadoop</artifactId>
<version>${project.version}</version>
</dependency>
Modified: whirr/trunk/services/mahout/src/test/java/org/apache/whirr/service/mahout/integration/MahoutServiceTest.java
URL: http://svn.apache.org/viewvc/whirr/trunk/services/mahout/src/test/java/org/apache/whirr/service/mahout/integration/MahoutServiceTest.java?rev=1241633&r1=1241632&r2=1241633&view=diff
==============================================================================
--- whirr/trunk/services/mahout/src/test/java/org/apache/whirr/service/mahout/integration/MahoutServiceTest.java (original)
+++ whirr/trunk/services/mahout/src/test/java/org/apache/whirr/service/mahout/integration/MahoutServiceTest.java Tue Feb 7 21:22:45 2012
@@ -23,6 +23,7 @@ import org.apache.commons.configuration.
import org.apache.whirr.Cluster;
import org.apache.whirr.ClusterController;
import org.apache.whirr.ClusterSpec;
+import org.apache.whirr.TestConstants;
import org.apache.whirr.state.ClusterStateStoreFactory;
import org.jclouds.compute.domain.ExecResponse;
import org.jclouds.compute.domain.NodeMetadata;
@@ -74,7 +75,7 @@ public class MahoutServiceTest {
}
}
- @Test
+ @Test(timeout = TestConstants.ITEST_TIMEOUT)
public void testBinMahout() throws Exception {
Statement binMahout = Statements.exec("source /etc/profile; $MAHOUT_HOME/bin/mahout");
Modified: whirr/trunk/services/puppet/src/test/java/org/apache/whirr/service/puppet/integration/PuppetServiceTest.java
URL: http://svn.apache.org/viewvc/whirr/trunk/services/puppet/src/test/java/org/apache/whirr/service/puppet/integration/PuppetServiceTest.java?rev=1241633&r1=1241632&r2=1241633&view=diff
==============================================================================
--- whirr/trunk/services/puppet/src/test/java/org/apache/whirr/service/puppet/integration/PuppetServiceTest.java (original)
+++ whirr/trunk/services/puppet/src/test/java/org/apache/whirr/service/puppet/integration/PuppetServiceTest.java Tue Feb 7 21:22:45 2012
@@ -17,16 +17,13 @@
*/
package org.apache.whirr.service.puppet.integration;
-import java.io.IOException;
-import java.net.URI;
-import java.util.concurrent.TimeUnit;
-
import org.apache.commons.configuration.CompositeConfiguration;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.whirr.Cluster;
+import org.apache.whirr.Cluster.Instance;
import org.apache.whirr.ClusterController;
import org.apache.whirr.ClusterSpec;
-import org.apache.whirr.Cluster.Instance;
+import org.apache.whirr.TestConstants;
import org.jclouds.net.IPSocket;
import org.jclouds.predicates.InetSocketAddressConnect;
import org.jclouds.predicates.RetryablePredicate;
@@ -35,6 +32,10 @@ import org.junit.After;
import org.junit.Before;
import org.junit.Test;
+import java.io.IOException;
+import java.net.URI;
+import java.util.concurrent.TimeUnit;
+
/**
* Install an http service on the remote machine with puppet!
*/
@@ -60,7 +61,7 @@ public class PuppetServiceTest {
}
- @Test
+ @Test(timeout = TestConstants.ITEST_TIMEOUT)
public void testHttpAvailable() throws Exception {
// check that the http server started
Modified: whirr/trunk/services/voldemort/src/test/java/org/apache/whirr/service/voldemort/integration/VoldemortServiceTest.java
URL: http://svn.apache.org/viewvc/whirr/trunk/services/voldemort/src/test/java/org/apache/whirr/service/voldemort/integration/VoldemortServiceTest.java?rev=1241633&r1=1241632&r2=1241633&view=diff
==============================================================================
--- whirr/trunk/services/voldemort/src/test/java/org/apache/whirr/service/voldemort/integration/VoldemortServiceTest.java (original)
+++ whirr/trunk/services/voldemort/src/test/java/org/apache/whirr/service/voldemort/integration/VoldemortServiceTest.java Tue Feb 7 21:22:45 2012
@@ -18,29 +18,29 @@
package org.apache.whirr.service.voldemort.integration;
-import static org.apache.whirr.service.voldemort.VoldemortConstants.ADMIN_PORT;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-
import org.apache.commons.configuration.CompositeConfiguration;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.whirr.Cluster;
import org.apache.whirr.Cluster.Instance;
import org.apache.whirr.ClusterController;
import org.apache.whirr.ClusterSpec;
+import org.apache.whirr.TestConstants;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
-
import voldemort.client.protocol.admin.AdminClient;
import voldemort.client.protocol.admin.AdminClientConfig;
import voldemort.cluster.Node;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+
+import static org.apache.whirr.service.voldemort.VoldemortConstants.ADMIN_PORT;
+
public class VoldemortServiceTest {
private ClusterSpec clusterSpec;
@@ -84,7 +84,7 @@ public class VoldemortServiceTest {
}
}
- @Test
+ @Test(timeout = TestConstants.ITEST_TIMEOUT)
public void testInstances() throws Exception {
Set<Instance> instances = cluster.getInstances();
String url = "tcp://" + instances.iterator().next().getPublicAddress().getHostAddress() + ":" + ADMIN_PORT;
Modified: whirr/trunk/services/zookeeper/src/test/java/org/apache/whirr/service/zookeeper/integration/ZooKeeperServiceTest.java
URL: http://svn.apache.org/viewvc/whirr/trunk/services/zookeeper/src/test/java/org/apache/whirr/service/zookeeper/integration/ZooKeeperServiceTest.java?rev=1241633&r1=1241632&r2=1241633&view=diff
==============================================================================
--- whirr/trunk/services/zookeeper/src/test/java/org/apache/whirr/service/zookeeper/integration/ZooKeeperServiceTest.java (original)
+++ whirr/trunk/services/zookeeper/src/test/java/org/apache/whirr/service/zookeeper/integration/ZooKeeperServiceTest.java Tue Feb 7 21:22:45 2012
@@ -18,17 +18,13 @@
package org.apache.whirr.service.zookeeper.integration;
-import static junit.framework.Assert.assertEquals;
-
-import java.io.IOException;
-import java.util.concurrent.CountDownLatch;
-
import org.apache.commons.configuration.CompositeConfiguration;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.whirr.Cluster;
import org.apache.whirr.ClusterController;
import org.apache.whirr.ClusterControllerFactory;
import org.apache.whirr.ClusterSpec;
+import org.apache.whirr.TestConstants;
import org.apache.whirr.service.zookeeper.ZooKeeperCluster;
import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.WatchedEvent;
@@ -40,6 +36,11 @@ import org.junit.After;
import org.junit.Before;
import org.junit.Test;
+import java.io.IOException;
+import java.util.concurrent.CountDownLatch;
+
+import static junit.framework.Assert.assertEquals;
+
public class ZooKeeperServiceTest {
private ClusterSpec clusterSpec;
@@ -61,7 +62,7 @@ public class ZooKeeperServiceTest {
hosts = ZooKeeperCluster.getHosts(cluster);
}
- @Test
+ @Test(timeout = TestConstants.ITEST_TIMEOUT)
public void test() throws Exception {
class ConnectionWatcher implements Watcher {