abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r940380 - in /abdera/java/trunk/core/src/test/java/org/apache/abdera: model/AtomDateTest.java test/core/CoreTest.java test/core/EntityTagTest.java test/core/TestSuite.java util/filter/AbstractListParseFilterTest.java
Date Mon, 03 May 2010 06:44:53 GMT
Author: antelder
Date: Mon May  3 06:44:53 2010
New Revision: 940380

URL: http://svn.apache.org/viewvc?rev=940380&view=rev
Log:
ABDERA-102: Apply patch from Christine Koppelt for Unit tests equality assertions, params
in wrong order

Removed:
    abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/TestSuite.java
Modified:
    abdera/java/trunk/core/src/test/java/org/apache/abdera/model/AtomDateTest.java
    abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java
    abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/EntityTagTest.java
    abdera/java/trunk/core/src/test/java/org/apache/abdera/util/filter/AbstractListParseFilterTest.java

Modified: abdera/java/trunk/core/src/test/java/org/apache/abdera/model/AtomDateTest.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/core/src/test/java/org/apache/abdera/model/AtomDateTest.java?rev=940380&r1=940379&r2=940380&view=diff
==============================================================================
--- abdera/java/trunk/core/src/test/java/org/apache/abdera/model/AtomDateTest.java (original)
+++ abdera/java/trunk/core/src/test/java/org/apache/abdera/model/AtomDateTest.java Mon May
 3 06:44:53 2010
@@ -1,6 +1,9 @@
 package org.apache.abdera.model;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotSame;
 
 import java.util.Date;
 

Modified: abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java?rev=940380&r1=940379&r2=940380&view=diff
==============================================================================
--- abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java (original)
+++ abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java Mon May
 3 06:44:53 2010
@@ -17,6 +17,10 @@
 */
 package org.apache.abdera.test.core;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
@@ -25,8 +29,6 @@ import java.io.StringReader;
 import java.util.Calendar;
 import java.util.Date;
 
-import junit.framework.Assert;
-
 import org.apache.abdera.i18n.iri.IRI;
 import org.apache.abdera.i18n.text.io.CompressionUtil;
 import org.apache.abdera.model.AtomDate;
@@ -41,43 +43,41 @@ import org.easymock.EasyMock;
 import org.junit.Test;
 
 
-public class CoreTest 
-  extends Assert 
-  implements Constants {
+public class CoreTest implements Constants {
 
   @Test
   public void testDefaultConfigurationProperties() {
     Configuration config = new AbderaConfiguration();
-    assertEquals(
-      config.getConfigurationOption(CONFIG_FACTORY, DEFAULT_FACTORY), 
-      "org.apache.abdera.parser.stax.FOMFactory");
-    assertEquals(
-      config.getConfigurationOption(CONFIG_PARSER, DEFAULT_PARSER),
-      "org.apache.abdera.parser.stax.FOMParser");
-    assertEquals(
-      config.getConfigurationOption(CONFIG_XPATH, DEFAULT_XPATH),
-      "org.apache.abdera.parser.stax.FOMXPath");
+    assertEquals("org.apache.abdera.parser.stax.FOMFactory",
+      config.getConfigurationOption(CONFIG_FACTORY, DEFAULT_FACTORY)
+      );
+    assertEquals("org.apache.abdera.parser.stax.FOMParser",
+      config.getConfigurationOption(CONFIG_PARSER, DEFAULT_PARSER)
+      );
+    assertEquals("org.apache.abdera.parser.stax.FOMXPath",
+      config.getConfigurationOption(CONFIG_XPATH, DEFAULT_XPATH)
+      );
   }
   
   @Test
   public void testUriNormalization() {
     try {
-      assertEquals(
+      assertEquals("http://www.example.org/Bar/%3F/foo/",
         IRI.normalizeString(
-          "HTTP://www.EXAMPLE.org:80/foo/../Bar/%3f/./foo/."), 
-        "http://www.example.org/Bar/%3F/foo/");
-      assertEquals(
+          "HTTP://www.EXAMPLE.org:80/foo/../Bar/%3f/./foo/.") 
+        );
+      assertEquals("https://www.example.org/Bar/%3F/foo/",
           IRI.normalizeString(
-          "HTTPs://www.EXAMPLE.org:443/foo/../Bar/%3f/./foo/."), 
-        "https://www.example.org/Bar/%3F/foo/");
-      assertEquals(
+          "HTTPs://www.EXAMPLE.org:443/foo/../Bar/%3f/./foo/.") 
+        );
+      assertEquals("http://www.example.org:81/Bar/%3F/foo/",
         IRI.normalizeString(
-          "HTTP://www.EXAMPLE.org:81/foo/../Bar/%3f/./foo/."), 
-        "http://www.example.org:81/Bar/%3F/foo/");
-      assertEquals(
+          "HTTP://www.EXAMPLE.org:81/foo/../Bar/%3f/./foo/.")
+        );
+      assertEquals("https://www.example.org:444/Bar/%3F/foo/",
         IRI.normalizeString(
-          "HTTPs://www.EXAMPLE.org:444/foo/../Bar/%3f/./foo/."), 
-        "https://www.example.org:444/Bar/%3F/foo/");
+          "HTTPs://www.EXAMPLE.org:444/foo/../Bar/%3f/./foo/.") 
+        );
     } catch (Exception e) {
       e.printStackTrace();
     }

