+++ /dev/null
-/*--------------------------------------------------------------------------\r
- * Copyright 2004 Taro L. Saito\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- *--------------------------------------------------------------------------*/\r
-//--------------------------------------\r
-// XerialJ Project\r
-//\r
-// InvertedPathTest.java\r
-// Since: 2005/06/02\r
-//\r
-// $URL: http://www.xerial.org/svn/project/XerialJ/trunk/xerial-core/src/test/java/org/xerial/util/xml/index/InvertedPathTest.java $ \r
-// $Author: leo $\r
-//--------------------------------------\r
-package org.xerial.util.xml.index;\r
-\r
-import org.xerial.util.xml.index.InvertedPath;\r
-\r
-import junit.framework.TestCase;\r
-\r
-public class InvertedPathTest extends TestCase\r
-{\r
- public void testInvertedPath()\r
- {\r
- InvertedPath p1 = new InvertedPath();\r
- p1.addParent("author");\r
- p1.addParent("book");\r
- p1.addParent("booklist");\r
- String[] tagList = {"author", "book", "booklist"};\r
- int index = 0;\r
- for(String s : p1)\r
- assertEquals(tagList[index++], s);\r
- \r
- InvertedPath p2 = new InvertedPath("author.book.booklist");\r
- assertTrue(p1.equals(p2));\r
- \r
- \r
- }\r
- public void testComparator()\r
- {\r
- InvertedPath p1 = new InvertedPath("author.book.booklist");\r
- InvertedPath p2 = new InvertedPath("author.book");\r
- assertTrue(p1.compareTo(p2) > 0);\r
- p2.addParent("booklist");\r
- assertTrue(p1.compareTo(p2) == 0);\r
- }\r
-}\r
-\r
-\r
-\r
-\r