abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ckopp...@apache.org
Subject svn commit: r944861 [1/2] - in /abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax: AtomConformanceTest.java FOMTest.java FeedParserTest.java FeedValidatorTest.java ParserTest.java XhtmlTest.java
Date Sun, 16 May 2010 15:14:13 GMT
Author: ckoppelt
Date: Sun May 16 15:14:12 2010
New Revision: 944861

URL: http://svn.apache.org/viewvc?rev=944861&view=rev
Log:
fix for ABDERA-102

Modified:
    abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/AtomConformanceTest.java
    abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/FOMTest.java
    abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/FeedParserTest.java
    abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/FeedValidatorTest.java
    abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/ParserTest.java
    abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/XhtmlTest.java

Modified: abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/AtomConformanceTest.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/AtomConformanceTest.java?rev=944861&r1=944860&r2=944861&view=diff
==============================================================================
--- abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/AtomConformanceTest.java (original)
+++ abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/AtomConformanceTest.java Sun May 16 15:14:12 2010
@@ -112,11 +112,10 @@ public class AtomConformanceTest extends
       switch(n) {
         case 1:
           assertNotNull(entry.getTitleElement());
-          assertEquals(entry.getIdElement().getValue(), 
-              new IRI("tag:example.org,2007:bar"));
+          assertEquals(new IRI("tag:example.org,2007:bar"), entry.getIdElement().getValue());
           Text summary = entry.getSummaryElement();
           assertNotNull(summary);
-          assertEquals(summary.getTextType(), Text.Type.XHTML);
+          assertEquals( Text.Type.XHTML, summary.getTextType());
           OMElement element = (OMElement)summary;
           OMElement div = 
             element.getFirstChildWithName(
@@ -125,11 +124,10 @@ public class AtomConformanceTest extends
           break;
         case 2:
           assertNotNull(entry.getTitleElement());
-          assertEquals(entry.getIdElement().getValue(), 
-              new IRI("tag:example.org,2007:bar"));
+          assertEquals(new IRI("tag:example.org,2007:bar"), entry.getIdElement().getValue());
           summary = entry.getSummaryElement();
           assertNotNull(summary);
-          assertEquals(summary.getTextType(), Text.Type.XHTML);
+          assertEquals( Text.Type.XHTML, summary.getTextType());
           element = (OMElement)summary;
           div = 
             element.getFirstChildWithName(
@@ -138,11 +136,10 @@ public class AtomConformanceTest extends
           break;
         case 3:
           assertNotNull(entry.getTitleElement());
-          assertEquals(entry.getIdElement().getValue(), 
-              new IRI("tag:example.org,2007:bar"));
+          assertEquals(new IRI("tag:example.org,2007:bar"), entry.getIdElement().getValue());
           summary = entry.getSummaryElement();
           assertNotNull(summary);
-          assertEquals(summary.getTextType(), Text.Type.XHTML);
+          assertEquals( Text.Type.XHTML, summary.getTextType());
           element = (OMElement)summary;
           div = 
             element.getFirstChildWithName(
@@ -163,12 +160,12 @@ public class AtomConformanceTest extends
     Document<Feed> doc = parse(uri);
     assertNotNull(doc);
     Feed feed = doc.getRoot();
-    assertEquals(feed.getBaseUri(), new IRI("http://www.snellspace.com/public/xmlbase.xml"));
-    assertEquals(feed.getLogoElement().getResolvedValue(), new IRI("http://www.snellspace.com/public/atom-logo.png"));
-    assertEquals(feed.getIconElement().getResolvedValue(),new IRI("http://www.snellspace.com/public/atom-icon.png"));
+    assertEquals( new IRI("http://www.snellspace.com/public/xmlbase.xml"), feed.getBaseUri());
+    assertEquals( new IRI("http://www.snellspace.com/public/atom-logo.png"), feed.getLogoElement().getResolvedValue());
+    assertEquals(new IRI("http://www.snellspace.com/public/atom-icon.png"), feed.getIconElement().getResolvedValue());
     
     Entry entry = feed.getEntries().get(0);
-    assertEquals(entry.getAlternateLinkResolvedHref().toString(), "http://www.snellspace.com/wp");
+    assertEquals( "http://www.snellspace.com/wp", entry.getAlternateLinkResolvedHref().toString());
   }
   
   
@@ -189,81 +186,71 @@ public class AtomConformanceTest extends
     for (Entry entry : entries ) {
       switch(n) {
         case 1:
-          assertEquals(entry.getIdElement().getValue(), new IRI("tag:example.org,2006:atom/conformance/element_order/1"));
-          assertEquals(entry.getTitleType(), Text.Type.TEXT);
-          assertEquals(entry.getSummaryType(), Text.Type.TEXT);
+          assertEquals(new IRI("tag:example.org,2006:atom/conformance/element_order/1"), entry.getIdElement().getValue());
+          assertEquals( Text.Type.TEXT, entry.getTitleType());
+          assertEquals( Text.Type.TEXT, entry.getSummaryType());
           assertNotNull(entry.getUpdatedElement().getValue());
-          assertEquals(entry.getLinks(Link.REL_ALTERNATE).size(),1);
+          assertEquals(1, entry.getLinks(Link.REL_ALTERNATE).size());
           break;
         case 2:
-          assertEquals(entry.getIdElement().getValue(), new IRI("tag:example.org,2006:atom/conformance/element_order/2"));
-          assertEquals(entry.getTitleType(), Text.Type.TEXT);
-          assertEquals(entry.getSummaryType(), Text.Type.TEXT);
+          assertEquals(new IRI("tag:example.org,2006:atom/conformance/element_order/2"), entry.getIdElement().getValue());
+          assertEquals( Text.Type.TEXT, entry.getTitleType());
+          assertEquals( Text.Type.TEXT, entry.getSummaryType());
           assertNotNull(entry.getUpdatedElement().getValue());
-          assertEquals(entry.getLinks(Link.REL_ALTERNATE).size(),1);
+          assertEquals(1, entry.getLinks(Link.REL_ALTERNATE).size());
           break;
         case 3:
-          assertEquals(entry.getLinks(Link.REL_ALTERNATE).size(),2);
-          assertEquals(
-            entry.getLinks(Link.REL_ALTERNATE).get(0).getHref(), 
-            new IRI("http://www.snellspace.com/public/alternate"));
-          assertEquals(
-              entry.getLinks(Link.REL_ALTERNATE).get(1).getHref(), 
-              new IRI("http://www.snellspace.com/public/alternate2"));
+          assertEquals(2, entry.getLinks(Link.REL_ALTERNATE).size());
+          assertEquals(new IRI("http://www.snellspace.com/public/alternate"), entry.getLinks(Link.REL_ALTERNATE).get(0).getHref());
+          assertEquals(new IRI("http://www.snellspace.com/public/alternate2"), entry.getLinks(Link.REL_ALTERNATE).get(1).getHref());
           break;
         case 4:
-          assertEquals(entry.getLinks(Link.REL_ALTERNATE).size(),1);
-          assertEquals(
-              entry.getLinks(Link.REL_ALTERNATE).get(0).getHref(), 
-              new IRI("http://www.snellspace.com/public/alternate"));
+          assertEquals(1, entry.getLinks(Link.REL_ALTERNATE).size());
+          assertEquals(new IRI("http://www.snellspace.com/public/alternate"),
+              entry.getLinks(Link.REL_ALTERNATE).get(0).getHref());
           break;
         case 5:
           Text title = entry.getTitleElement();
-          assertEquals(entry.getTitleType(), Text.Type.TEXT);
+          assertEquals( Text.Type.TEXT, entry.getTitleType());
           String value = title.getValue();
-          assertEquals(value, "Entry with a source first");
-          assertEquals(entry.getLinks(Link.REL_ALTERNATE).size(),1);
-          assertEquals(
-              entry.getLinks(Link.REL_ALTERNATE).get(0).getHref(), 
-              new IRI("http://www.snellspace.com/public/alternate"));          
+          assertEquals( "Entry with a source first", value);
+          assertEquals(1, entry.getLinks(Link.REL_ALTERNATE).size());
+          assertEquals(new IRI("http://www.snellspace.com/public/alternate"),
+              entry.getLinks(Link.REL_ALTERNATE).get(0).getHref());          
           break;
         case 6:
           title = entry.getTitleElement();
-          assertEquals(entry.getTitleType(), Text.Type.TEXT);
+          assertEquals( Text.Type.TEXT, entry.getTitleType());
           value = title.getValue();
-          assertEquals(value, "Entry with a source last");
-          assertEquals(entry.getLinks(Link.REL_ALTERNATE).size(),1);
-          assertEquals(
-              entry.getLinks(Link.REL_ALTERNATE).get(0).getHref(), 
-              new IRI("http://www.snellspace.com/public/alternate"));
+          assertEquals( "Entry with a source last", value);
+          assertEquals(1, entry.getLinks(Link.REL_ALTERNATE).size());
+          assertEquals(new IRI("http://www.snellspace.com/public/alternate"),
+              entry.getLinks(Link.REL_ALTERNATE).get(0).getHref());
           break;
         case 7:
           title = entry.getTitleElement();
-          assertEquals(entry.getTitleType(), Text.Type.TEXT);
+          assertEquals( Text.Type.TEXT, entry.getTitleType());
           value = title.getValue();
-          assertEquals(value, "Entry with a source in the middle");
-          assertEquals(entry.getLinks(Link.REL_ALTERNATE).size(),1);
-          assertEquals(
-              entry.getLinks(Link.REL_ALTERNATE).get(0).getHref(), 
-              new IRI("http://www.snellspace.com/public/alternate"));          
+          assertEquals( "Entry with a source in the middle", value);
+          assertEquals(1, entry.getLinks(Link.REL_ALTERNATE).size());
+          assertEquals(new IRI("http://www.snellspace.com/public/alternate"),
+              entry.getLinks(Link.REL_ALTERNATE).get(0).getHref());          
           break;
         case 8:
           title = entry.getTitleElement();
-          assertEquals(entry.getTitleType(), Text.Type.TEXT);
+          assertEquals( Text.Type.TEXT, entry.getTitleType());
           value = title.getValue();
-          assertEquals(value, "Atom elements in an extension element");
-          assertEquals(
-            entry.getIdElement().getValue(), 
-            new IRI("tag:example.org,2006:atom/conformance/element_order/8"));
+          assertEquals( "Atom elements in an extension element", value);
+          assertEquals(new IRI("tag:example.org,2006:atom/conformance/element_order/8"),
+            entry.getIdElement().getValue());
           break;
         case 9:
           title = entry.getTitleElement();
-          assertEquals(entry.getTitleType(), Text.Type.TEXT);
+          assertEquals( Text.Type.TEXT, entry.getTitleType());
           value = title.getValue();
-          assertEquals(value, "Atom elements in an extension element");
-          assertEquals(
-            entry.getIdElement().getValue(), 
-            new IRI("tag:example.org,2006:atom/conformance/element_order/9"));
+          assertEquals( "Atom elements in an extension element", value);
+          assertEquals(new IRI("tag:example.org,2006:atom/conformance/element_order/9"),
+            entry.getIdElement().getValue());
           break;
       }
       n++;
@@ -285,86 +272,68 @@ public class AtomConformanceTest extends
     for (Entry entry : entries) {
       switch(n) {
         case 1:
-          assertEquals(entry.getLinks(Link.REL_ALTERNATE).size(),1);
-          assertEquals(
-            entry.getLinks(Link.REL_ALTERNATE).get(0).getHref(), 
-            new IRI("http://www.snellspace.com/public/linktests/alternate"));
+          assertEquals(1, entry.getLinks(Link.REL_ALTERNATE).size());
+          assertEquals(new IRI("http://www.snellspace.com/public/linktests/alternate"),
+            entry.getLinks(Link.REL_ALTERNATE).get(0).getHref());
           break;
         case 2:
-          assertEquals(entry.getLinks(Link.REL_ALTERNATE).size(),4);
-          assertEquals(
-              entry.getLinks(Link.REL_ALTERNATE).get(1).getHref(), 
-              new IRI("http://www.snellspace.com/public/linktests/alternate"));          
-          assertEquals(
-              entry.getLinks(Link.REL_ALTERNATE).get(2).getHref(), 
-              new IRI("http://www.snellspace.com/public/linktests/alternate2"));
+          assertEquals(4, entry.getLinks(Link.REL_ALTERNATE).size());
+          assertEquals(new IRI("http://www.snellspace.com/public/linktests/alternate"),
+              entry.getLinks(Link.REL_ALTERNATE).get(1).getHref());          
+          assertEquals(new IRI("http://www.snellspace.com/public/linktests/alternate2"),
+              entry.getLinks(Link.REL_ALTERNATE).get(2).getHref());
           break;
         case 3:
-          assertEquals(entry.getLinks(Link.REL_ALTERNATE).size(),1);
-          assertEquals(entry.getLinks(Link.REL_ENCLOSURE).size(),1);
-          assertEquals(entry.getLinks(Link.REL_RELATED).size(),1);
-          assertEquals(entry.getLinks(Link.REL_SELF).size(),1);
-          assertEquals(entry.getLinks(Link.REL_VIA).size(),1);    
-          assertEquals(
-              entry.getLinks(Link.REL_ALTERNATE).get(0).getHref(), 
-              new IRI("http://www.snellspace.com/public/linktests/alternate"));
-          assertEquals(
-              entry.getLinks(Link.REL_ENCLOSURE).get(0).getHref(), 
-              new IRI("http://www.snellspace.com/public/linktests/enclosure"));
-          assertEquals(
-              entry.getLinks(Link.REL_RELATED).get(0).getHref(), 
-              new IRI("http://www.snellspace.com/public/linktests/related"));
-          assertEquals(
-              entry.getLinks(Link.REL_SELF).get(0).getHref(), 
-              new IRI("http://www.snellspace.com/public/linktests/self"));
-          assertEquals(
-              entry.getLinks(Link.REL_VIA).get(0).getHref(), 
-              new IRI("http://www.snellspace.com/public/linktests/via"));
+          assertEquals(1, entry.getLinks(Link.REL_ALTERNATE).size());
+          assertEquals(1, entry.getLinks(Link.REL_ENCLOSURE).size());
+          assertEquals(1, entry.getLinks(Link.REL_RELATED).size());
+          assertEquals(1, entry.getLinks(Link.REL_SELF).size());
+          assertEquals(1, entry.getLinks(Link.REL_VIA).size());    
+          assertEquals(new IRI("http://www.snellspace.com/public/linktests/alternate"),
+              entry.getLinks(Link.REL_ALTERNATE).get(0).getHref());
+          assertEquals(new IRI("http://www.snellspace.com/public/linktests/enclosure"),
+              entry.getLinks(Link.REL_ENCLOSURE).get(0).getHref());
+          assertEquals(new IRI("http://www.snellspace.com/public/linktests/related"),
+              entry.getLinks(Link.REL_RELATED).get(0).getHref());
+          assertEquals(new IRI("http://www.snellspace.com/public/linktests/self"),
+              entry.getLinks(Link.REL_SELF).get(0).getHref());
+          assertEquals(new IRI("http://www.snellspace.com/public/linktests/via"),
+              entry.getLinks(Link.REL_VIA).get(0).getHref());
           break;
         case 4:
-          assertEquals(entry.getLinks(Link.REL_ALTERNATE).size(),2);
-          assertEquals(entry.getLinks(Link.REL_ENCLOSURE).size(),1);
-          assertEquals(entry.getLinks(Link.REL_RELATED).size(),1);
-          assertEquals(entry.getLinks(Link.REL_SELF).size(),1);
-          assertEquals(entry.getLinks(Link.REL_VIA).size(),1);          
-          assertEquals(
-              entry.getLinks(Link.REL_ALTERNATE).get(0).getHref(), 
-              new IRI("http://www.snellspace.com/public/linktests/alternate"));
-          assertEquals(
-              entry.getLinks(Link.REL_ALTERNATE).get(1).getHref(), 
-              new IRI("http://www.snellspace.com/public/linktests/alternate2"));
-          assertEquals(
-              entry.getLinks(Link.REL_ENCLOSURE).get(0).getHref(), 
-              new IRI("http://www.snellspace.com/public/linktests/enclosure"));
-          assertEquals(
-              entry.getLinks(Link.REL_RELATED).get(0).getHref(), 
-              new IRI("http://www.snellspace.com/public/linktests/related"));
-          assertEquals(
-              entry.getLinks(Link.REL_SELF).get(0).getHref(), 
-              new IRI("http://www.snellspace.com/public/linktests/self"));
-          assertEquals(
-              entry.getLinks(Link.REL_VIA).get(0).getHref(), 
-              new IRI("http://www.snellspace.com/public/linktests/via"));
+          assertEquals(2, entry.getLinks(Link.REL_ALTERNATE).size());
+          assertEquals(1, entry.getLinks(Link.REL_ENCLOSURE).size());
+          assertEquals(1, entry.getLinks(Link.REL_RELATED).size());
+          assertEquals(1, entry.getLinks(Link.REL_SELF).size());
+          assertEquals(1, entry.getLinks(Link.REL_VIA).size());          
+          assertEquals(new IRI("http://www.snellspace.com/public/linktests/alternate"),
+              entry.getLinks(Link.REL_ALTERNATE).get(0).getHref());
+          assertEquals(new IRI("http://www.snellspace.com/public/linktests/alternate2"),
+              entry.getLinks(Link.REL_ALTERNATE).get(1).getHref());
+          assertEquals(new IRI("http://www.snellspace.com/public/linktests/enclosure"),
+              entry.getLinks(Link.REL_ENCLOSURE).get(0).getHref());
+          assertEquals(new IRI("http://www.snellspace.com/public/linktests/related"),
+              entry.getLinks(Link.REL_RELATED).get(0).getHref());
+          assertEquals(new IRI("http://www.snellspace.com/public/linktests/self"),
+              entry.getLinks(Link.REL_SELF).get(0).getHref());
+          assertEquals(new IRI("http://www.snellspace.com/public/linktests/via"),
+              entry.getLinks(Link.REL_VIA).get(0).getHref());
           break;
         case 5:
-          assertEquals(entry.getLinks(Link.REL_ALTERNATE).size(),1);
-          assertEquals(entry.getLinks(Link.REL_LICENSE).size(),1);  
-          assertEquals(
-              entry.getLinks(Link.REL_ALTERNATE).get(0).getHref(), 
-              new IRI("http://www.snellspace.com/public/linktests/alternate"));
-          assertEquals(
-              entry.getLinks(Link.REL_LICENSE).get(0).getHref(), 
-              new IRI("http://www.snellspace.com/public/linktests/license"));
+          assertEquals(1, entry.getLinks(Link.REL_ALTERNATE).size());
+          assertEquals(1, entry.getLinks(Link.REL_LICENSE).size());  
+          assertEquals(new IRI("http://www.snellspace.com/public/linktests/alternate"),
+              entry.getLinks(Link.REL_ALTERNATE).get(0).getHref());
+          assertEquals(new IRI("http://www.snellspace.com/public/linktests/license"),
+              entry.getLinks(Link.REL_LICENSE).get(0).getHref());
           break;
         case 6:
-          assertEquals(entry.getLinks(Link.REL_ALTERNATE).size(),1);
-          assertEquals(entry.getLinks("http://example.org").size(),1);
-          assertEquals(
-              entry.getLinks(Link.REL_ALTERNATE).get(0).getHref(), 
-              new IRI("http://www.snellspace.com/public/linktests/alternate"));
-          assertEquals(
-              entry.getLinks("http://example.org").get(0).getHref(), 
-              new IRI("http://www.snellspace.com/public/linktests/example"));
+          assertEquals(1, entry.getLinks(Link.REL_ALTERNATE).size());
+          assertEquals(1, entry.getLinks("http://example.org").size());
+          assertEquals(new IRI("http://www.snellspace.com/public/linktests/alternate"),
+              entry.getLinks(Link.REL_ALTERNATE).get(0).getHref());
+          assertEquals(new IRI("http://www.snellspace.com/public/linktests/example"),
+              entry.getLinks("http://example.org").get(0).getHref());
           break;
       }
       n++;

Modified: abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/FOMTest.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/FOMTest.java?rev=944861&r1=944860&r2=944861&view=diff
==============================================================================
--- abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/FOMTest.java (original)
+++ abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/FOMTest.java Sun May 16 15:14:12 2010
@@ -121,22 +121,22 @@ public class FOMTest {
     Document<Feed> doc = getParser().parse(in);
     Feed feed = doc.getRoot();
     
-    assertEquals(feed.getTitle(),"Example Feed");
-    assertEquals(feed.getTitleType(), Text.Type.TEXT);
-    assertEquals(feed.getAlternateLink().getResolvedHref().toString(), "http://example.org/");
+    assertEquals("Example Feed", feed.getTitle());
+    assertEquals( Text.Type.TEXT, feed.getTitleType());
+    assertEquals( "http://example.org/", feed.getAlternateLink().getResolvedHref().toString());
     assertNotNull(feed.getUpdated());
-    assertEquals(feed.getAuthor().getName(), "John Doe");
-    assertEquals(feed.getId().toString(), "urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6");
+    assertEquals( "John Doe", feed.getAuthor().getName());
+    assertEquals( "urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6", feed.getId().toString());
     
     Entry entry = feed.getEntries().get(0);
 
-    assertEquals(entry.getTitle(),"Atom-Powered Robots Run Amok");
-    assertEquals(entry.getTitleType(), Text.Type.TEXT);
-    assertEquals(entry.getAlternateLink().getResolvedHref().toString(), "http://example.org/2003/12/13/atom03");
-    assertEquals(entry.getId().toString(),"urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a");
+    assertEquals("Atom-Powered Robots Run Amok", entry.getTitle());
+    assertEquals( Text.Type.TEXT, entry.getTitleType());
+    assertEquals( "http://example.org/2003/12/13/atom03", entry.getAlternateLink().getResolvedHref().toString());
+    assertEquals("urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a", entry.getId().toString());
     assertNotNull(entry.getUpdated());
-    assertEquals(entry.getSummary(), "Some text.");
-    assertEquals(entry.getSummaryType(), Text.Type.TEXT);
+    assertEquals( "Some text.", entry.getSummary());
+    assertEquals( Text.Type.TEXT, entry.getSummaryType());
     
   }
 
@@ -165,8 +165,8 @@ public class FOMTest {
     entry2.setId("urn:uuid:1225c695-cfb8-4ebb-aaaa-80cb323feb5b", false);
     entry2.setSummary("A response");
 
-    assertEquals(feed.getEntries().get(0).getId().toString(), "urn:uuid:1225c695-cfb8-4ebb-aaaa-80cb323feb5b");
-    assertEquals(feed.getEntries().get(1).getId().toString(), "urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a");
+    assertEquals( "urn:uuid:1225c695-cfb8-4ebb-aaaa-80cb323feb5b", feed.getEntries().get(0).getId().toString());
+    assertEquals( "urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a", feed.getEntries().get(1).getId().toString());
     
   }
 
@@ -187,19 +187,19 @@ public class FOMTest {
     Document<Feed> doc = getParser().parse(in, url.toString().replaceAll(" ", "%20"), options);
     Feed feed = doc.getRoot();
     
-    assertEquals(feed.getTitle(),"Example Feed");
-    assertEquals(feed.getTitleType(), Text.Type.TEXT);
+    assertEquals("Example Feed", feed.getTitle());
+    assertEquals( Text.Type.TEXT, feed.getTitleType());
     assertNull(feed.getAlternateLink());
     assertNull(feed.getUpdated());
     assertNull(feed.getAuthor());
-    assertEquals(feed.getId().toString(), "urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6");
+    assertEquals( "urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6", feed.getId().toString());
     
     Entry entry = feed.getEntries().get(0);
 
-    assertEquals(entry.getTitle(),"Atom-Powered Robots Run Amok");
-    assertEquals(entry.getTitleType(), Text.Type.TEXT);
+    assertEquals("Atom-Powered Robots Run Amok", entry.getTitle());
+    assertEquals( Text.Type.TEXT, entry.getTitleType());
     assertNull(entry.getAlternateLink());
-    assertEquals(entry.getId().toString(),"urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a");
+    assertEquals("urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a", entry.getId().toString());
     assertNull(entry.getUpdated());
     assertNull(entry.getSummary());
     assertNull(entry.getSummaryType());
@@ -219,22 +219,22 @@ public class FOMTest {
     Document<Feed> doc = getParser().parse(in, url.toString().replaceAll(" ", "%20"), options);
     Feed feed = doc.getRoot();
     
-    assertEquals(feed.getTitle(),"Example Feed");
-    assertEquals(feed.getTitleType(), Text.Type.TEXT);
-    assertEquals(feed.getAlternateLink().getResolvedHref().toString(), "http://example.org/");
+    assertEquals("Example Feed", feed.getTitle());
+    assertEquals( Text.Type.TEXT, feed.getTitleType());
+    assertEquals( "http://example.org/", feed.getAlternateLink().getResolvedHref().toString());
     assertNull(feed.getUpdated());
-    assertEquals(feed.getAuthor().getName(), "John Doe");
-    assertEquals(feed.getId().toString(), "urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6");
+    assertEquals( "John Doe", feed.getAuthor().getName());
+    assertEquals( "urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6", feed.getId().toString());
     
     Entry entry = feed.getEntries().get(0);
 
-    assertEquals(entry.getTitle(),"Atom-Powered Robots Run Amok");
-    assertEquals(entry.getTitleType(), Text.Type.TEXT);
-    assertEquals(entry.getAlternateLink().getResolvedHref().toString(), "http://example.org/2003/12/13/atom03");
-    assertEquals(entry.getId().toString(),"urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a");
+    assertEquals("Atom-Powered Robots Run Amok", entry.getTitle());
+    assertEquals( Text.Type.TEXT, entry.getTitleType());
+    assertEquals( "http://example.org/2003/12/13/atom03", entry.getAlternateLink().getResolvedHref().toString());
+    assertEquals("urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a", entry.getId().toString());
     assertNull(entry.getUpdated());
-    assertEquals(entry.getSummary(), "Some text.");
-    assertEquals(entry.getSummaryType(), Text.Type.TEXT);
+    assertEquals( "Some text.", entry.getSummary());
+    assertEquals( Text.Type.TEXT, entry.getSummaryType());
 
   }
   
@@ -245,15 +245,15 @@ public class FOMTest {
     Document<Feed> doc = getParser().parse(in);
     Feed feed = doc.getRoot();
     XPath xpath = getXPath();
-    assertEquals(xpath.evaluate("count(/a:feed)", feed), 1.0d);
+    assertEquals( 1.0d, xpath.evaluate("count(/a:feed)", feed));
     assertTrue(xpath.booleanValueOf("/a:feed/a:entry", feed));
-    assertEquals(xpath.numericValueOf("count(/a:feed)", feed), 1.0d);
-    assertEquals(xpath.valueOf("/a:feed/a:entry/a:title", feed), "Atom-Powered Robots Run Amok");
-    assertEquals(xpath.selectNodes("/a:feed/a:entry", feed).size(), 1);
+    assertEquals( 1.0d, xpath.numericValueOf("count(/a:feed)", feed));
+    assertEquals( "Atom-Powered Robots Run Amok", xpath.valueOf("/a:feed/a:entry/a:title", feed));
+    assertEquals( 1, xpath.selectNodes("/a:feed/a:entry", feed).size());
     assertTrue(xpath.selectSingleNode("/a:feed", feed) instanceof Feed);
-    assertEquals(xpath.selectSingleNode("..", feed.getTitleElement()), feed);
-    assertEquals(xpath.selectSingleNode("ancestor::*", feed.getEntries().get(0)), feed);
-    assertEquals(xpath.valueOf("concat('The feed is is ',/a:feed/a:id)", feed), "The feed is is urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6");
+    assertEquals( feed, xpath.selectSingleNode("..", feed.getTitleElement()));
+    assertEquals( feed, xpath.selectSingleNode("ancestor::*", feed.getEntries().get(0)));
+    assertEquals( "The feed is is urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6", xpath.valueOf("concat('The feed is is ',/a:feed/a:id)", feed));
     
   }
   
@@ -261,8 +261,8 @@ public class FOMTest {
   public void testUriNormalization() throws Exception {
     String s1 = "HTTP://www.Example.ORG:80/./foo/%2d/../%2d/./foo";
     String s2 = "HTTP://www.Example.ORG:81/./foo/%2d/../%2d/./foo";
-    assertEquals(IRI.normalizeString(s1), "http://www.example.org/foo/-/foo");
-    assertEquals(IRI.normalizeString(s2), "http://www.example.org:81/foo/-/foo");
+    assertEquals( "http://www.example.org/foo/-/foo", IRI.normalizeString(s1));
+    assertEquals( "http://www.example.org:81/foo/-/foo", IRI.normalizeString(s2));
   }
   
   @Test
@@ -275,17 +275,17 @@ public class FOMTest {
     author.setEmail("b");
     author.setUri("c");
     assertNotNull(author);
-    assertEquals(author.getName(),"a");
-    assertEquals(author.getEmail(), "b");
-    assertEquals(author.getUri().toString(), "c");
+    assertEquals("a", author.getName());
+    assertEquals( "b", author.getEmail());
+    assertEquals( "c", author.getUri().toString());
     author = factory.newAuthor();
     author.setName("a");
     author.setEmail("b");
     author.setUri("c");
     assertNotNull(author);
-    assertEquals(author.getName(),"a");
-    assertEquals(author.getEmail(), "b");
-    assertEquals(author.getUri().toString(), "c");
+    assertEquals("a", author.getName());
+    assertEquals( "b", author.getEmail());
+    assertEquals( "c", author.getUri().toString());
     Category category = factory.newCategory();
     assertNotNull(category);
     category = factory.newCategory();
@@ -293,25 +293,25 @@ public class FOMTest {
     category.setTerm("b");
     category.setLabel("c");
     assertNotNull(category);
-    assertEquals(category.getScheme().toString(), "a");
-    assertEquals(category.getTerm(), "b");
-    assertEquals(category.getLabel(), "c");
+    assertEquals( "a", category.getScheme().toString());
+    assertEquals( "b", category.getTerm());
+    assertEquals( "c", category.getLabel());
     Collection collection = factory.newCollection();
     assertNotNull(collection);
     Content content = factory.newContent(Content.Type.TEXT);
     assertNotNull(content);
-    assertEquals(content.getContentType(), Content.Type.TEXT);
+    assertEquals( Content.Type.TEXT, content.getContentType());
     content = factory.newContent(Content.Type.HTML);
-    assertEquals(content.getContentType(), Content.Type.HTML);
+    assertEquals( Content.Type.HTML, content.getContentType());
     content = factory.newContent(Content.Type.XHTML);
-    assertEquals(content.getContentType(), Content.Type.XHTML);
+    assertEquals( Content.Type.XHTML, content.getContentType());
     content = factory.newContent(Content.Type.MEDIA);
-    assertEquals(content.getContentType(), Content.Type.MEDIA);
+    assertEquals( Content.Type.MEDIA, content.getContentType());
     content = factory.newContent(Content.Type.XML);
-    assertEquals(content.getContentType(), Content.Type.XML);
+    assertEquals( Content.Type.XML, content.getContentType());
     content = factory.newContent(new MimeType("text/foo"));
-    assertEquals(content.getContentType(), Content.Type.MEDIA);
-    assertEquals(content.getMimeType().toString(), "text/foo");
+    assertEquals( Content.Type.MEDIA, content.getContentType());
+    assertEquals( "text/foo", content.getMimeType().toString());
     Person contributor = factory.newContributor();
     assertNotNull(contributor);
     contributor = factory.newContributor();
@@ -319,17 +319,17 @@ public class FOMTest {
     contributor.setEmail("b");
     contributor.setUri("c");
     assertNotNull(contributor);
-    assertEquals(contributor.getName(),"a");
-    assertEquals(contributor.getEmail(), "b");
-    assertEquals(contributor.getUri().toString(), "c");
+    assertEquals("a", contributor.getName());
+    assertEquals( "b", contributor.getEmail());
+    assertEquals( "c", contributor.getUri().toString());
     contributor = factory.newContributor();
     contributor.setName("a");
     contributor.setEmail("b");
     contributor.setUri("c");
     assertNotNull(contributor);
-    assertEquals(contributor.getName(),"a");
-    assertEquals(contributor.getEmail(), "b");
-    assertEquals(contributor.getUri().toString(), "c");
+    assertEquals("a", contributor.getName());
+    assertEquals( "b", contributor.getEmail());
+    assertEquals( "c", contributor.getUri().toString());
     Control control = factory.newControl();
     assertNotNull(control);
     control = factory.newControl();
@@ -338,28 +338,28 @@ public class FOMTest {
     Date now = new Date();
     DateTime dateTime = factory.newDateTime(Constants.UPDATED, null);
     dateTime.setValue(AtomDate.valueOf(now));
-    assertEquals(dateTime.getDate(), now);
+    assertEquals( now, dateTime.getDate());
     Calendar cal = Calendar.getInstance();
     dateTime = factory.newDateTime(Constants.UPDATED, null);
     dateTime.setCalendar(cal);
-    assertEquals(dateTime.getCalendar(), cal);
+    assertEquals( cal, dateTime.getCalendar());
     dateTime = factory.newDateTime(Constants.UPDATED, null);
     dateTime.setDate(now);
-    assertEquals(dateTime.getDate(), now);
+    assertEquals( now, dateTime.getDate());
     dateTime = factory.newDateTime(Constants.UPDATED, null);
     assertNotNull(dateTime);
     dateTime = factory.newDateTime(Constants.UPDATED, null);
     dateTime.setTime(now.getTime());
-    assertEquals(dateTime.getTime(), now.getTime());
+    assertEquals( now.getTime(), dateTime.getTime());
     dateTime = factory.newDateTime(Constants.UPDATED, null);
     dateTime.setString(AtomDate.format(now));
-    assertEquals(dateTime.getString(), AtomDate.format(now));
-    assertEquals(dateTime.getDate(), now);
+    assertEquals( AtomDate.format(now), dateTime.getString());
+    assertEquals( now, dateTime.getDate());
     Generator generator = factory.newDefaultGenerator();
     assertNotNull(generator);
-    assertEquals(generator.getText(), Version.APP_NAME);
-    assertEquals(generator.getVersion(), Version.VERSION);
-    assertEquals(generator.getUri().toString(), Version.URI);
+    assertEquals( Version.APP_NAME, generator.getText());
+    assertEquals( Version.VERSION, generator.getVersion());
+    assertEquals( Version.URI, generator.getUri().toString());
     Div div = factory.newDiv();
     assertNotNull(div);
     Document<?> doc = factory.newDocument();
@@ -368,14 +368,14 @@ public class FOMTest {
     assertNotNull(el);
     el = factory.newEmail();
     el.setText("a");
-    assertEquals(el.getText(), "a");
+    assertEquals( "a", el.getText());
     Entry entry = factory.newEntry();
     assertNotNull(entry);
     entry = factory.newEntry();
     assertNotNull(entry);
     Element ee = factory.newExtensionElement(new QName("urn:foo", "bar", "b"));
     assertNotNull(ee);
-    assertEquals(ee.getQName(), new QName("urn:foo", "bar", "b"));
+    assertEquals(new QName("urn:foo", "bar", "b"), ee.getQName());
     Feed feed = factory.newFeed();
     assertNotNull(feed);
     generator = factory.newGenerator();
@@ -385,60 +385,60 @@ public class FOMTest {
     generator.setVersion(Version.VERSION);
     generator.setText(Version.APP_NAME);
     assertNotNull(generator);
-    assertEquals(generator.getText(), Version.APP_NAME);
-    assertEquals(generator.getVersion(), Version.VERSION);
-    assertEquals(generator.getUri().toString(), Version.URI);
+    assertEquals( Version.APP_NAME, generator.getText());
+    assertEquals( Version.VERSION, generator.getVersion());
+    assertEquals( Version.URI, generator.getUri().toString());
     content = factory.newContent(Content.Type.HTML);
     content.setValue("a");
     assertNotNull(content);
-    assertEquals(content.getValue(), "a");
-    assertEquals(content.getContentType(), Content.Type.HTML);
+    assertEquals( "a", content.getValue());
+    assertEquals( Content.Type.HTML, content.getContentType());
     Text text = factory.newRights(Text.Type.HTML);
     text.setValue("a");
     assertNotNull(text);
-    assertEquals(text.getValue(), "a");
-    assertEquals(text.getTextType(), Text.Type.HTML);
+    assertEquals( "a", text.getValue());
+    assertEquals( Text.Type.HTML, text.getTextType());
     text = factory.newSubtitle(Text.Type.HTML);
     text.setValue("a");
-    assertEquals(text.getValue(), "a");
-    assertEquals(text.getTextType(), Text.Type.HTML);
+    assertEquals( "a", text.getValue());
+    assertEquals( Text.Type.HTML, text.getTextType());
     text = factory.newSummary(Text.Type.HTML);
     text.setValue("a");
-    assertEquals(text.getValue(), "a");
-    assertEquals(text.getTextType(), Text.Type.HTML);
+    assertEquals( "a", text.getValue());
+    assertEquals( Text.Type.HTML, text.getTextType());
     text = factory.newText(Constants.TITLE,Text.Type.HTML, null);
     text.setValue("a");
-    assertEquals(text.getValue(), "a");
-    assertEquals(text.getTextType(), Text.Type.HTML);
-    assertEquals(text.getQName(), Constants.TITLE);
+    assertEquals( "a", text.getValue());
+    assertEquals( Text.Type.HTML, text.getTextType());
+    assertEquals( Constants.TITLE, text.getQName());
     text = factory.newTitle(Text.Type.HTML);
     text.setValue("a");
-    assertEquals(text.getValue(), "a");
-    assertEquals(text.getTextType(), Text.Type.HTML);
+    assertEquals( "a", text.getValue());
+    assertEquals( Text.Type.HTML, text.getTextType());
     IRIElement iri = factory.newIcon();
     assertNotNull(iri);
     iri = factory.newIcon();
     iri.setValue("http://example.org/foo");
-    assertEquals(iri.getValue().toString(), "http://example.org/foo");
+    assertEquals( "http://example.org/foo", iri.getValue().toString());
     iri = factory.newIcon();
     iri.setValue("http://example.org/foo");
-    assertEquals(iri.getValue().toString(), "http://example.org/foo");
+    assertEquals( "http://example.org/foo", iri.getValue().toString());
     iri = factory.newID();
     assertNotNull(iri);
     iri = factory.newID();
     iri.setValue("http://example.org/foo");
-    assertEquals(iri.getValue().toString(), "http://example.org/foo");
+    assertEquals( "http://example.org/foo", iri.getValue().toString());
     iri = factory.newID();
     iri.setValue("http://example.org/foo");
-    assertEquals(iri.getValue().toString(), "http://example.org/foo");
+    assertEquals( "http://example.org/foo", iri.getValue().toString());
     iri = factory.newIRIElement(Constants.ID, null);
     assertNotNull(iri);
     iri = factory.newIRIElement(Constants.ID, null);
     iri.setValue("http://example.org/foo");
-    assertEquals(iri.getValue().toString(), "http://example.org/foo");
+    assertEquals( "http://example.org/foo", iri.getValue().toString());
     iri = factory.newIRIElement(Constants.ID, null);
     iri.setValue("http://example.org/foo");
-    assertEquals(iri.getValue().toString(), "http://example.org/foo");
+    assertEquals( "http://example.org/foo", iri.getValue().toString());
     Link link = factory.newLink();
     assertNotNull(link);
     link = factory.newLink();
@@ -448,12 +448,12 @@ public class FOMTest {
     link.setTitle("b");
     link.setHrefLang("en");
     link.setLength(10);
-    assertEquals(link.getHref().toString(), "http://example.org/foo");
-    assertEquals(link.getRel(), "a");
-    assertEquals(link.getMimeType().toString(), "text/foo");
-    assertEquals(link.getTitle(), "b");
-    assertEquals(link.getHrefLang(), "en");
-    assertEquals(link.getLength(), 10);
+    assertEquals( "http://example.org/foo", link.getHref().toString());
+    assertEquals( "a", link.getRel());
+    assertEquals( "text/foo", link.getMimeType().toString());
+    assertEquals( "b", link.getTitle());
+    assertEquals( "en", link.getHrefLang());
+    assertEquals( 10, link.getLength());
     link = factory.newLink();
     link.setHref("http://example.org/foo");
     link.setRel("a");
@@ -461,182 +461,182 @@ public class FOMTest {
     link.setTitle("b");
     link.setHrefLang("en");
     link.setLength(10);
-    assertEquals(link.getHref().toString(), "http://example.org/foo");
-    assertEquals(link.getRel(), "a");
-    assertEquals(link.getMimeType().toString(), "text/foo");
-    assertEquals(link.getTitle(), "b");
-    assertEquals(link.getHrefLang(), "en");
-    assertEquals(link.getLength(), 10);
+    assertEquals( "http://example.org/foo", link.getHref().toString());
+    assertEquals( "a", link.getRel());
+    assertEquals( "text/foo", link.getMimeType().toString());
+    assertEquals( "b", link.getTitle());
+    assertEquals( "en", link.getHrefLang());
+    assertEquals( 10, link.getLength());
     iri = factory.newLogo();
     assertNotNull(iri);
     iri = factory.newLogo();
     iri.setValue("http://example.org/foo");
-    assertEquals(iri.getValue().toString(), "http://example.org/foo");
+    assertEquals( "http://example.org/foo", iri.getValue().toString());
     iri = factory.newLogo();
     iri.setValue("http://example.org/foo");
-    assertEquals(iri.getValue().toString(), "http://example.org/foo");
+    assertEquals( "http://example.org/foo", iri.getValue().toString());
     content = factory.newContent(new MimeType("text/foo"));
     content.setSrc("foo");
     assertNotNull(content);
-    assertEquals(content.getMimeType().toString(), "text/foo");
-    assertEquals(content.getSrc().toString(), "foo");
+    assertEquals( "text/foo", content.getMimeType().toString());
+    assertEquals( "foo", content.getSrc().toString());
     content = factory.newContent(new MimeType("text/foo"));
     content.setDataHandler(new DataHandler(new ByteArrayDataSource("foo".getBytes())));
-    assertEquals(content.getValue(), "Zm9v");
-    assertEquals(content.getContentType(), Content.Type.MEDIA);
+    assertEquals( "Zm9v", content.getValue());
+    assertEquals( Content.Type.MEDIA, content.getContentType());
     el = factory.newName();
     assertNotNull(el);
     el = factory.newName();
     el.setText("a");
-    assertEquals(el.getText(), "a");
+    assertEquals( "a", el.getText());
     Parser parser = factory.newParser();
     assertNotNull(parser);
     Person person = factory.newPerson(Constants.AUTHOR, null);
     assertNotNull(person);
-    assertEquals(person.getQName(), Constants.AUTHOR);
+    assertEquals( Constants.AUTHOR, person.getQName());
     person = factory.newPerson(Constants.AUTHOR, null);
     person.setName("a");
     person.setEmail("b");
     person.setUri("c");
-    assertEquals(person.getName(),"a");
-    assertEquals(person.getEmail(), "b");
-    assertEquals(person.getUri().toString(), "c");
+    assertEquals("a", person.getName());
+    assertEquals( "b", person.getEmail());
+    assertEquals( "c", person.getUri().toString());
     person = factory.newPerson(Constants.AUTHOR, null);
     person.setName("a");
     person.setEmail("b");
     person.setUri("c");
-    assertEquals(person.getName(),"a");
-    assertEquals(person.getEmail(), "b");
-    assertEquals(person.getUri().toString(), "c");
+    assertEquals("a", person.getName());
+    assertEquals( "b", person.getEmail());
+    assertEquals( "c", person.getUri().toString());
     now = new Date();
     dateTime = factory.newPublished();
     dateTime.setValue(AtomDate.valueOf(now));
-    assertEquals(dateTime.getDate(), now);
+    assertEquals( now, dateTime.getDate());
     cal = Calendar.getInstance();
     dateTime = factory.newPublished();
     dateTime.setCalendar(cal);
-    assertEquals(dateTime.getCalendar(), cal);
+    assertEquals( cal, dateTime.getCalendar());
     dateTime = factory.newPublished();
     dateTime.setDate(now);
-    assertEquals(dateTime.getDate(), now);
+    assertEquals( now, dateTime.getDate());
     dateTime = factory.newPublished();
     assertNotNull(dateTime);
     dateTime = factory.newPublished();
     dateTime.setTime(now.getTime());
-    assertEquals(dateTime.getTime(), now.getTime());
+    assertEquals( now.getTime(), dateTime.getTime());
     dateTime = factory.newPublished();
     dateTime.setString(AtomDate.format(now));
-    assertEquals(dateTime.getString(), AtomDate.format(now));
-    assertEquals(dateTime.getDate(), now);
+    assertEquals( AtomDate.format(now), dateTime.getString());
+    assertEquals( now, dateTime.getDate());
     Service service = factory.newService();
     assertNotNull(service);
     Source source = factory.newSource();
     assertNotNull(source);
     el = factory.newElement(Constants.NAME);
     assertNotNull(el);
-    assertEquals(el.getQName(), Constants.NAME);
+    assertEquals( Constants.NAME, el.getQName());
     el = factory.newElement(Constants.NAME);
     el.setText("a");
     assertNotNull(el);
-    assertEquals(el.getQName(), Constants.NAME);
-    assertEquals(el.getText(), "a");
+    assertEquals( Constants.NAME, el.getQName());
+    assertEquals( "a", el.getText());
     text = factory.newText(Constants.TITLE, Text.Type.TEXT);
     assertNotNull(text);
-    assertEquals(text.getTextType(), Text.Type.TEXT);
+    assertEquals( Text.Type.TEXT, text.getTextType());
     text = factory.newRights();
     text.setValue("a");
-    assertEquals(text.getValue(), "a");
-    assertEquals(text.getTextType(), Text.Type.TEXT);
+    assertEquals( "a", text.getValue());
+    assertEquals( Text.Type.TEXT, text.getTextType());
     text = factory.newSubtitle();
     text.setValue("a");
-    assertEquals(text.getValue(), "a");
-    assertEquals(text.getTextType(), Text.Type.TEXT);
+    assertEquals( "a", text.getValue());
+    assertEquals( Text.Type.TEXT, text.getTextType());
     text = factory.newSummary();
     text.setValue("a");
-    assertEquals(text.getValue(), "a");
-    assertEquals(text.getTextType(), Text.Type.TEXT);
+    assertEquals( "a", text.getValue());
+    assertEquals( Text.Type.TEXT, text.getTextType());
     text = factory.newText(Constants.TITLE, Text.Type.TEXT,null);
     text.setValue("a");
-    assertEquals(text.getQName(), Constants.TITLE);
-    assertEquals(text.getValue(), "a");
-    assertEquals(text.getTextType(), Text.Type.TEXT);
+    assertEquals( Constants.TITLE, text.getQName());
+    assertEquals( "a", text.getValue());
+    assertEquals( Text.Type.TEXT, text.getTextType());
     text = factory.newTitle();
     text.setValue("a");
-    assertEquals(text.getValue(), "a");
-    assertEquals(text.getTextType(), Text.Type.TEXT);
+    assertEquals( "a", text.getValue());
+    assertEquals( Text.Type.TEXT, text.getTextType());
     content = factory.newContent(Content.Type.TEXT);
     content.setValue("a");
-    assertEquals(content.getValue(), "a");
-    assertEquals(content.getContentType(), Content.Type.TEXT);
+    assertEquals( "a", content.getValue());
+    assertEquals( Content.Type.TEXT, content.getContentType());
     now = new Date();
     dateTime = factory.newUpdated();
     dateTime.setValue(AtomDate.valueOf(now));
-    assertEquals(dateTime.getDate(), now);
+    assertEquals( now, dateTime.getDate());
     cal = Calendar.getInstance();
     dateTime = factory.newUpdated();
     dateTime.setCalendar(cal);
-    assertEquals(dateTime.getCalendar(), cal);
+    assertEquals( cal, dateTime.getCalendar());
     dateTime = factory.newUpdated();
     dateTime.setDate(now);
-    assertEquals(dateTime.getDate(), now);
+    assertEquals( now, dateTime.getDate());
     dateTime = factory.newUpdated();
     assertNotNull(dateTime);
     dateTime = factory.newUpdated();
     dateTime.setTime(now.getTime());
-    assertEquals(dateTime.getTime(), now.getTime());
+    assertEquals( now.getTime(), dateTime.getTime());
     dateTime = factory.newUpdated();
     dateTime.setString(AtomDate.format(now));
-    assertEquals(dateTime.getString(), AtomDate.format(now));
-    assertEquals(dateTime.getDate(), now);
+    assertEquals( AtomDate.format(now), dateTime.getString());
+    assertEquals( now, dateTime.getDate());
     iri = factory.newUri();
     assertNotNull(iri);
     iri = factory.newUri();
     iri.setValue("http://example.org/foo");
-    assertEquals(iri.getValue().toString(), "http://example.org/foo");
+    assertEquals( "http://example.org/foo", iri.getValue().toString());
     iri = factory.newUri();
     iri.setValue("http://example.org/foo");
-    assertEquals(iri.getValue().toString(), "http://example.org/foo");
+    assertEquals( "http://example.org/foo", iri.getValue().toString());
     Workspace workspace = factory.newWorkspace();
     assertNotNull(workspace);
     div = factory.newDiv();
     content = factory.newContent(Content.Type.XHTML);
     content.setValueElement(div);
     assertNotNull(content);
-    assertEquals(content.getContentType(), Content.Type.XHTML);
+    assertEquals( Content.Type.XHTML, content.getContentType());
     assertNotNull(content.getValueElement());
-    assertEquals(content.getValueElement(), div);
+    assertEquals( div, content.getValueElement());
     content = factory.newContent(new MimeType("application/xml"));
     content.setValueElement(div);
     assertNotNull(content);
-    assertEquals(content.getContentType(), Content.Type.XML);
+    assertEquals( Content.Type.XML, content.getContentType());
     assertNotNull(content.getValueElement());
-    assertEquals(content.getValueElement(), div);
+    assertEquals( div, content.getValueElement());
     text = factory.newRights();
     text.setValueElement(div);
     assertNotNull(text);
-    assertEquals(text.getTextType(), Text.Type.XHTML);
-    assertEquals(text.getValueElement(), div);
+    assertEquals( Text.Type.XHTML, text.getTextType());
+    assertEquals( div, text.getValueElement());
     text = factory.newSubtitle();
     text.setValueElement(div);
     assertNotNull(text);
-    assertEquals(text.getTextType(), Text.Type.XHTML);
-    assertEquals(text.getValueElement(), div);
+    assertEquals( Text.Type.XHTML, text.getTextType());
+    assertEquals( div, text.getValueElement());
     text = factory.newSummary();
     text.setValueElement(div);
     assertNotNull(text);
-    assertEquals(text.getTextType(), Text.Type.XHTML);
-    assertEquals(text.getValueElement(), div);
+    assertEquals( Text.Type.XHTML, text.getTextType());
+    assertEquals( div, text.getValueElement());
     text = factory.newText(Constants.TITLE, null);
     text.setValueElement(div);
     assertNotNull(text);
-    assertEquals(text.getQName(), Constants.TITLE);
-    assertEquals(text.getTextType(), Text.Type.XHTML);
-    assertEquals(text.getValueElement(), div);
+    assertEquals( Constants.TITLE, text.getQName());
+    assertEquals( Text.Type.XHTML, text.getTextType());
+    assertEquals( div, text.getValueElement());
     text = factory.newTitle();
     text.setValueElement(div);
     assertNotNull(text);
-    assertEquals(text.getTextType(), Text.Type.XHTML);
-    assertEquals(text.getValueElement(), div);
+    assertEquals( Text.Type.XHTML, text.getTextType());
+    assertEquals( div, text.getValueElement());
   }
   
   @Test
@@ -672,30 +672,30 @@ public class FOMTest {
     Document<Feed> doc = getParser().parse(in);
     feed = doc.getRoot();
     
-    assertEquals(feed.getLanguage(), "en-US");
-    assertEquals(feed.getBaseUri().toString(), "http://example.org");
-    assertEquals(feed.getTitle(), "Example Feed");
-    assertEquals(feed.getAlternateLink().getHref().toString(), "http://example.org/");
-    assertEquals(feed.getAuthor().getName(), "John Doe");
-    assertEquals(feed.getId().toString(), "urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6");
-    assertEquals(feed.getContributors().get(0).getName(), "Bob Jones");
-    assertEquals(feed.getCategories().get(0).getTerm(), "example");
+    assertEquals( "en-US", feed.getLanguage());
+    assertEquals( "http://example.org", feed.getBaseUri().toString());
+    assertEquals( "Example Feed", feed.getTitle());
+    assertEquals( "http://example.org/", feed.getAlternateLink().getHref().toString());
+    assertEquals( "John Doe", feed.getAuthor().getName());
+    assertEquals( "urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6", feed.getId().toString());
+    assertEquals( "Bob Jones", feed.getContributors().get(0).getName());
+    assertEquals( "example", feed.getCategories().get(0).getTerm());
     
-    assertEquals(feed.getEntries().size(), 2);
+    assertEquals( 2, feed.getEntries().size());
     entry = feed.getFirstChild(Constants.ENTRY);
     assertNotNull(entry);
-    assertEquals(entry.getTitle(), "re: Atom-Powered Robots Run Amok");
-    assertEquals(entry.getAlternateLink().getHref().toString(), "/2003/12/13/atom03/1");
-    assertEquals(entry.getAlternateLink().getResolvedHref().toString(), "http://example.org/2003/12/13/atom03/1");
-    assertEquals(entry.getId().toString(), "urn:uuid:1225c695-cfb8-4ebb-aaaa-80cb323feb5b");
-    assertEquals(entry.getSummary(), "A response");
+    assertEquals( "re: Atom-Powered Robots Run Amok", entry.getTitle());
+    assertEquals( "/2003/12/13/atom03/1", entry.getAlternateLink().getHref().toString());
+    assertEquals( "http://example.org/2003/12/13/atom03/1", entry.getAlternateLink().getResolvedHref().toString());
+    assertEquals( "urn:uuid:1225c695-cfb8-4ebb-aaaa-80cb323feb5b", entry.getId().toString());
+    assertEquals( "A response", entry.getSummary());
     
     entry = entry.getNextSibling(Constants.ENTRY);
     assertNotNull(entry);
-    assertEquals(entry.getTitle(), "Atom-Powered Robots Run Amok");
-    assertEquals(entry.getAlternateLink().getHref().toString(), "http://example.org/2003/12/13/atom03");
-    assertEquals(entry.getId().toString(), "urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a");
-    assertEquals(entry.getSummary(), "Some text.");
+    assertEquals( "Atom-Powered Robots Run Amok", entry.getTitle());
+    assertEquals( "http://example.org/2003/12/13/atom03", entry.getAlternateLink().getHref().toString());
+    assertEquals( "urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a", entry.getId().toString());
+    assertEquals( "Some text.", entry.getSummary());
   }
   
   @Test
@@ -711,7 +711,7 @@ public class FOMTest {
       ByteArrayOutputStream out = new ByteArrayOutputStream();
       Result result = new StreamResult(out);
       transformer.transform(feedSource, result);
-      assertEquals(out.toString(), "This is a test urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6");
+      assertEquals( "This is a test urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6", out.toString());
       
       // Apply an XSLT transform to XML in the content element
       xslt = getParser().parse(FOMTest.class.getResourceAsStream("/content.xslt"));
@@ -724,7 +724,7 @@ public class FOMTest {
       out = new ByteArrayOutputStream();
       result = new StreamResult(out);
       transformer.transform(contentSource, result);
-      assertEquals(out.toString(), "This is a test test");
+      assertEquals( "This is a test test", out.toString());
     } catch (Exception exception) {
       // TrAX is likely not configured, skip the test
     }
@@ -738,7 +738,7 @@ public class FOMTest {
     Parser parser = abdera.getParser();
     Document<Entry> doc = parser.parse(in);
     Entry entry = (Entry)(doc.getRoot().clone());
-    assertEquals(entry.getContentType(), Content.Type.HTML);
+    assertEquals( Content.Type.HTML, entry.getContentType());
   }
   
   @Test
@@ -754,12 +754,12 @@ public class FOMTest {
     Abdera abdera = new Abdera();
     Entry entry = abdera.newEntry();
     entry.setLanguage("en-US");
-    assertEquals(entry.getLanguage(),"en-US");
+    assertEquals("en-US", entry.getLanguage());
     Lang lang = entry.getLanguageTag();
     assertNotNull(lang);
-    assertEquals(lang.getLanguage().getName(),"en");
-    assertEquals(lang.getRegion().getName(), "US");
-    assertEquals(lang.getLocale(), java.util.Locale.US);
+    assertEquals("en", lang.getLanguage().getName());
+    assertEquals( "US", lang.getRegion().getName());
+    assertEquals( java.util.Locale.US, lang.getLocale());
   }
   
   @Test
@@ -772,7 +772,7 @@ public class FOMTest {
       new ByteArrayInputStream("<a><b><c/></b></a>".getBytes()));
     Element foo = foodoc.getRoot();
     entry.setContent(foo, "application/foo+xml");
-    assertEquals(entry.getContentElement().getValueElement(),foo);
+    assertEquals(foo, entry.getContentElement().getValueElement());
     
   }
   

Modified: abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/FeedParserTest.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/FeedParserTest.java?rev=944861&r1=944860&r2=944861&view=diff
==============================================================================
--- abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/FeedParserTest.java (original)
+++ abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/FeedParserTest.java Sun May 16 15:14:12 2010
@@ -54,7 +54,7 @@ public class FeedParserTest extends Base
     Feed feed = doc.getRoot();
     Entry entry = feed.getEntries().get(0);
     Person person = entry.getAuthor();
-    assertEquals(person.getEmail(), "me@example.com");
+    assertEquals( "me@example.com", person.getEmail());
   }
   
   @Test public void testEntryAuthorName() throws Exception {
@@ -62,7 +62,7 @@ public class FeedParserTest extends Base
     Feed feed = doc.getRoot();
     Entry entry = feed.getEntries().get(0);
     Person person = entry.getAuthor();
-    assertEquals(person.getName(), "Example author");    
+    assertEquals( "Example author", person.getName());    
   }
   
   @Test public void testEntryContentBase64() throws Exception {
@@ -70,13 +70,13 @@ public class FeedParserTest extends Base
     Feed feed = doc.getRoot();
     Entry entry = feed.getEntries().get(0);
     Content mediaContent = entry.getContentElement();
-    assertEquals(mediaContent.getMimeType().toString(), "application/octet-stream");
+    assertEquals( "application/octet-stream", mediaContent.getMimeType().toString());
     DataHandler dataHandler = mediaContent.getDataHandler();
     InputStream in = (ByteArrayInputStream) dataHandler.getContent();
     ByteArrayOutputStream baos = new ByteArrayOutputStream();
     int n = -1;
     while ((n = in.read()) > -1) { baos.write(n); }
-    assertEquals(baos.toString(), "Example <b>Atom</b>");
+    assertEquals( "Example <b>Atom</b>", baos.toString());
   }
   
   @Test public void testEntryContentBase642() throws Exception {
@@ -84,13 +84,13 @@ public class FeedParserTest extends Base
     Feed feed = doc.getRoot();
     Entry entry = feed.getEntries().get(0);
     Content mediaContent = entry.getContentElement();
-    assertEquals(mediaContent.getMimeType().toString(), "application/octet-stream");
+    assertEquals( "application/octet-stream", mediaContent.getMimeType().toString());
     DataHandler dataHandler = mediaContent.getDataHandler();
     InputStream in = (ByteArrayInputStream) dataHandler.getContent();
     ByteArrayOutputStream baos = new ByteArrayOutputStream();
     int n = -1;
     while ((n = in.read()) > -1) { baos.write(n); }
-    assertEquals(baos.toString(), "<p>History of the &lt;blink&gt; tag</p>");
+    assertEquals( "<p>History of the &lt;blink&gt; tag</p>", baos.toString());
   }
   
   



Mime
View raw message