abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ckopp...@apache.org
Subject svn commit: r944830 - in /abdera/java/trunk: adapters/filesystem/src/test/java/org/apache/abdera/protocol/server/test/filesystem/ dependencies/i18n/src/test/java/org/apache/abdera/i18n/test/iri/
Date Sun, 16 May 2010 13:35:54 GMT
Author: ckoppelt
Date: Sun May 16 13:35:54 2010
New Revision: 944830

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

Modified:
    abdera/java/trunk/adapters/filesystem/src/test/java/org/apache/abdera/protocol/server/test/filesystem/FilesystemTest.java
    abdera/java/trunk/dependencies/i18n/src/test/java/org/apache/abdera/i18n/test/iri/TestIO.java
    abdera/java/trunk/dependencies/i18n/src/test/java/org/apache/abdera/i18n/test/iri/TestIRI.java
    abdera/java/trunk/dependencies/i18n/src/test/java/org/apache/abdera/i18n/test/iri/TestLang.java
    abdera/java/trunk/dependencies/i18n/src/test/java/org/apache/abdera/i18n/test/iri/TestNFKC.java
    abdera/java/trunk/dependencies/i18n/src/test/java/org/apache/abdera/i18n/test/iri/TestNameprep.java
    abdera/java/trunk/dependencies/i18n/src/test/java/org/apache/abdera/i18n/test/iri/TestTemplate.java
    abdera/java/trunk/dependencies/i18n/src/test/java/org/apache/abdera/i18n/test/iri/TestText.java

Modified: abdera/java/trunk/adapters/filesystem/src/test/java/org/apache/abdera/protocol/server/test/filesystem/FilesystemTest.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/adapters/filesystem/src/test/java/org/apache/abdera/protocol/server/test/filesystem/FilesystemTest.java?rev=944830&r1=944829&r2=944830&view=diff
==============================================================================
--- abdera/java/trunk/adapters/filesystem/src/test/java/org/apache/abdera/protocol/server/test/filesystem/FilesystemTest.java
(original)
+++ abdera/java/trunk/adapters/filesystem/src/test/java/org/apache/abdera/protocol/server/test/filesystem/FilesystemTest.java
Sun May 16 13:35:54 2010
@@ -25,8 +25,6 @@ import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.util.Date;
 
-import junit.framework.Assert;
-
 import org.apache.abdera.Abdera;
 import org.apache.abdera.model.Base;
 import org.apache.abdera.model.Collection;
