manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1718660 - /manifoldcf/trunk/framework/connector-common/src/test/java/org/apache/manifoldcf/connectorcommon/fuzzyml/TestFuzzyML.java
Date Tue, 08 Dec 2015 18:09:21 GMT
Author: kwright
Date: Tue Dec  8 18:09:21 2015
New Revision: 1718660

URL: http://svn.apache.org/viewvc?rev=1718660&view=rev
Log:
Add test for unquoted attribute with trailing slash

Modified:
    manifoldcf/trunk/framework/connector-common/src/test/java/org/apache/manifoldcf/connectorcommon/fuzzyml/TestFuzzyML.java

Modified: manifoldcf/trunk/framework/connector-common/src/test/java/org/apache/manifoldcf/connectorcommon/fuzzyml/TestFuzzyML.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/connector-common/src/test/java/org/apache/manifoldcf/connectorcommon/fuzzyml/TestFuzzyML.java?rev=1718660&r1=1718659&r2=1718660&view=diff
==============================================================================
--- manifoldcf/trunk/framework/connector-common/src/test/java/org/apache/manifoldcf/connectorcommon/fuzzyml/TestFuzzyML.java
[UTF-8] (original)
+++ manifoldcf/trunk/framework/connector-common/src/test/java/org/apache/manifoldcf/connectorcommon/fuzzyml/TestFuzzyML.java
[UTF-8] Tue Dec  8 18:09:21 2015
@@ -181,6 +181,43 @@ public class TestFuzzyML
 ;
 
   @Test
+  public void testTags()
+    throws IOException, ManifoldCFException
+  {
+    org.apache.manifoldcf.core.system.Logging.misc = org.apache.log4j.Logger.getLogger("test");
+    InputStream is = new ByteArrayInputStream("<href a=/hello/out/there/>".getBytes(StandardCharsets.UTF_8));
+    Parser p = new Parser();
+    TestParseState x = new TestParseState();
+    p.parseWithCharsetDetection(null,is,x);
+    Assert.assertTrue(x.lastTagName != null);
+    Assert.assertTrue(x.lastTagName.equals("href"));
+    Assert.assertTrue(x.lastTagAttributes.size() == 1);
+    Assert.assertTrue(x.lastTagAttributes.get(0).getName().equals("a"));
+    Assert.assertTrue(x.lastTagAttributes.get(0).getValue().equals("/hello/out/there/"));
+  }
+  
+  protected static class TestParseState extends TagParseState
+  {
+    public String lastTagName = null;
+    public List<AttrNameValue> lastTagAttributes = null;
+    
+    public TestParseState()
+    {
+      super();
+    }
+    
+    @Override
+    protected boolean noteTag(String tagName, List<AttrNameValue> attributes)
+      throws ManifoldCFException
+    {
+      lastTagName = tagName;
+      lastTagAttributes = attributes;
+      return super.noteTag(tagName, attributes);
+    }
+
+  }
+
+  @Test
   public void testFailure()
     throws IOException, ManifoldCFException
   {



Mime
View raw message