abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r486686 - in /incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax: TestSuite.java XhtmlTest.java
Date Wed, 13 Dec 2006 15:36:15 GMT
Author: jmsnell
Date: Wed Dec 13 07:36:14 2006
New Revision: 486686

URL: http://svn.apache.org/viewvc?view=rev&rev=486686
Log:
Add a test case to test for regression on ABDERA-227
Add it to the test suite
Turns out that ConcurrencyTest wasn't in the test suite either

Added:
    incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/XhtmlTest.java
Modified:
    incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/TestSuite.java

Modified: incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/TestSuite.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/TestSuite.java?view=diff&rev=486686&r1=486685&r2=486686
==============================================================================
--- incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/TestSuite.java
(original)
+++ incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/TestSuite.java
Wed Dec 13 07:36:14 2006
@@ -34,5 +34,7 @@
     addTestSuite(FeedValidatorTest.class);
     addTestSuite(FOMTest.class);
     addTestSuite(ParserTest.class);
+    addTestSuite(ConcurrencyTest.class);
+    addTestSuite(XhtmlTest.class);
   }
 }

Added: incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/XhtmlTest.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/XhtmlTest.java?view=auto&rev=486686
==============================================================================
--- incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/XhtmlTest.java
(added)
+++ incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/XhtmlTest.java
Wed Dec 13 07:36:14 2006
@@ -0,0 +1,46 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  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.  For additional information regarding
+* copyright in this work, please see the NOTICE file in the top level
+* directory of this distribution.
+*/
+package org.apache.abdera.test.parser.stax;
+
+import org.apache.abdera.Abdera;
+import org.apache.abdera.model.Content;
+import org.apache.abdera.model.Div;
+import org.apache.abdera.model.Entry;
+
+import junit.framework.TestCase;
+
+public class XhtmlTest extends TestCase {
+ 
+  public void testXhtml() throws Exception {
+    
+    Abdera abdera = new Abdera();
+    Entry entry = abdera.newEntry();
+    entry.setContentAsXhtml("<p>Test</p>");
+    assertNotNull(entry.getContent());
+    assertEquals(entry.getContentType(), Content.Type.XHTML);
+    assertTrue(entry.getContentElement().getValueElement() instanceof Div);
+    
+    entry = abdera.newEntry();
+    entry.setContent("<a><b><c/></b></a>", Content.Type.XML);
+    assertNotNull(entry.getContent());
+    assertEquals(entry.getContentType(), Content.Type.XML);
+    assertNotNull(entry.getContentElement().getValueElement());
+    
+  }
+  
+}



Mime
View raw message