commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r601524 - in /commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath: JXPathTestSuite.java ri/model/EmbeddedColonMapKeysTest.java
Date Wed, 05 Dec 2007 21:05:30 GMT
Author: mbenson
Date: Wed Dec  5 13:05:28 2007
New Revision: 601524

URL: http://svn.apache.org/viewvc?rev=601524&view=rev
Log:
[JXPATH-104] testcase

Added:
    commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/model/EmbeddedColonMapKeysTest.java
  (with props)
Modified:
    commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/JXPathTestSuite.java

Modified: commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/JXPathTestSuite.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/JXPathTestSuite.java?rev=601524&r1=601523&r2=601524&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/JXPathTestSuite.java (original)
+++ commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/JXPathTestSuite.java Wed
Dec  5 13:05:28 2007
@@ -30,6 +30,7 @@
 import org.apache.commons.jxpath.ri.compiler.CoreOperationTest;
 import org.apache.commons.jxpath.ri.compiler.ExtensionFunctionTest;
 import org.apache.commons.jxpath.ri.compiler.VariableTest;
+import org.apache.commons.jxpath.ri.model.EmbeddedColonMapKeysTest;
 import org.apache.commons.jxpath.ri.model.EmptyCollectionTest;
 import org.apache.commons.jxpath.ri.model.ExternalXMLNamespaceTest;
 import org.apache.commons.jxpath.ri.model.MixedModelTest;
@@ -101,6 +102,7 @@
         suite.addTestSuite(XMLPreserveSpaceTest.class);
         suite.addTestSuite(ExternalXMLNamespaceTest.class);
         suite.addTestSuite(BadlyImplementedFactoryTest.class);
+        suite.addTestSuite(EmbeddedColonMapKeysTest.class);
         return suite;
     }
 }

Added: commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/model/EmbeddedColonMapKeysTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/model/EmbeddedColonMapKeysTest.java?rev=601524&view=auto
==============================================================================
--- commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/model/EmbeddedColonMapKeysTest.java
(added)
+++ commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/model/EmbeddedColonMapKeysTest.java
Wed Dec  5 13:05:28 2007
@@ -0,0 +1,62 @@
+/*
+ * 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.
+ */
+package org.apache.commons.jxpath.ri.model;
+
+import java.util.HashMap;
+
+import org.apache.commons.jxpath.JXPathContext;
+import org.apache.commons.jxpath.JXPathTestCase;
+
+/**
+ * JXPATH-104 test.
+ * 
+ * @author Matt Benson
+ * @version $Revision$ $Date$
+ */
+public class EmbeddedColonMapKeysTest extends JXPathTestCase {
+    private JXPathContext context;
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see junit.framework.TestCase#setUp()
+     */
+    protected void setUp() throws Exception {
+        super.setUp();
+        HashMap m = new HashMap();
+        m.put("foo:key", "value");
+        context = JXPathContext.newContext(m);
+        context.setLenient(true);
+    }
+
+    /**
+     * Create a new EmbeddedColonMapKeysTest.
+     */
+    public EmbeddedColonMapKeysTest(String name) {
+        super(name);
+    }
+
+    public void testSelectNodes() throws Exception {
+        assertXPathValueIterator(context, "/.[@name='foo:key']", list("value"));
+        assertXPathValueIterator(context, "/foo:key", list());
+    }
+
+    public void testSelectSingleNode() throws Exception {
+        assertXPathValue(context, "/.[@name='foo:key']", "value");
+        assertXPathValueLenient(context, "/foo:key", null);
+    }
+}

Propchange: commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/model/EmbeddedColonMapKeysTest.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message