source: trunk/src/test/java/omq/test/stopBroker/UnbindTest.java @ 46

Last change on this file since 46 was 46, checked in by stoda, 11 years ago

Refactoring tests
TODO: every test should work with every serializer

File size: 1.2 KB
Line 
1package omq.test.stopBroker;
2
3import java.util.Properties;
4
5import omq.common.broker.Broker;
6import omq.common.util.ParameterQueue;
7import omq.common.util.Serializer;
8import omq.test.calculator.CalculatorImpl;
9
10public class UnbindTest {
11        private static CalculatorImpl calc;
12
13        /**
14         * @param args
15         */
16        public static void main(String[] args) throws Exception {
17                Properties env = new Properties();
18                env.setProperty(ParameterQueue.USER_NAME, "guest");
19                env.setProperty(ParameterQueue.USER_PASS, "guest");
20
21                // Get host info of rabbimq (where it is)
22                env.setProperty(ParameterQueue.SERVER_HOST, "127.0.0.1");
23                env.setProperty(ParameterQueue.SERVER_PORT, "5672");
24                env.setProperty(ParameterQueue.DURABLE_QUEUES, "false");
25                env.setProperty(ParameterQueue.SERIALIZER_NAME, Serializer.java);
26                env.setProperty(ParameterQueue.ENABLECOMPRESSION, "false");
27
28                // Set info about where the message will be sent
29                env.setProperty(ParameterQueue.RPC_EXCHANGE, "rpc_exchange");
30                env.setProperty(ParameterQueue.RETRY_TIME_CONNECTION, "2000");
31
32                String reference = "calculator1";
33                calc = new CalculatorImpl();
34
35                Broker.initBroker(env);
36                Broker.bind(reference, calc);
37
38                Broker.unbind(reference);
39
40                Broker.closeConnection();
41        }
42
43}
Note: See TracBrowser for help on using the repository browser.