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

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

J

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
11/**
12 *
13 * @author Sergi Toda <sergi.toda@estudiants.urv.cat>
14 *
15 */
16public class UnbindTest {
17
18        @Test
19        public void serverTest() throws Exception {
20                Properties env = new Properties();
21                env.setProperty(ParameterQueue.USER_NAME, "guest");
22                env.setProperty(ParameterQueue.USER_PASS, "guest");
23
24                // Get host info of rabbimq (where it is)
25                env.setProperty(ParameterQueue.RABBIT_HOST, "127.0.0.1");
26                env.setProperty(ParameterQueue.RABBIT_PORT, "5672");
27                env.setProperty(ParameterQueue.DURABLE_QUEUES, "false");
28                env.setProperty(ParameterQueue.ENABLE_COMPRESSION, "false");
29
30                // Set info about where the message will be sent
31                env.setProperty(ParameterQueue.RPC_EXCHANGE, "rpc_exchange");
32                env.setProperty(ParameterQueue.RETRY_TIME_CONNECTION, "2000");
33
34                String reference = "calculator1";
35                CalculatorImpl calc = new CalculatorImpl();
36
37                Broker broker = new Broker(env);
38                broker.bind(reference, calc);
39
40                broker.unbind(reference);
41
42                broker.closeConnection();
43        }
44
45}
Note: See TracBrowser for help on using the repository browser.