abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ckopp...@apache.org
Subject svn commit: r944803 - in /abdera/java/trunk/client/src/test/java/org/apache/abdera/test/client: app/AppTest.java cache/CacheTest.java util/MultipartRelatedRequestEntityTest.java
Date Sun, 16 May 2010 11:32:12 GMT
Author: ckoppelt
Date: Sun May 16 11:32:11 2010
New Revision: 944803

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

Modified:
    abdera/java/trunk/client/src/test/java/org/apache/abdera/test/client/app/AppTest.java
    abdera/java/trunk/client/src/test/java/org/apache/abdera/test/client/cache/CacheTest.java
    abdera/java/trunk/client/src/test/java/org/apache/abdera/test/client/util/MultipartRelatedRequestEntityTest.java

Modified: abdera/java/trunk/client/src/test/java/org/apache/abdera/test/client/app/AppTest.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/client/src/test/java/org/apache/abdera/test/client/app/AppTest.java?rev=944803&r1=944802&r2=944803&view=diff
==============================================================================
--- abdera/java/trunk/client/src/test/java/org/apache/abdera/test/client/app/AppTest.java
(original)
+++ abdera/java/trunk/client/src/test/java/org/apache/abdera/test/client/app/AppTest.java
Sun May 16 11:32:11 2010
@@ -18,9 +18,9 @@
 package org.apache.abdera.test.client.app;
 
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
@@ -36,8 +36,6 @@ import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import junit.framework.Assert;
-
 import org.apache.abdera.Abdera;
 import org.apache.abdera.factory.Factory;
 import org.apache.abdera.i18n.iri.IRI;