@@ -89,30 +87,30 @@ public class FilesystemTest {
   public void testGetService() {
     ClientResponse resp = client.get("http://localhost:9002/");
     assertNotNull(resp);
-    assertEquals(resp.getType(), ResponseType.SUCCESS);
+    assertEquals( ResponseType.SUCCESS, resp.getType());
     assertTrue(MimeTypeHelper.isMatch(resp.getContentType().toString(), Constants.APP_MEDIA_TYPE));
     Document<Service> doc = resp.getDocument();
     Service service = doc.getRoot();
-    assertEquals(service.getWorkspaces().size(), 1);
+    assertEquals( 1, service.getWorkspaces().size());
     Workspace workspace = service.getWorkspace("Abdera");
-    assertEquals(workspace.getCollections().size(), 2);
+    assertEquals( 2, workspace.getCollections().size());
     Collection collection = workspace.getCollection("Filesystem Feed");
     assertNotNull(collection);
     assertTrue(collection.acceptsEntry());
-    assertEquals(collection.getResolvedHref().toString(), "http://localhost:9002/fs");
+    assertEquals( "http://localhost:9002/fs", collection.getResolvedHref().toString());
   }
   @Test
   public void testGetFeed() {
     ClientResponse resp = client.get("http://localhost:9002/fs");
     assertNotNull(resp);
-    assertEquals(resp.getType(), ResponseType.SUCCESS);
+    assertEquals( ResponseType.SUCCESS, resp.getType());
     assertTrue(MimeTypeHelper.isMatch(resp.getContentType().toString(), Constants.ATOM_MEDIA_TYPE));
     Document<Feed> doc = resp.getDocument();
     Feed feed = doc.getRoot();
-    assertEquals(feed.getId().toString(), "http://localhost:9002/fs");
-    assertEquals(feed.getTitle(), "Filesystem Feed");
-    assertEquals(feed.getAuthor().getName(), "james");
-    assertEquals(feed.getEntries().size(), 0);
+    assertEquals( "http://localhost:9002/fs", feed.getId().toString());
+    assertEquals( "Filesystem Feed", feed.getTitle());
+    assertEquals( "james", feed.getAuthor().getName());
+    assertEquals( 0, feed.getEntries().size());
     resp.release();
   }
   @Test
@@ -126,13 +124,13 @@ public class FilesystemTest {
     entry.addAuthor("James");
     ClientResponse resp = client.post("http://localhost:9002/fs", entry);
     assertNotNull(resp);
-    assertEquals(resp.getType(), ResponseType.SUCCESS);
-    assertEquals(resp.getStatus(), 201);
-    assertEquals(resp.getLocation().toString(), "http://localhost:9002/fs/test_entry");
+    assertEquals( ResponseType.SUCCESS, resp.getType());
+    assertEquals( 201, resp.getStatus());
+    assertEquals( "http://localhost:9002/fs/test_entry", resp.getLocation().toString());
     resp = client.get("http://localhost:9002/fs");
     Document<Feed> feed_doc = resp.getDocument();
     Feed feed = feed_doc.getRoot();
-    assertEquals(feed.getEntries().size(), 1);
+    assertEquals( 1, feed.getEntries().size());
     resp.release();
   }
   @Test
@@ -141,8 +139,8 @@ public class FilesystemTest {
     RequestOptions options = client.getDefaultRequestOptions();
     options.setContentType("application/octet-stream");
     ClientResponse resp = client.post("http://localhost:9002/fs", in, options);
-    assertEquals(resp.getType(), ResponseType.CLIENT_ERROR);
-    assertEquals(resp.getStatus(), 415);
+    assertEquals( ResponseType.CLIENT_ERROR, resp.getType());
+    assertEquals( 415, resp.getStatus());
     resp.release();
   }
   @Test
@@ -153,30 +151,30 @@ public class FilesystemTest {
     entry.setTitle("This is the modified title");
     resp.release();
     resp = client.put("http://localhost:9002/fs/test_entry", entry);
-    assertEquals(resp.getType(), ResponseType.SUCCESS);
-    assertEquals(resp.getStatus(), 200);
+    assertEquals( ResponseType.SUCCESS, resp.getType());
+    assertEquals( 200, resp.getStatus());
     resp.release();
     resp = client.get("http://localhost:9002/fs/test_entry");
     doc = resp.getDocument();
     entry = doc.getRoot();
-    assertEquals(entry.getTitle(), "This is the modified title");
+    assertEquals( "This is the modified title", entry.getTitle());
     resp.release();
     resp = client.get("http://localhost:9002/fs");
     Document<Feed> feed_doc = resp.getDocument();
     Feed feed = feed_doc.getRoot();
-    assertEquals(feed.getEntries().size(), 1);
+    assertEquals( 1, feed.getEntries().size());
     resp.release();
   }
 
   @Test
   public void testDeleteEntry() {
     ClientResponse resp = client.delete("http://localhost:9002/fs/test_entry");
-    assertEquals(resp.getType(), ResponseType.SUCCESS);
+    assertEquals( ResponseType.SUCCESS, resp.getType());
     resp.release();
     resp = client.get("http://localhost:9002/fs");
     Document<Feed> feed_doc = resp.getDocument();
     Feed feed = feed_doc.getRoot();
-    assertEquals(feed.getEntries().size(), 0);
+    assertEquals( 0, feed.getEntries().size());
     resp.release();
   }
 }

Modified: abdera/java/trunk/dependencies/i18n/src/test/java/org/apache/abdera/i18n/test/iri/TestIO.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/dependencies/i18n/src/test/java/org/apache/abdera/i18n/test/iri/TestIO.java?rev=944830&r1=944829&r2=944830&view=diff
==============================================================================
--- abdera/java/trunk/dependencies/i18n/src/test/java/org/apache/abdera/i18n/test/iri/TestIO.java
(original)
+++ abdera/java/trunk/dependencies/i18n/src/test/java/org/apache/abdera/i18n/test/iri/TestIO.java
Sun May 16 13:35:54 2010
@@ -53,48 +53,48 @@ public class TestIO extends TestBase {
     
     ByteArrayInputStream in = new ByteArrayInputStream(utf32be);
     CharsetSniffingInputStream csis = new CharsetSniffingInputStream(in);
-    assertEquals(csis.getEncoding(),"UTF-32");
+    assertEquals("UTF-32", csis.getEncoding());
     assertTrue(csis.isBomSet());
     
     in = new ByteArrayInputStream(utf32le);
     csis = new CharsetSniffingInputStream(in);
-    assertEquals(csis.getEncoding(),"UTF-32");
+    assertEquals("UTF-32", csis.getEncoding());
     assertTrue(csis.isBomSet());
 
     in = new ByteArrayInputStream(utf16be);
     csis = new CharsetSniffingInputStream(in);
-    assertEquals(csis.getEncoding(),"UTF-16");
+    assertEquals("UTF-16", csis.getEncoding());
     assertTrue(csis.isBomSet());
     
     in = new ByteArrayInputStream(utf16le);
     csis = new CharsetSniffingInputStream(in);
-    assertEquals(csis.getEncoding(),"UTF-16");
+    assertEquals("UTF-16", csis.getEncoding());
     assertTrue(csis.isBomSet());
     
     in = new ByteArrayInputStream(utf8);
     csis = new CharsetSniffingInputStream(in);
-    assertEquals(csis.getEncoding(),"UTF-8");
+    assertEquals("UTF-8", csis.getEncoding());
     assertTrue(csis.isBomSet());
     
 
     in = new ByteArrayInputStream(nobom_utf32be);
     csis = new CharsetSniffingInputStream(in);
-    assertEquals(csis.getEncoding(),"UTF-32be");
+    assertEquals("UTF-32be", csis.getEncoding());
     assertFalse(csis.isBomSet());
     
     in = new ByteArrayInputStream(nobom_utf32le);
     csis = new CharsetSniffingInputStream(in);
-    assertEquals(csis.getEncoding(),"UTF-32le");
+    assertEquals("UTF-32le", csis.getEncoding());
     assertFalse(csis.isBomSet());
 
     in = new ByteArrayInputStream(nobom_utf16be);
     csis = new CharsetSniffingInputStream(in);
-    assertEquals(csis.getEncoding(),"UTF-16be");
+    assertEquals("UTF-16be", csis.getEncoding());
     assertFalse(csis.isBomSet());
     
     in = new ByteArrayInputStream(nobom_utf16le);
     csis = new CharsetSniffingInputStream(in);
-    assertEquals(csis.getEncoding(),"UTF-16le");
+    assertEquals("UTF-16le", csis.getEncoding());
     assertFalse(csis.isBomSet());
   }
   
