abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From calav...@apache.org
Subject svn commit: r687044 - /incubator/abdera/java/trunk/extensions/opensearch/src/test/java/org/apache/abdera/test/ext/opensearch/model/OpenSearchAtomTest.java
Date Tue, 19 Aug 2008 12:58:40 GMT
Author: calavera
Date: Tue Aug 19 05:58:39 2008
New Revision: 687044

URL: http://svn.apache.org/viewvc?rev=687044&view=rev
Log:
test to assure that simpleExtension adds the namespace properly

Modified:
    incubator/abdera/java/trunk/extensions/opensearch/src/test/java/org/apache/abdera/test/ext/opensearch/model/OpenSearchAtomTest.java

Modified: incubator/abdera/java/trunk/extensions/opensearch/src/test/java/org/apache/abdera/test/ext/opensearch/model/OpenSearchAtomTest.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/extensions/opensearch/src/test/java/org/apache/abdera/test/ext/opensearch/model/OpenSearchAtomTest.java?rev=687044&r1=687043&r2=687044&view=diff
==============================================================================
--- incubator/abdera/java/trunk/extensions/opensearch/src/test/java/org/apache/abdera/test/ext/opensearch/model/OpenSearchAtomTest.java
(original)
+++ incubator/abdera/java/trunk/extensions/opensearch/src/test/java/org/apache/abdera/test/ext/opensearch/model/OpenSearchAtomTest.java
Tue Aug 19 05:58:39 2008
@@ -107,4 +107,24 @@
         assertEquals(Query.Role.REQUEST, q.getRole());
         assertEquals(QUERY_TERMS, q.getSearchTerms());
     }
+    
+    @Test
+    public void testFeedSimpleExtension() throws Exception {    	
+    	Feed feed = Abdera.getInstance().getFactory().newFeed();
+        
+        feed.setId("http://example.com/opensearch+example");
+        feed.setTitle("An OpenSearch Example");
+        feed.setUpdated(new Date());
+        
+        feed.addSimpleExtension(OpenSearchConstants.TOTAL_RESULTS, String.valueOf(TOTAL_RESULTS));
       
+        feed.addSimpleExtension(OpenSearchConstants.ITEMS_PER_PAGE, String.valueOf(ITEMS_PER_PAGE));
+        
+        StringWriter writer = new StringWriter();
+        feed.writeTo(writer);        
+        String result = writer.toString();        
+        
+        assertXpathEvaluatesTo(String.valueOf(TOTAL_RESULTS), "//os:totalResults", result);
+        assertXpathEvaluatesTo(String.valueOf(ITEMS_PER_PAGE), "//os:itemsPerPage", result);
       
+        
+    }
 }



Mime
View raw message