+++ /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
-// PullParserUtilTest.java\r
-// Since: 2005/01/11\r
-//\r
-// $URL: http://www.xerial.org/svn/project/XerialJ/trunk/xerial-core/src/test/java/org/xerial/util/xml/pullparser/PullParserUtilTest.java $ \r
-// $Author: leo $\r
-//--------------------------------------\r
-package org.xerial.util.xml.pullparser;\r
-\r
-import java.io.IOException;\r
-\r
-import junit.framework.TestCase;\r
-\r
-import org.xerial.util.FileResource;\r
-import org.xerial.util.xml.XMLException;\r
-import org.xmlpull.v1.XmlPullParser;\r
-import org.xmlpull.v1.XmlPullParserFactory;\r
-\r
-/**\r
- * @author leo\r
- * \r
- */\r
-public class PullParserUtilTest extends TestCase\r
-{\r
- XmlPullParser parser;\r
-\r
- protected void setUp() throws Exception\r
- {\r
- parser = XmlPullParserFactory.newInstance().newPullParser();\r
- parser.setInput(FileResource.open(PullParserUtilTest.class, "booklist.xml"));\r
- }\r
-\r
- protected void tearDown() throws Exception\r
- {\r
-\r
- }\r
-\r
- public void testParseUntil() throws XMLException, IOException\r
- {\r
- int bookCount = 0;\r
- while (PullParserUtil.parseUntil("book", parser))\r
- {\r
- bookCount++;\r
- assertEquals("book", parser.getName());\r
- }\r
- assertEquals(2, bookCount);\r
- }\r
-}\r