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.logicalexpression;
19  
20  import org.deri.wsmo4j.logicalexpression.util.GetRootUtil;
21  import org.omwg.logicalexpression.LogicalExpression;
22  import org.omwg.ontology.Variable;
23  
24  import test.wsmo4j.validator.ValidatorTestCase;
25  
26  /**
27   * Test class for testing the utility class to get the root variable 
28   * from a WSML-DL formula.
29   * 
30   * <pre>
31   * Created on Sep 27, 2006
32   * Committed by $Author: morcen $
33   * $Source$,
34   * </pre>
35   * 
36   * @author nathalie.steinmetz@deri.org
37   * @version $Revision: 1946 $ $Date: 2007-04-02 15:13:28 +0300 (Mon, 02 Apr 2007) $
38   */
39  public class GetRootUtilTest extends ValidatorTestCase {
40  
41  	public GetRootUtil util = new GetRootUtil();
42  	
43  	public void testGetRoot() throws Exception {
44  		LogicalExpression logExpr = leFactory.createLogicalExpression(
45  				"?x memberOf BigDogOwner implies ((?x memberOf Human) " +
46  				"and (forall ?y(?x[hasDog hasValue ?y] implies " +
47  				"(?y memberOf BigDog)))).", ontology);
48  		Variable root = util.getRootVariable(logExpr);
49  		assertEquals("?x", root.toString());
50  	}	
51  	
52  }
53  /*
54   * $Log$
55   * Revision 1.3  2007/04/02 12:13:22  morcen
56   * Generics support added to wsmo-api, wsmo4j and wsmo-test
57   *
58   * Revision 1.2  2006/12/05 16:24:37  nathaliest
59   * *** empty log message ***
60   *
61   * Revision 1.1  2006/09/28 13:11:34  nathaliest
62   * added utility method to geet root variable of valid WSML-DL formula and added corresponding tests
63   *
64   * 
65   */