1   /*
2   wsmo4j - a WSMO API and Reference Implementation
3   
4   Copyright (c) 2004-2005, OntoText Lab. / SIRMA
5   
6   This library is free software; you can redistribute it and/or modify it under
7   the terms of the GNU Lesser General Public License as published by the Free
8   Software Foundation; either version 2.1 of the License, or (at your option)
9   any later version.
10  This library is distributed in the hope that it will be useful, but WITHOUT
11  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12  FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13  details.
14  You should have received a copy of the GNU Lesser General Public License along
15  with this library; if not, write to the Free Software Foundation, Inc.,
16  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */
18  package test.wsmo4j.mediator;
19  
20  import org.wsmo.common.exception.*;
21  import org.wsmo.mediator.*;
22  
23  import test.wsmo4j.*;
24  
25  /**
26  * <p>Title: WSMO4J</p>
27  * <p>Description: WSMO API and a Reference Implementation</p>
28  * <p>Copyright:  Copyright (c) 2004-2005</p>
29  * <p>Company: OntoText Lab. / SIRMA </p>
30  * @author not attributable
31  * @version 1.0
32  */
33  public class MediatorTest extends Wsmo4jTestCase {
34      
35      public void testMediator() throws Exception {
36          Mediator mediator = 
37              factory.createOOMediator(factory.createIRI("http://example.org/#ooMediator"));
38          mediator.addSource(factory.createIRI("http://example.org/#ooMediator2"));
39          mediator.addSource(factory.createIRI("http://example.org/#ooMediator3"));
40          mediator.addSource(factory.createIRI("http://example.org/#ooMediator4"));
41          
42          mediator = factory.createGGMediator(factory.createIRI("http://example.org/#ggMediator"));
43          mediator.addSource(factory.createIRI("http://example.org/#ggMediator2"));
44          
45          try {
46              mediator.addSource(factory.createIRI("http://example.org/#ggMediator3"));
47              fail("Only ooMediators support multiple sources!");
48          }
49          catch (InvalidModelException e) {
50          }       
51      }
52  }