1 package org.apache.helix.integration;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.util.Date;
23
24 import org.apache.log4j.Logger;
25 import org.testng.annotations.Test;
26
27 public class TestHelixUsingDifferentParams extends ZkIntegrationTestBase
28 {
29 private static Logger LOG = Logger.getLogger(TestHelixUsingDifferentParams.class);
30
31 @Test()
32 public void testCMUsingDifferentParams() throws Exception
33 {
34 System.out.println("START " + getShortClassName() + " at "
35 + new Date(System.currentTimeMillis()));
36
37 int numResourceArray[] = new int[] { 1 };
38 int numPartitionsPerResourceArray[] = new int[] { 10 };
39
40 int numInstances[] = new int[] { 5 };
41 int replicas[] = new int[] { 2 };
42
43 for (int numResources : numResourceArray)
44 {
45 for (int numPartitionsPerResource : numPartitionsPerResourceArray)
46 {
47 for (int numInstance : numInstances)
48 {
49 for (int replica : replicas)
50 {
51 String uniqClusterName = "TestDiffParam_" + "rg" + numResources + "_p"
52 + numPartitionsPerResource + "_n" + numInstance + "_r" + replica;
53 System.out.println("START " + uniqClusterName + " at "
54 + new Date(System.currentTimeMillis()));
55
56 TestDriver.setupCluster(uniqClusterName, ZK_ADDR, numResources,
57 numPartitionsPerResource, numInstance, replica);
58
59 for (int i = 0; i < numInstance; i++)
60 {
61 TestDriver.startDummyParticipant(uniqClusterName, i);
62 }
63
64 TestDriver.startController(uniqClusterName);
65 TestDriver.verifyCluster(uniqClusterName, 1000, 50 * 1000);
66 TestDriver.stopCluster(uniqClusterName);
67
68 System.out.println("END " + uniqClusterName + " at "
69 + new Date(System.currentTimeMillis()));
70 }
71 }
72 }
73 }
74
75 System.out
76 .println("END " + getShortClassName() + " at " + new Date(System.currentTimeMillis()));
77 }
78 }