1 | package omq.test.exception; |
---|
2 | |
---|
3 | import java.util.Properties; |
---|
4 | |
---|
5 | import omq.common.broker.Broker; |
---|
6 | import omq.common.util.ParameterQueue; |
---|
7 | |
---|
8 | import org.junit.Test; |
---|
9 | |
---|
10 | public class ServerTest { |
---|
11 | |
---|
12 | @Test |
---|
13 | public void test() throws Exception { |
---|
14 | Properties env = new Properties(); |
---|
15 | env.setProperty(ParameterQueue.USER_NAME, "guest"); |
---|
16 | env.setProperty(ParameterQueue.USER_PASS, "guest"); |
---|
17 | |
---|
18 | // Get host info of rabbimq (where it is) |
---|
19 | env.setProperty(ParameterQueue.SERVER_HOST, "127.0.0.1"); |
---|
20 | env.setProperty(ParameterQueue.SERVER_PORT, "5672"); |
---|
21 | env.setProperty(ParameterQueue.DURABLE_QUEUES, "false"); |
---|
22 | env.setProperty(ParameterQueue.ENABLECOMPRESSION, "false"); |
---|
23 | |
---|
24 | // Set info about where the message will be sent |
---|
25 | env.setProperty(ParameterQueue.RPC_EXCHANGE, "rpc_exchange"); |
---|
26 | env.setProperty(ParameterQueue.RETRY_TIME_CONNECTION, "2000"); |
---|
27 | |
---|
28 | OmqServerImpl server = new OmqServerImpl(); |
---|
29 | |
---|
30 | Broker broker = new Broker(env); |
---|
31 | broker.bind("server", server); |
---|
32 | |
---|
33 | Thread.sleep(60 * 60 * 1000); |
---|
34 | } |
---|
35 | } |
---|
36 | ; |
---|