Changeset 47 for trunk/src/test/java/omq/test/exception
- Timestamp:
- 06/18/13 16:51:22 (11 years ago)
- Location:
- trunk/src/test/java/omq/test/exception
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/test/java/omq/test/exception/ClientTest.java
r46 r47 4 4 5 5 import java.lang.reflect.UndeclaredThrowableException; 6 import java.util.Arrays; 7 import java.util.Collection; 6 8 import java.util.Properties; 7 9 … … 10 12 import omq.common.util.Serializer; 11 13 12 import org.junit. BeforeClass;14 import org.junit.After; 13 15 import org.junit.Test; 16 import org.junit.runner.RunWith; 17 import org.junit.runners.Parameterized; 18 import org.junit.runners.Parameterized.Parameters; 14 19 20 @RunWith(value = Parameterized.class) 15 21 public class ClientTest { 16 private staticClientInterface client;22 private ClientInterface client; 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.kryo);33 env.setProperty(ParameterQueue.SERIALIZER_NAME, type); 29 34 env.setProperty(ParameterQueue.ENABLECOMPRESSION, "false"); 30 35 … … 39 44 Broker.initBroker(env); 40 45 client = (ClientInterface) Broker.lookup("server", ClientInterface.class); 46 } 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(); 41 57 } 42 58 -
trunk/src/test/java/omq/test/exception/ServerTest.java
r46 r47 5 5 import omq.common.broker.Broker; 6 6 import omq.common.util.ParameterQueue; 7 import omq.common.util.Serializer; 7 8 import org.junit.Test; 8 9 9 10 public class ServerTest { 10 11 11 public static void main(String[] args) throws Exception { 12 @Test 13 public void test() throws Exception { 12 14 Properties env = new Properties(); 13 15 env.setProperty(ParameterQueue.USER_NAME, "guest"); … … 18 20 env.setProperty(ParameterQueue.SERVER_PORT, "5672"); 19 21 env.setProperty(ParameterQueue.DURABLE_QUEUES, "false"); 20 env.setProperty(ParameterQueue.SERIALIZER_NAME, Serializer.kryo);21 22 env.setProperty(ParameterQueue.ENABLECOMPRESSION, "false"); 22 23 … … 29 30 Broker.initBroker(env); 30 31 Broker.bind("server", server); 32 33 Thread.sleep(60 * 60 * 1000); 31 34 } 32 35 }
Note: See TracChangeset
for help on using the changeset viewer.