You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by mb...@apache.org on 2007/05/11 13:46:14 UTC

svn commit: r537168 - in /incubator/uima/uimaj/trunk/uimaj-core/src/test: java/org/apache/uima/util/impl/XMLParser_implTest.java resources/XmlParserTest/TestPearSpecifier.xml

Author: mbaessler
Date: Fri May 11 04:46:13 2007
New Revision: 537168

URL: http://svn.apache.org/viewvc?view=rev&rev=537168
Log:
UIMA-351

add XML parser testcase for the pearSpecifier

JIRA ticket https://issues.apache.org/jira/browse/UIMA-351

Added:
    incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/XmlParserTest/TestPearSpecifier.xml
Modified:
    incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/util/impl/XMLParser_implTest.java

Modified: incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/util/impl/XMLParser_implTest.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/util/impl/XMLParser_implTest.java?view=diff&rev=537168&r1=537167&r2=537168
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/util/impl/XMLParser_implTest.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/util/impl/XMLParser_implTest.java Fri May 11 04:46:13 2007
@@ -32,6 +32,7 @@
 import org.apache.uima.flow.FlowControllerDescription;
 import org.apache.uima.resource.CustomResourceSpecifier;
 import org.apache.uima.resource.Parameter;
+import org.apache.uima.resource.PearSpecifier;
 import org.apache.uima.resource.URISpecifier;
 import org.apache.uima.test.junit_extension.JUnitExtension;
 import org.apache.uima.util.InvalidXMLException;
@@ -178,4 +179,18 @@
     assertEquals("param2", params[1].getName());
     assertEquals("val2", params[1].getValue());  
   }
+  
+  public void testParsePearSpecifier() throws Exception {
+    XMLInputSource in = new XMLInputSource(
+            JUnitExtension.getFile("XmlParserTest/TestPearSpecifier.xml"));
+    PearSpecifier pearSpec = this.mXmlParser.parsePearSpecifier(in);
+    assertEquals("/home/user/uimaApp/installedPears/testpear", pearSpec.getPearPath());
+    Parameter[] params = pearSpec.getParameters();
+    assertEquals(2, params.length);
+    assertEquals("param1", params[0].getName());
+    assertEquals("val1", params[0].getValue());
+    assertEquals("param2", params[1].getName());
+    assertEquals("val2", params[1].getValue());  
+  }
+
 }

Added: incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/XmlParserTest/TestPearSpecifier.xml
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/XmlParserTest/TestPearSpecifier.xml?view=auto&rev=537168
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/XmlParserTest/TestPearSpecifier.xml (added)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/XmlParserTest/TestPearSpecifier.xml Fri May 11 04:46:13 2007
@@ -0,0 +1,25 @@
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+<pearSpecifier xmlns="http://uima.apache.org/resourceSpecifier">
+   <pearPath>/home/user/uimaApp/installedPears/testpear</pearPath>
+   <parameters>
+     <parameter name="param1" value="val1"/>
+     <parameter name="param2" value="val2"/>
+   </parameters>  
+</pearSpecifier>
\ No newline at end of file