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
RevLine 
[46]1package omq.test.stopBroker;
[44]2
3import java.util.Properties;
4
5import omq.common.broker.Broker;
6import omq.common.util.ParameterQueue;
[46]7import omq.test.calculator.CalculatorImpl;
[44]8
[54]9import org.junit.Test;
10
[83]11/**
12 *
13 * @author Sergi Toda <sergi.toda@estudiants.urv.cat>
14 *
15 */
[44]16public class UnbindTest {
17
[54]18        @Test
19        public void serverTest() throws Exception {
[44]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)
[77]25                env.setProperty(ParameterQueue.RABBIT_HOST, "127.0.0.1");
26                env.setProperty(ParameterQueue.RABBIT_PORT, "5672");
[44]27                env.setProperty(ParameterQueue.DURABLE_QUEUES, "false");
[77]28                env.setProperty(ParameterQueue.ENABLE_COMPRESSION, "false");
[44]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";
[54]35                CalculatorImpl calc = new CalculatorImpl();
[44]36
[54]37                Broker broker = new Broker(env);
38                broker.bind(reference, calc);
[44]39
[54]40                broker.unbind(reference);
[44]41
[54]42                broker.closeConnection();
[44]43        }
44
45}
Note: See TracBrowser for help on using the repository browser.