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

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

ParameterQueues? changed, added some properties to modify the queues

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