Modified: abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/EntityTagTest.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/EntityTagTest.java?rev=940380&r1=940379&r2=940380&view=diff
==============================================================================
--- abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/EntityTagTest.java (original)
+++ abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/EntityTagTest.java Mon
May  3 06:44:53 2010
@@ -17,13 +17,14 @@
 */
 package org.apache.abdera.test.core;
 
-import junit.framework.Assert;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 import org.apache.abdera.util.EntityTag;
 import org.junit.Test;
 
-public class EntityTagTest 
-  extends Assert {
+public class EntityTagTest {
 
   @Test
   public void testEntityTag() throws Exception {
@@ -45,14 +46,14 @@ public class EntityTagTest 
     assertFalse(etags[2].isWild());
     assertFalse(etags[3].isWeak());
     assertTrue(etags[3].isWild());
-    assertEquals(etags[0].getTag(),"hello");
-    assertEquals(etags[1].getTag(),"hello");
-    assertEquals(etags[2].getTag(),"hello");
-    assertEquals(etags[3].getTag(),"*");
-    assertEquals(etags[0].toString(),tags[1]);
-    assertEquals(etags[1].toString(),tags[1]);
-    assertEquals(etags[2].toString(),tags[2]);
-    assertEquals(etags[3].toString(),tags[3]);
+    assertEquals("hello", etags[0].getTag());
+    assertEquals("hello", etags[1].getTag());
+    assertEquals("hello", etags[2].getTag());
+    assertEquals("*", etags[3].getTag());
+    assertEquals(tags[1], etags[0].toString());
+    assertEquals(tags[1], etags[1].toString());
+    assertEquals(tags[2], etags[2].toString());
+    assertEquals(tags[3], etags[3].toString());
     
     assertTrue(EntityTag.matches(etags[3], etags[0]));
     assertTrue(EntityTag.matches(etags[3], etags[1]));
@@ -68,12 +69,12 @@ public class EntityTagTest 
     assertTrue(EntityTag.matchesAny(etags[2], new EntityTag[] {etags[0], etags[1], etags[3]}));
     
     java.util.Arrays.sort(etags);
-    assertEquals(etags[0].toString(),tags[3]);
-    assertEquals(etags[1].toString(),tags[1]);
-    assertEquals(etags[2].toString(),tags[1]);
-    assertEquals(etags[3].toString(),tags[2]);
+    assertEquals(tags[3],etags[0].toString());
+    assertEquals(tags[1],etags[1].toString());
+    assertEquals(tags[1],etags[2].toString());
+    assertEquals(tags[2],etags[3].toString());
     EntityTag etag = EntityTag.generate("a","b","c","d");
-    assertEquals(etag.toString(),"\"e2fc714c4727ee9395f324cd2e7f331f\"");
+    assertEquals("\"e2fc714c4727ee9395f324cd2e7f331f\"", etag.toString());
   }
   
 }

Modified: abdera/java/trunk/core/src/test/java/org/apache/abdera/util/filter/AbstractListParseFilterTest.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/core/src/test/java/org/apache/abdera/util/filter/AbstractListParseFilterTest.java?rev=940380&r1=940379&r2=940380&view=diff
==============================================================================
--- abdera/java/trunk/core/src/test/java/org/apache/abdera/util/filter/AbstractListParseFilterTest.java
(original)
+++ abdera/java/trunk/core/src/test/java/org/apache/abdera/util/filter/AbstractListParseFilterTest.java
Mon May  3 06:44:53 2010
@@ -17,7 +17,7 @@
 */
 package org.apache.abdera.util.filter;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertTrue;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;



Mime
View raw message