KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > services > wsrp > testConsumer > TestProducerRegistry


1 /*
2 * Copyright 2001-2004 The eXo platform SARL All rights reserved.
3 * Please look at license.txt in info directory for more license detail.
4 */

5
6 package org.exoplatform.services.wsrp.testConsumer;
7
8 /*
9  * @author Mestrallet Benjamin
10  * benjmestrallet@users.sourceforge.net
11  * Date: 2 févr. 2004
12  * Time: 17:08:46
13  */

14
15 public class TestProducerRegistry extends BaseTest{
16
17   public void testAddProducer(){
18     producerRegistry.addProducer(producer);
19     assertTrue(producerRegistry.existsProducer(producer.getID()));
20     assertEquals(producer, producerRegistry.getAllProducers().next());
21   }
22
23   public void testRemoveProducer() throws Exception JavaDoc {
24     producerRegistry.removeAllProducers();
25
26     producerRegistry.addProducer(producer);
27     producerRegistry.removeAllProducers();
28     assertTrue(!producerRegistry.getAllProducers().hasNext());
29
30     producerRegistry.addProducer(producer);
31     producerRegistry.removeProducer(producer.getID());
32     assertTrue(!producerRegistry.getAllProducers().hasNext());
33   }
34 }
35
Popular Tags