Changeset 48 for trunk/src/test/java/omq/test/multiProcess/ClientTest.java
- Timestamp:
- 06/19/13 11:14:58 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.