@@ -126,8 +126,8 @@ public class TestIO extends TestBase {
           }});
     char[] buf = new char[7];
     int r = fcr.read(buf);
-    assertEquals(r,4);
-    assertEquals(new String(buf,0,r),"abfg");
+    assertEquals(4, r);
+    assertEquals("abfg", new String(buf,0,r));
   }
   
   @Test
@@ -138,8 +138,8 @@ public class TestIO extends TestBase {
     byte[] read = new byte[2];
     pais.peek(peek);
     pais.read(read);
-    assertEquals(peek[0],read[0]);
-    assertEquals(peek[1],read[1]);
+    assertEquals(read[0], peek[0]);
+    assertEquals(read[1], peek[1]);
     byte[] newread = new byte[2];
     assertFalse(read[0] == newread[0]);
     assertFalse(read[1] == newread[1]);    
@@ -155,7 +155,7 @@ public class TestIO extends TestBase {
     ris.rewind();
     ris.read(buf2);
     for (int n = 0; n < 4; n++)
-      assertEquals(buf1[n],buf2[n]);
+      assertEquals(buf2[n], buf1[n]);
   }
   
   @Test
@@ -174,10 +174,10 @@ public class TestIO extends TestBase {
     InputStream in = pc.getInputStream();
     byte[] buf = new byte[4];
     in.read(buf);
-    assertEquals(buf[0],0x1);
-    assertEquals(buf[1],0x2);
-    assertEquals(buf[2],0x3);
-    assertEquals(buf[3],0x4);
+    assertEquals(0x1, buf[0]);
+    assertEquals(0x2, buf[1]);
+    assertEquals(0x3, buf[2]);
+    assertEquals(0x4, buf[3]);
     in.close();
     assertTrue(pc.isWritable());
     assertFalse(pc.isReadable());

Modified: abdera/java/trunk/dependencies/i18n/src/test/java/org/apache/abdera/i18n/test/iri/TestIRI.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/dependencies/i18n/src/test/java/org/apache/abdera/i18n/test/iri/TestIRI.java?rev=944830&r1=944829&r2=944830&view=diff
==============================================================================
--- abdera/java/trunk/dependencies/i18n/src/test/java/org/apache/abdera/i18n/test/iri/TestIRI.java
(original)
+++ abdera/java/trunk/dependencies/i18n/src/test/java/org/apache/abdera/i18n/test/iri/TestIRI.java
Sun May 16 13:35:54 2010
@@ -32,33 +32,33 @@ public class TestIRI extends TestBase {
   @Test
   public void testSimple() throws Exception {
     IRI iri = new IRI("http://validator.w3.org/check?uri=http%3A%2F%2Fr\u00E9sum\u00E9.example.org");
-    assertEquals(iri.toString(),"http://validator.w3.org/check?uri=http%3A%2F%2Fr\u00E9sum\u00E9.example.org");
-    assertEquals(iri.toURI().toString(),"http://validator.w3.org/check?uri=http%3A%2F%2Fr%C3%A9sum%C3%A9.example.org");
  
+    assertEquals("http://validator.w3.org/check?uri=http%3A%2F%2Fr\u00E9sum\u00E9.example.org",
iri.toString());
+    assertEquals("http://validator.w3.org/check?uri=http%3A%2F%2Fr%C3%A9sum%C3%A9.example.org",
iri.toURI().toString());   
   }
   
   @Test
   public void testFile() throws Exception {
     IRI iri = new IRI("file:///tmp/test/foo");
-    assertEquals(iri.toURI().toString(),"file:///tmp/test/foo");
+    assertEquals("file:///tmp/test/foo", iri.toURI().toString());
   }
 
   @Test
   public void testSimple2() throws Exception {
     IRI iri = new IRI("http://www.example.org/red%09ros\u00E9#red");
-    assertEquals(iri.toURI().toString(),"http://www.example.org/red%09ros%C3%A9#red");
+    assertEquals("http://www.example.org/red%09ros%C3%A9#red", iri.toURI().toString());
   }
   
   @Test
   public void testNotSoSimple() throws Exception {
     IRI iri = new IRI("http://example.com/\uD800\uDF00\uD800\uDF01\uD800\uDF02");
-    assertEquals(iri.toURI().toString(),"http://example.com/%F0%90%8C%80%F0%90%8C%81%F0%90%8C%82");
+    assertEquals("http://example.com/%F0%90%8C%80%F0%90%8C%81%F0%90%8C%82", iri.toURI().toString());
   }
     
   @Test
   public void testIRItoURI() throws Exception {
     IRI iri = new IRI("http://\u7D0D\u8C46.example.org/%E2%80%AE");
     URI uri = iri.toURI();
-    assertEquals(uri.toString(),"http://xn--99zt52a.example.org/%E2%80%AE");
+    assertEquals("http://xn--99zt52a.example.org/%E2%80%AE", uri.toString());
   }
   
   @Test
@@ -88,7 +88,7 @@ public class TestIRI extends TestBase {
   public void testUCN() throws Exception {
     IRI iri1 = new IRI("http://www.example.org/r\u00E9sum\u00E9.html");
     IRI iri2 = new IRI("http://www.example.org/re\u0301sume\u0301.html", Normalizer.Form.C);
-    assertEquals(iri1,iri2);
+    assertEquals(iri2, iri1);
   }
   
   @Test
@@ -101,22 +101,22 @@ public class TestIRI extends TestBase {
   @Test
   public void testIDN() throws Exception {
     IRI iri1 = new IRI("http://r\u00E9sum\u00E9.example.org");
-    assertEquals(iri1.getASCIIHost(),"xn--rsum-bpad.example.org");
+    assertEquals("xn--rsum-bpad.example.org", iri1.getASCIIHost());
   }
   
   @Test
   public void testRelative() throws Exception{
     IRI base = new IRI("http://example.org/foo/");
     
-    assertEquals(base.resolve("/").toString(),"http://example.org/");
-    assertEquals(base.resolve("/test").toString(),"http://example.org/test");
-    assertEquals(base.resolve("test").toString(),"http://example.org/foo/test");
-    assertEquals(base.resolve("../test").toString(),"http://example.org/test");
-    assertEquals(base.resolve("./test").toString(),"http://example.org/foo/test");
-    assertEquals(base.resolve("test/test/../../").toString(),"http://example.org/foo/");
-    assertEquals(base.resolve("?test").toString(),"http://example.org/foo/?test");
-    assertEquals(base.resolve("#test").toString(),"http://example.org/foo/#test");
-    assertEquals(base.resolve(".").toString(),"http://example.org/foo/");
+    assertEquals("http://example.org/", base.resolve("/").toString());
+    assertEquals("http://example.org/test", base.resolve("/test").toString());
+    assertEquals("http://example.org/foo/test", base.resolve("test").toString());
+    assertEquals("http://example.org/test", base.resolve("../test").toString());
+    assertEquals("http://example.org/foo/test", base.resolve("./test").toString());
+    assertEquals("http://example.org/foo/", base.resolve("test/test/../../").toString());
+    assertEquals("http://example.org/foo/?test", base.resolve("?test").toString());
+    assertEquals("http://example.org/foo/#test", base.resolve("#test").toString());
+    assertEquals("http://example.org/foo/", base.resolve(".").toString());
   }
 
   /**
@@ -127,67 +127,67 @@ public class TestIRI extends TestBase {
   public void testSchemes() throws Exception {
     
     IRI iri = new IRI("http://a:b@c.org:80/d/e?f#g");
-    assertEquals(iri.getScheme(), "http");
-    assertEquals(iri.getUserInfo(), "a:b");
-    assertEquals(iri.getHost(),"c.org");
-    assertEquals(iri.getPort(),80);
-    assertEquals(iri.getPath(),"/d/e");
-    assertEquals(iri.getQuery(), "f");
-    assertEquals(iri.getFragment(),"g");
+    assertEquals( "http", iri.getScheme());
+    assertEquals( "a:b", iri.getUserInfo());
+    assertEquals("c.org", iri.getHost());
+    assertEquals(80, iri.getPort());
+    assertEquals("/d/e", iri.getPath());
+    assertEquals( "f", iri.getQuery());
+    assertEquals("g", iri.getFragment());
     
     iri = new IRI("https://a:b@c.org:80/d/e?f#g");
-    assertEquals(iri.getScheme(), "https");
-    assertEquals(iri.getUserInfo(), "a:b");
-    assertEquals(iri.getHost(),"c.org");
-    assertEquals(iri.getPort(),80);
-    assertEquals(iri.getPath(),"/d/e");
-    assertEquals(iri.getQuery(), "f");
-    assertEquals(iri.getFragment(),"g");
+    assertEquals( "https", iri.getScheme());
+    assertEquals( "a:b", iri.getUserInfo());
+    assertEquals("c.org", iri.getHost());
+    assertEquals(80, iri.getPort());
+    assertEquals("/d/e", iri.getPath());
+    assertEquals( "f", iri.getQuery());
+    assertEquals("g", iri.getFragment());
     
     iri = new IRI("ftp://a:b@c.org:80/d/e?f#g");
-    assertEquals(iri.getScheme(), "ftp");
-    assertEquals(iri.getUserInfo(), "a:b");
-    assertEquals(iri.getHost(),"c.org");
-    assertEquals(iri.getPort(),80);
-    assertEquals(iri.getPath(),"/d/e");
-    assertEquals(iri.getQuery(), "f");
-    assertEquals(iri.getFragment(),"g");
+    assertEquals( "ftp", iri.getScheme());
+    assertEquals( "a:b", iri.getUserInfo());
+    assertEquals("c.org", iri.getHost());
+    assertEquals(80, iri.getPort());
+    assertEquals("/d/e", iri.getPath());
+    assertEquals( "f", iri.getQuery());
+    assertEquals("g", iri.getFragment());
     
     iri = new IRI("mailto:joe@example.org?subject=foo");
-    assertEquals(iri.getScheme(), "mailto");
-    assertEquals(iri.getUserInfo(), null);
-    assertEquals(iri.getHost(),null);
-    assertEquals(iri.getPort(),-1);
-    assertEquals(iri.getPath(),"joe@example.org");
-    assertEquals(iri.getQuery(), "subject=foo");
-    assertEquals(iri.getFragment(),null);
+    assertEquals( "mailto", iri.getScheme());
+    assertEquals( null, iri.getUserInfo());
+    assertEquals(null, iri.getHost());
+    assertEquals(-1, iri.getPort());
+    assertEquals("joe@example.org", iri.getPath());
+    assertEquals( "subject=foo", iri.getQuery());
+    assertEquals(null, iri.getFragment());
     
     iri = new IRI("tag:example.org,2006:foo");
-    assertEquals(iri.getScheme(), "tag");
-    assertEquals(iri.getUserInfo(), null);
-    assertEquals(iri.getHost(),null);
-    assertEquals(iri.getPort(),-1);
-    assertEquals(iri.getPath(),"example.org,2006:foo");
-    assertEquals(iri.getQuery(), null);
-    assertEquals(iri.getFragment(),null);
+    assertEquals( "tag", iri.getScheme());
+    assertEquals( null, iri.getUserInfo());
+    assertEquals(null, iri.getHost());
+    assertEquals(-1, iri.getPort());
+    assertEquals("example.org,2006:foo", iri.getPath());
+    assertEquals( null, iri.getQuery());
+    assertEquals(null, iri.getFragment());
     
     iri = new IRI("urn:lsid:ibm.com:example:82437234964354895798234d");
-    assertEquals(iri.getScheme(), "urn");
-    assertEquals(iri.getUserInfo(), null);
-    assertEquals(iri.getHost(),null);
-    assertEquals(iri.getPort(),-1);
-    assertEquals(iri.getPath(),"lsid:ibm.com:example:82437234964354895798234d");
-    assertEquals(iri.getQuery(), null);
-    assertEquals(iri.getFragment(),null);
+    assertEquals( "urn", iri.getScheme());
+    assertEquals( null, iri.getUserInfo());
+    assertEquals(null, iri.getHost());
+    assertEquals(-1, iri.getPort());
+    assertEquals("lsid:ibm.com:example:82437234964354895798234d", iri.getPath());
+    assertEquals( null, iri.getQuery());
+    assertEquals(null, iri.getFragment());
     
     iri = new IRI("data:image/gif;base64,R0lGODdhMAAwAPAAAAAAAP");
-    assertEquals(iri.getScheme(), "data");
-    assertEquals(iri.getUserInfo(), null);
-    assertEquals(iri.getHost(),null);
-    assertEquals(iri.getPort(),-1);
-    assertEquals(iri.getPath(),"image/gif;base64,R0lGODdhMAAwAPAAAAAAAP");
-    assertEquals(iri.getQuery(), null);
-    assertEquals(iri.getFragment(),null);
+    assertEquals( "data", iri.getScheme());
+    assertEquals( null, iri.getUserInfo());
+    assertEquals(null, iri.getHost());
+    assertEquals(-1, iri.getPort());
+    assertEquals("image/gif;base64,R0lGODdhMAAwAPAAAAAAAP", iri.getPath());
+    assertEquals( null, iri.getQuery());
+    assertEquals(null, iri.getFragment());
     
   }
 }

Modified: abdera/java/trunk/dependencies/i18n/src/test/java/org/apache/abdera/i18n/test/iri/TestLang.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/dependencies/i18n/src/test/java/org/apache/abdera/i18n/test/iri/TestLang.java?rev=944830&r1=944829&r2=944830&view=diff
==============================================================================
--- abdera/java/trunk/dependencies/i18n/src/test/java/org/apache/abdera/i18n/test/iri/TestLang.java
(original)
+++ abdera/java/trunk/dependencies/i18n/src/test/java/org/apache/abdera/i18n/test/iri/TestLang.java
Sun May 16 13:35:54 2010
@@ -39,9 +39,9 @@ public class TestLang extends TestBase {
       new org.apache.abdera.i18n.lang.Lang("en-US-ca");
     Locale testLocale = new Locale("en", "US", "ca");
         
-    assertEquals(lang.getPrimary(),"en");
-    assertEquals(lang.getSubtag(0),"US");
-    assertEquals(lang.getSubtag(1),"ca");
+    assertEquals("en", lang.getPrimary());
+    assertEquals("US", lang.getSubtag(0));
+    assertEquals("ca", lang.getSubtag(1));
     
     assertEquals( testLocale, lang.getLocale() );
     assertEquals(testLocale.toString(), lang.getLocale().toString());
@@ -70,18 +70,18 @@ public class TestLang extends TestBase {
   @Test
   public void test4646Lang() throws Exception {
     Lang lang = new Lang("en-Latn-US-valencia");
-    assertEquals(lang.getLanguage().toString(),"en");
-    assertEquals(lang.getRegion().toString(), "US");
-    assertEquals(lang.getScript().toString(), "Latn");
-    assertEquals(lang.getVariant().toString(), "valencia");
+    assertEquals("en", lang.getLanguage().toString());
+    assertEquals( "US", lang.getRegion().toString());
+    assertEquals( "Latn", lang.getScript().toString());
+    assertEquals( "valencia", lang.getVariant().toString());
     assertNull(lang.getExtLang());
     assertNull(lang.getExtension());
     assertNull(lang.getPrivateUse());
     assertTrue(lang.isValid());
     Locale locale = lang.getLocale();
-    assertEquals(locale.getCountry(),"US");
-    assertEquals(locale.getLanguage(),"en");
-    assertEquals(locale.getVariant(),"valencia");
+    assertEquals("US", locale.getCountry());
+    assertEquals("en", locale.getLanguage());
+    assertEquals("valencia", locale.getVariant());
   }
   
   @Test

Modified: abdera/java/trunk/dependencies/i18n/src/test/java/org/apache/abdera/i18n/test/iri/TestNFKC.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/dependencies/i18n/src/test/java/org/apache/abdera/i18n/test/iri/TestNFKC.java?rev=944830&r1=944829&r2=944830&view=diff
==============================================================================
--- abdera/java/trunk/dependencies/i18n/src/test/java/org/apache/abdera/i18n/test/iri/TestNFKC.java
(original)
+++ abdera/java/trunk/dependencies/i18n/src/test/java/org/apache/abdera/i18n/test/iri/TestNFKC.java
Sun May 16 13:35:54 2010
@@ -30,12 +30,12 @@ public class TestNFKC extends TestBase {
     // "\xC2\xB5", "\xCE\xBC"
     String s1 = Normalizer.normalize(string(0xC2,0xB5)).toString();
     String s2 = string(0xCE,0xBC);
-    assertEquals(s1,s2);
+    assertEquals(s2, s1);
     
     // "\xC2\xAA", "\x61"
     s1 = Normalizer.normalize(string(0xC2,0xAA)).toString();
     s2 = string(0x61);
-    assertEquals(s1,s2);
+    assertEquals(s2, s1);
     
   }
   

Modified: abdera/java/trunk/dependencies/i18n/src/test/java/org/apache/abdera/i18n/test/iri/TestNameprep.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/dependencies/i18n/src/test/java/org/apache/abdera/i18n/test/iri/TestNameprep.java?rev=944830&r1=944829&r2=944830&view=diff
==============================================================================
--- abdera/java/trunk/dependencies/i18n/src/test/java/org/apache/abdera/i18n/test/iri/TestNameprep.java
(original)
+++ abdera/java/trunk/dependencies/i18n/src/test/java/org/apache/abdera/i18n/test/iri/TestNameprep.java
Sun May 16 13:35:54 2010
@@ -151,7 +151,7 @@ public class TestNameprep extends TestBa
     for (Test test : Test.values()) {
       try {
         String out = Nameprep.prep(test.in);
-        assertEquals(test.out,out);
+        assertEquals(out, test.out);
       } catch (Exception e) {
         if (test.rc != -1)
           fail("Failure in Test #" + test + " not expected");

Modified: abdera/java/trunk/dependencies/i18n/src/test/java/org/apache/abdera/i18n/test/iri/TestTemplate.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/dependencies/i18n/src/test/java/org/apache/abdera/i18n/test/iri/TestTemplate.java?rev=944830&r1=944829&r2=944830&view=diff
==============================================================================
--- abdera/java/trunk/dependencies/i18n/src/test/java/org/apache/abdera/i18n/test/iri/TestTemplate.java
(original)
+++ abdera/java/trunk/dependencies/i18n/src/test/java/org/apache/abdera/i18n/test/iri/TestTemplate.java
Sun May 16 13:35:54 2010
@@ -209,16 +209,16 @@ public final class TestTemplate 
     String t = "http://www.google.com/notebook/feeds/{userID}{-prefix|/notebooks/|notebookID}{-opt|/-/|categories}{-list|/|categories}?{-join|&|updated-min,updated-max,alt,start-index,max-results,entryID,orderby}";
     Template template = new Template(t);
     String[] variables = template.getVariables();
-    assertEquals(variables[0],"userID");
-    assertEquals(variables[1],"notebookID");
-    assertEquals(variables[2],"categories");
-    assertEquals(variables[3],"updated-min");
-    assertEquals(variables[4],"updated-max");
-    assertEquals(variables[5],"alt");
-    assertEquals(variables[6],"start-index");
-    assertEquals(variables[7],"max-results");
-    assertEquals(variables[8],"entryID");
-    assertEquals(variables[9],"orderby");
+    assertEquals("userID", variables[0]);
+    assertEquals("notebookID", variables[1]);
+    assertEquals("categories", variables[2]);
+    assertEquals("updated-min", variables[3]);
+    assertEquals("updated-max", variables[4]);
+    assertEquals("alt", variables[5]);
+    assertEquals("start-index", variables[6]);
+    assertEquals("max-results", variables[7]);
+    assertEquals("entryID", variables[8]);
+    assertEquals("orderby", variables[9]);
   }
 
   @Test
@@ -226,8 +226,8 @@ public final class TestTemplate 
     String t = "http://www.google.com/notebook/feeds/{userID}{-prefix|/notebooks/|notebookID}{-opt|/-/|categories}{-list|/|categories}?{-join|&|updated-min,updated-max,alt,start-index,max-results,entryID,orderby}";
     Template template = new Template(t);
     Template t2 = template.clone();
-    assertEquals(template,t2);
-    assertEquals(template.hashCode(),t2.hashCode());
+    assertEquals(t2, template);
+    assertEquals(t2.hashCode(), template.hashCode());
   }
   
   @Test
@@ -269,20 +269,20 @@ public final class TestTemplate 
     tests.put("{ints}","1%2C2%2C3");
     
     for (String t : tests.keySet())
-      assertEquals(Template.expand(t,map),tests.get(t));
+      assertEquals(tests.get(t), Template.expand(t,map));
   }
   
   @Test
   public void test21() throws Exception {
     String t = "http://example.org/{foo}/{bar}{-opt|/|categories}{-list|/|categories}?{-join|&|baz,tag}";
     String e = "http://example.org/abc/xyz/a/b?baz=true&tag=x&tag=y&tag=z";
-    assertEquals(Template.expand(t,new MyObject()),e);
+    assertEquals(e, Template.expand(t,new MyObject()));
   }
 
   @Test
   public void test22() throws Exception {
     String e = "http://example.org/abc/xyz/a/b?baz=true&tag=x&tag=y&tag=z";
-    assertEquals(Template.expandAnnotated(new MyObject()),e);
+    assertEquals(e, Template.expandAnnotated(new MyObject()));
   }
   
   @Test
@@ -337,7 +337,7 @@ public final class TestTemplate 
     };
     
     for (int n = 0; n < templates.length; n = n + 2) {
-      assertEquals(Template.expand(templates[n], map), templates[n+1]);
+      assertEquals( templates[n+1], Template.expand(templates[n], map));
     }
   }
   
@@ -355,7 +355,7 @@ public final class TestTemplate 
     };
       
       for (int n = 0; n < templates.length; n = n + 2) {
-        assertEquals(Template.expand(templates[n], map), templates[n+1]);
+        assertEquals( templates[n+1], Template.expand(templates[n], map));
       }
   }
     
@@ -373,7 +373,7 @@ public final class TestTemplate 
     };
       
       for (int n = 0; n < templates.length; n = n + 2) {
-        assertEquals(Template.expand(templates[n], map), templates[n+1]);
+        assertEquals( templates[n+1], Template.expand(templates[n], map));
       }
   }
   
@@ -395,7 +395,7 @@ public final class TestTemplate 
   }
   
   private static void eval(String t, String e, HashMapContext c) {
-    assertEquals(Template.expand(t,c), e);
+    assertEquals( e, Template.expand(t,c));
   }
 }
 

Modified: abdera/java/trunk/dependencies/i18n/src/test/java/org/apache/abdera/i18n/test/iri/TestText.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/dependencies/i18n/src/test/java/org/apache/abdera/i18n/test/iri/TestText.java?rev=944830&r1=944829&r2=944830&view=diff
==============================================================================
--- abdera/java/trunk/dependencies/i18n/src/test/java/org/apache/abdera/i18n/test/iri/TestText.java
(original)
+++ abdera/java/trunk/dependencies/i18n/src/test/java/org/apache/abdera/i18n/test/iri/TestText.java
Sun May 16 13:35:54 2010
@@ -34,17 +34,17 @@ public class TestText extends TestBase {
   public void testCodepoints() throws Exception {
     StringBuilder buf = new StringBuilder();
     CharUtils.append(buf, 0x10000);
-    assertEquals(buf.length(),2);
-    assertEquals(buf.charAt(0), CharUtils.getHighSurrogate(0x10000));
-    assertEquals(buf.charAt(1), CharUtils.getLowSurrogate(0x10000));
+    assertEquals(2, buf.length());
+    assertEquals( CharUtils.getHighSurrogate(0x10000), buf.charAt(0));
+    assertEquals( CharUtils.getLowSurrogate(0x10000), buf.charAt(1));
     assertTrue(CharUtils.isSurrogatePair(buf.charAt(0), buf.charAt(1)));
     Codepoint codepoint = CharUtils.codepointAt(buf, 0);
-    assertEquals(codepoint.getValue(),0x10000);
-    assertEquals(codepoint.getCharCount(),2);
+    assertEquals(0x10000, codepoint.getValue());
+    assertEquals(2, codepoint.getCharCount());
     assertTrue(codepoint.isSupplementary());
     CharUtils.insert(buf, 0, codepoint.next());
-    assertEquals(buf.length(),4);
-    assertEquals(codepoint.next(),CharUtils.codepointAt(buf, 0));
+    assertEquals(4, buf.length());
+    assertEquals(CharUtils.codepointAt(buf, 0), codepoint.next());
   }
   
   @Test
@@ -74,36 +74,36 @@ public class TestText extends TestBase {
     String rlo = CharUtils.wrapBidi(s, CharUtils.RLO);
     String rlm = CharUtils.wrapBidi(s, CharUtils.RLM);
     
-    assertEquals(lre.charAt(0),CharUtils.LRE);
-    assertEquals(lre.charAt(lre.length()-1),CharUtils.PDF);
+    assertEquals(CharUtils.LRE, lre.charAt(0));
+    assertEquals(CharUtils.PDF, lre.charAt(lre.length()-1));
     
-    assertEquals(lro.charAt(0),CharUtils.LRO);
-    assertEquals(lro.charAt(lro.length()-1),CharUtils.PDF);
+    assertEquals(CharUtils.LRO, lro.charAt(0));
+    assertEquals(CharUtils.PDF, lro.charAt(lro.length()-1));
     
-    assertEquals(lrm.charAt(0),CharUtils.LRM);
-    assertEquals(lrm.charAt(lrm.length()-1),CharUtils.LRM);
+    assertEquals(CharUtils.LRM, lrm.charAt(0));
+    assertEquals(CharUtils.LRM, lrm.charAt(lrm.length()-1));
 
-    assertEquals(rle.charAt(0),CharUtils.RLE);
-    assertEquals(rle.charAt(rle.length()-1),CharUtils.PDF);
+    assertEquals(CharUtils.RLE, rle.charAt(0));
+    assertEquals(CharUtils.PDF, rle.charAt(rle.length()-1));
     
-    assertEquals(rlo.charAt(0),CharUtils.RLO);
-    assertEquals(rlo.charAt(rlo.length()-1),CharUtils.PDF);
+    assertEquals(CharUtils.RLO, rlo.charAt(0));
+    assertEquals(CharUtils.PDF, rlo.charAt(rlo.length()-1));
     
-    assertEquals(rlm.charAt(0),CharUtils.RLM);
-    assertEquals(rlm.charAt(rlm.length()-1),CharUtils.RLM);
+    assertEquals(CharUtils.RLM, rlm.charAt(0));
+    assertEquals(CharUtils.RLM, rlm.charAt(rlm.length()-1));
     
-    assertEquals(s, CharUtils.stripBidi(lre));
-    assertEquals(s, CharUtils.stripBidi(lro));
-    assertEquals(s, CharUtils.stripBidi(lrm));
-    assertEquals(s, CharUtils.stripBidi(rle));
-    assertEquals(s, CharUtils.stripBidi(rlo));
-    assertEquals(s, CharUtils.stripBidi(rlm));
+    assertEquals( s,  CharUtils.stripBidi(lre));
+    assertEquals( s,  CharUtils.stripBidi(lro));
+    assertEquals( s,  CharUtils.stripBidi(lrm));
+    assertEquals( s,  CharUtils.stripBidi(rle));
+    assertEquals( s,  CharUtils.stripBidi(rlo));
+    assertEquals( s,  CharUtils.stripBidi(rlm));
     
     s = new String(new char[] {'a',CharUtils.LRM,'b',CharUtils.LRM,'c'});
-    assertEquals(s.length(),5);
+    assertEquals(5, s.length());
     s = CharUtils.stripBidiInternal(s);
-    assertEquals(s.length(),3);
-    assertEquals(s,"abc");
+    assertEquals(3, s.length());
+    assertEquals("abc", s);
   }
   
   @Test
@@ -123,9 +123,9 @@ public class TestText extends TestBase {
   public void testSanitizer() throws Exception {
     String s = "\u0074\u0068\u00ed\u0073\u0020\u00ed\u0073\u0020\u00e0\u0020\u0074\u00e9\u0073\u0074";
     String t = Sanitizer.sanitize(s);
-    assertEquals(t,"th%C3%ADs_%C3%ADs_%C3%A0_t%C3%A9st");
+    assertEquals("th%C3%ADs_%C3%ADs_%C3%A0_t%C3%A9st", t);
     t = Sanitizer.sanitize(s, "", true, Normalizer.Form.D);
-    assertEquals(t,"this_is_a_test");
+    assertEquals("this_is_a_test", t);
     
   }
 }



Mime
View raw message