Changeset 48
- Timestamp:
- 06/19/13 11:14:58 (11 years ago)
- Location:
- trunk/src/test/java/omq/test
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/test/java/omq/test/calculator/ServerTest.java
r47 r48 3 3 import java.util.Properties; 4 4 5 import org.junit.Test;6 7 5 import omq.common.broker.Broker; 8 6 import omq.common.util.ParameterQueue; 9 import omq.common.util.Serializer; 7 8 import org.junit.Test; 10 9 11 10 public class ServerTest { … … 23 22 env.setProperty(ParameterQueue.SERVER_HOST, "127.0.0.1"); 24 23 env.setProperty(ParameterQueue.SERVER_PORT, "5672"); 25 env.setProperty(ParameterQueue.DURABLE_QUEUES, "true"); 26 env.setProperty(ParameterQueue.SERIALIZER_NAME, Serializer.java); 24 env.setProperty(ParameterQueue.DURABLE_QUEUES, "false"); 27 25 env.setProperty(ParameterQueue.ENABLECOMPRESSION, "false"); 28 26 -
trunk/src/test/java/omq/test/faultTolerance/ServerTest.java
r47 r48 3 3 import java.util.Properties; 4 4 5 import org.junit.Test;6 7 5 import omq.common.broker.Broker; 8 6 import omq.common.util.ParameterQueue; 9 import omq.common.util.Serializer;10 7 import omq.test.calculator.CalculatorImpl; 8 9 import org.junit.Test; 11 10 12 11 public class ServerTest { … … 23 22 env.setProperty(ParameterQueue.SERVER_PORT, "5672"); 24 23 env.setProperty(ParameterQueue.DURABLE_QUEUES, "false"); 25 env.setProperty(ParameterQueue.SERIALIZER_NAME, Serializer.java);26 24 env.setProperty(ParameterQueue.ENABLECOMPRESSION, "false"); 27 25 -
trunk/src/test/java/omq/test/multiProcess/ClientTest.java
r46 r48 3 3 import static org.junit.Assert.assertEquals; 4 4 5 import java.util.Arrays; 6 import java.util.Collection; 5 7 import java.util.Properties; 6 8 … … 9 11 import omq.common.util.Serializer; 10 12 11 import org.junit. BeforeClass;13 import org.junit.After; 12 14 import org.junit.Test; 15 import org.junit.runner.RunWith; 16 import org.junit.runners.Parameterized; 17 import org.junit.runners.Parameterized.Parameters; 13 18 19 @RunWith(value = Parameterized.class) 14 20 public class ClientTest { 15 21 // Execute ServerTest.java 2 times before start this test 16 public staticNumber remoteNumber;22 public Number remoteNumber; 17 23 18 @BeforeClass 19 public static void startClient() throws Exception { 24 public ClientTest(String type) throws Exception { 20 25 Properties env = new Properties(); 21 26 env.setProperty(ParameterQueue.USER_NAME, "guest"); … … 26 31 env.setProperty(ParameterQueue.SERVER_PORT, "5672"); 27 32 env.setProperty(ParameterQueue.DURABLE_QUEUES, "false"); 28 env.setProperty(ParameterQueue.SERIALIZER_NAME, Serializer.java);33 env.setProperty(ParameterQueue.SERIALIZER_NAME, type); 29 34 env.setProperty(ParameterQueue.ENABLECOMPRESSION, "false"); 30 35 … … 41 46 } 42 47 48 @Parameters 49 public static Collection<Object[]> data() { 50 Object[][] data = new Object[][] { { Serializer.java }, { Serializer.gson }, { Serializer.kryo } }; 51 return Arrays.asList(data); 52 } 53 54 @After 55 public void stop() throws Exception { 56 Broker.stopBroker(); 57 } 58 43 59 @Test 44 60 public void test() { … … 46 62 remoteNumber.setNumber(x); 47 63 int a = remoteNumber.getNumer(); 48 assertEquals( a, 0);64 assertEquals(0, a); 49 65 int b = remoteNumber.getNumer(); 50 66 assertEquals(x, b); 67 remoteNumber.setNumber(0); 51 68 } 52 69 -
trunk/src/test/java/omq/test/multiProcess/ServerTest.java
r46 r48 3 3 import java.util.Properties; 4 4 5 import org.junit.Test; 6 5 7 import omq.common.broker.Broker; 6 8 import omq.common.util.ParameterQueue; 7 import omq.common.util.Serializer;8 9 9 10 public class ServerTest { 10 public static void main(String[] args) throws Exception { 11 @Test 12 public void test() throws Exception { 11 13 Properties env = new Properties(); 12 14 env.setProperty(ParameterQueue.USER_NAME, "guest"); … … 17 19 env.setProperty(ParameterQueue.SERVER_PORT, "5672"); 18 20 env.setProperty(ParameterQueue.DURABLE_QUEUES, "false"); 19 env.setProperty(ParameterQueue.SERIALIZER_NAME, Serializer.java);20 21 env.setProperty(ParameterQueue.ENABLECOMPRESSION, "false"); 21 22 … … 26 27 Broker.initBroker(env); 27 28 Broker.bind("number", new NumberImpl()); 29 30 Thread.sleep(60 * 1000); 28 31 } 29 32 } -
trunk/src/test/java/omq/test/stopBroker/ServerTest.java
r46 r48 2 2 3 3 import java.util.Properties; 4 5 import org.junit.Test; 4 6 5 7 import omq.common.broker.Broker; … … 9 11 public class ServerTest { 10 12 11 /** 12 * @param args 13 */ 14 public static void main(String[] args) throws Exception { 13 @Test 14 public void test() throws Exception { 15 15 Properties env = new Properties(); 16 16 env.setProperty(ParameterQueue.USER_NAME, "guest");
Note: See TracChangeset
for help on using the changeset viewer.