@@ -387,31 +385,31 @@ public class AppTest {
     assertTrue(options.is5xxRequestException());
     
     options.setAccept("text/plain");
-    assertEquals(options.getAccept(),"text/plain");
+    assertEquals("text/plain", options.getAccept());
     
     options.setAcceptCharset("UTF-8");
-    assertEquals(options.getAcceptCharset(), "UTF-8");
+    assertEquals("UTF-8", options.getAcceptCharset());
     
     options.setAcceptEncoding("gzip");
-    assertEquals(options.getAcceptEncoding(), "gzip");
+    assertEquals("gzip", options.getAcceptEncoding());
     
     options.setAcceptLanguage("en-US");
-    assertEquals(options.getAcceptLanguage(), "en-US");
+    assertEquals("en-US", options.getAcceptLanguage());
     
     options.setAuthorization("auth");
-    assertEquals(options.getAuthorization(), "auth");
+    assertEquals("auth", options.getAuthorization());
     
     options.setCacheControl("no-cache");
-    assertEquals(options.getCacheControl(), "no-cache");
+    assertEquals("no-cache", options.getCacheControl());
     
     options.setContentType("text/plain");
     assertTrue(MimeTypeHelper.isMatch(options.getContentType(), new MimeType("text/plain")));
     
     options.setEncodedHeader("foo", "UTF-8", "bar");
-    assertEquals(options.getDecodedHeader("foo"),"bar");
+    assertEquals("bar", options.getDecodedHeader("foo"));
     
     options.setHeader("foo", "bar");
-    assertEquals(options.getHeader("foo"),"bar");
+    assertEquals("bar", options.getHeader("foo"));
     
     options.setIfMatch("testing");
     assertTrue(EntityTag.matchesAny(new EntityTag("testing"), options.getIfMatch()));
@@ -420,7 +418,7 @@ public class AppTest {
     assertTrue(EntityTag.matchesAny(new EntityTag("testing"), options.getIfNoneMatch()));
     
     options.setSlug("This is the slug");
-    assertEquals(options.getSlug(),"This is the slug");
+    assertEquals("This is the slug", options.getSlug());
     
     options.setUsePostOverride(true);
     assertTrue(options.isUsePostOverride());
@@ -695,18 +693,18 @@ public class AppTest {
     assertTrue(tag2.isWeak());
     assertFalse(EntityTag.matches(tag1, tag2));
     assertFalse(EntityTag.matchesAny(tag1, new EntityTag[] {tag2}));
-    assertEquals(tag1.toString(), "\"tag\"");
-    assertEquals(tag2.toString(), "W/\"tag\"");
+    assertEquals("\"tag\"", tag1.toString());
+    assertEquals("W/\"tag\"", tag2.toString());
     tag1 = EntityTag.parse("\"tag\"");
     assertFalse(tag1.isWeak());
-    assertEquals(tag1.getTag(), "tag");
+    assertEquals("tag", tag1.getTag());
     tag2 = EntityTag.parse("W/\"tag\"");
     assertTrue(tag2.isWeak());
-    assertEquals(tag2.getTag(), "tag");    
+    assertEquals("tag", tag2.getTag());    
     EntityTag[] tags = EntityTag.parseTags("\"tag1\", W/\"tag2\"");
     assertFalse(tags[0].isWeak());
-    assertEquals(tags[0].getTag(), "tag1");
+    assertEquals("tag1", tags[0].getTag());
     assertTrue(tags[1].isWeak());
-    assertEquals(tags[1].getTag(), "tag2");
+    assertEquals("tag2", tags[1].getTag());
   }
 }

Modified: abdera/java/trunk/client/src/test/java/org/apache/abdera/test/client/cache/CacheTest.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/client/src/test/java/org/apache/abdera/test/client/cache/CacheTest.java?rev=944803&r1=944802&r2=944803&view=diff
==============================================================================
--- abdera/java/trunk/client/src/test/java/org/apache/abdera/test/client/cache/CacheTest.java
(original)
+++ abdera/java/trunk/client/src/test/java/org/apache/abdera/test/client/cache/CacheTest.java
Sun May 16 11:32:11 2010
@@ -308,7 +308,7 @@ public class CacheTest {
     ClientResponse response = abderaClient.get(CHECK_MUST_REVALIDATE, options);
   
     String resp1 = getResponse(response);
-    assertEquals(resp1, "1");
+    assertEquals("1", resp1);
     
     // Should be revalidated and use the cache
     options.setHeader("x-reqnum", "2");
@@ -316,12 +316,12 @@ public class CacheTest {
     assertTrue(response instanceof CachedResponse);
     
     String resp2 = getResponse(response);
-    assertEquals(resp2, "1");
+    assertEquals("1", resp2);
     
     // Should be revalidated and return a 404
     options.setHeader("x-reqnum", "3");
     response = abderaClient.get(CHECK_MUST_REVALIDATE, options);  
-    assertEquals(response.getStatus(), 404);
+    assertEquals(404, response.getStatus());
     response.release();
 
   }
@@ -343,7 +343,7 @@ public class CacheTest {
     String resp1 = getResponse(response);
     
     response.release();
-    assertEquals(resp1, "1");
+    assertEquals("1", resp1);
     
     // calling a method that could change state on the server should invalidate the cache
     options = getRequestOptions(abderaClient,2);
@@ -373,7 +373,7 @@ public class CacheTest {
   
     resp1 = getResponse(response);
     response.release();
-    assertEquals(resp1, "3");
+    assertEquals("3", resp1);
   }
   
   private void _requestCacheInvalidation(int type) throws Exception {
@@ -382,7 +382,7 @@ public class CacheTest {
     RequestOptions options = getRequestOptions(abderaClient,1);
     ClientResponse response = abderaClient.get(CHECK_CACHE_INVALIDATE, options);  
     String resp1 = getResponse(response);
-    assertEquals(resp1, "1");
+    assertEquals("1", resp1);
     
     // Should not use the cache
     options = getRequestOptions(abderaClient,2);
@@ -394,7 +394,7 @@ public class CacheTest {
     response = abderaClient.get(CHECK_CACHE_INVALIDATE, options);
   
     String resp2 = getResponse(response);
-    assertEquals(resp2, "2");
+    assertEquals("2", resp2);
     
     // Should use the cache
     options =getRequestOptions(abderaClient,3);
@@ -406,7 +406,7 @@ public class CacheTest {
     response = abderaClient.get(CHECK_CACHE_INVALIDATE, options);
   
     String resp3 = getResponse(response);
-    assertEquals(resp3, "2");
+    assertEquals("2", resp3);
   }
   
   private void _responseNoCache(int type) throws Exception {
@@ -417,7 +417,7 @@ public class CacheTest {
     ClientResponse response = abderaClient.get(CHECK_NO_CACHE, options);
   
     String resp1 = getResponse(response);
-    assertEquals(resp1, "1");
+    assertEquals("1", resp1);
     
     // Should not use the cache
     
@@ -426,7 +426,7 @@ public class CacheTest {
     response = abderaClient.get(CHECK_NO_CACHE, options);
   
     String resp2 = getResponse(response);
-    assertEquals(resp2, "2");
+    assertEquals("2", resp2);
     
     // Should use the cache
     options = getRequestOptions(abderaClient,3);
@@ -434,7 +434,7 @@ public class CacheTest {
     response = abderaClient.get(CHECK_NO_CACHE, options);
   
     String resp3 = getResponse(response);
-    assertEquals(resp3, "3");
+    assertEquals("3", resp3);
   }
   
   private static String getResponse(ClientResponse response) throws IOException {

Modified: abdera/java/trunk/client/src/test/java/org/apache/abdera/test/client/util/MultipartRelatedRequestEntityTest.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/client/src/test/java/org/apache/abdera/test/client/util/MultipartRelatedRequestEntityTest.java?rev=944803&r1=944802&r2=944803&view=diff
==============================================================================
--- abdera/java/trunk/client/src/test/java/org/apache/abdera/test/client/util/MultipartRelatedRequestEntityTest.java
(original)
+++ abdera/java/trunk/client/src/test/java/org/apache/abdera/test/client/util/MultipartRelatedRequestEntityTest.java
Sun May 16 11:32:11 2010
@@ -30,8 +30,6 @@ import java.io.StringWriter;
 
 import javax.activation.MimeType;
 
-import junit.framework.Assert;
-
 import org.apache.abdera.i18n.iri.IRI;
 import org.apache.abdera.model.Entry;
 import org.apache.abdera.parser.stax.FOMEntry;



Mime
View raw message