1   /*
2    wsmo4j - a WSMO API and Reference Implementation
3   
4    Copyright (c) 2005, University of Innsbruck, Austria
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.common;
19  
20  import junit.framework.*;
21  
22  import org.wsmo.factory.*;
23  
24  /**
25   * @author Holger Lausen
26   */
27  public class IRITest extends TestCase {
28   
29      public void testValidIRI() throws Exception{
30          WsmoFactory f = Factory.createWsmoFactory(null);
31          try{
32              f.createIRI("relative");
33              fail("relative IRI check failed");
34          }
35          catch(IllegalArgumentException e){}
36          try{
37              f.createIRI("aö:relative");
38              fail("scheme check failed");
39          }
40          catch(IllegalArgumentException e){}
41          try{
42              f.createIRI("http://absolute");
43          }
44          catch(IllegalArgumentException e){
45              fail("IRI check failed");
46          }
47      }
48  }
49  
50  /*
51   * $Log$
52   * Revision 1.2  2005/11/21 13:16:47  holgerlausen
53   * removed reference to implemenation (only API now)
54   *
55   * Revision 1.1  2005/11/03 18:15:34  holgerlausen
56   * included check in IRIImpl for absolute IRI
57   *
58   */