abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ckopp...@apache.org
Subject svn commit: r944740 - in /abdera/java/trunk: adapters/jcr/src/test/java/org/apache/abdera/jcr/ extensions/json/src/test/java/org/apache/abdera/ext/json/ extensions/oauth/src/test/java/org/apache/abdera/ext/oauth/
Date Sat, 15 May 2010 23:04:36 GMT
Author: ckoppelt
Date: Sat May 15 23:04:36 2010
New Revision: 944740

URL: http://svn.apache.org/viewvc?rev=944740&view=rev
Log:
removing all occurences of 'extend Testcase'

Removed:
    abdera/java/trunk/extensions/oauth/src/test/java/org/apache/abdera/ext/oauth/TestSuite.java
Modified:
    abdera/java/trunk/adapters/jcr/src/test/java/org/apache/abdera/jcr/JcrCollectionAdapterTest.java
    abdera/java/trunk/extensions/json/src/test/java/org/apache/abdera/ext/json/JSONStreamTest.java
    abdera/java/trunk/extensions/oauth/src/test/java/org/apache/abdera/ext/oauth/OAuthSchemeTest.java

Modified: abdera/java/trunk/adapters/jcr/src/test/java/org/apache/abdera/jcr/JcrCollectionAdapterTest.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/adapters/jcr/src/test/java/org/apache/abdera/jcr/JcrCollectionAdapterTest.java?rev=944740&r1=944739&r2=944740&view=diff
==============================================================================
--- abdera/java/trunk/adapters/jcr/src/test/java/org/apache/abdera/jcr/JcrCollectionAdapterTest.java
(original)
+++ abdera/java/trunk/adapters/jcr/src/test/java/org/apache/abdera/jcr/JcrCollectionAdapterTest.java
Sat May 15 23:04:36 2010
@@ -17,6 +17,8 @@
 */
 package org.apache.abdera.jcr;
 
+import static org.junit.Assert.assertEquals;
+
 import java.io.IOException;
 import java.util.Date;
 import java.util.List;
@@ -45,21 +47,21 @@ import org.apache.abdera.protocol.server
 import org.apache.abdera.protocol.server.servlet.AbderaServlet;
 import org.apache.abdera.writer.Writer;
 import org.apache.jackrabbit.core.TransientRepository;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
 import org.mortbay.jetty.Server;
 import org.mortbay.jetty.servlet.Context;
 import org.mortbay.jetty.servlet.ServletHolder;
 
-import junit.framework.TestCase;
-
-public class JcrCollectionAdapterTest extends TestCase {
+public class JcrCollectionAdapterTest {
 
   private Server server;
   private DefaultProvider jcrProvider;
   private Repository repository;
 
-  @Override
-  protected void setUp() throws Exception {
-    super.setUp();
+  @Before
+  public void setUp() throws Exception {
 
     jcrProvider = new DefaultProvider();
 
@@ -82,6 +84,7 @@ public class JcrCollectionAdapterTest ex
     initializeJetty();
   }
 
+  @Test
   public void testJCRAdapter() throws Exception {
     Abdera abdera = new Abdera();
     Factory factory = abdera.getFactory();
@@ -185,8 +188,8 @@ public class JcrCollectionAdapterTest ex
     server.start();
   }
 
-  @Override
-  protected void tearDown() throws Exception {
+  @After
+  public void tearDown() throws Exception {
     clearJcrRepository();
 
     if (server != null)

Modified: abdera/java/trunk/extensions/json/src/test/java/org/apache/abdera/ext/json/JSONStreamTest.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/extensions/json/src/test/java/org/apache/abdera/ext/json/JSONStreamTest.java?rev=944740&r1=944739&r2=944740&view=diff
==============================================================================
--- abdera/java/trunk/extensions/json/src/test/java/org/apache/abdera/ext/json/JSONStreamTest.java
(original)
+++ abdera/java/trunk/extensions/json/src/test/java/org/apache/abdera/ext/json/JSONStreamTest.java
Sat May 15 23:04:36 2010
@@ -18,14 +18,11 @@
 package org.apache.abdera.ext.json;
 
 
-import org.apache.abdera.ext.json.JSONStream;
 import org.apache.abdera.Abdera;
-import org.apache.abdera.writer.Writer;
 import org.apache.abdera.i18n.iri.IRI;
 import org.apache.abdera.model.Entry;
+import org.apache.abdera.writer.Writer;
 import org.junit.Test;
-import org.junit.Assert;
-import junit.framework.TestCase;
 
 
 /**
@@ -34,7 +31,7 @@ import junit.framework.TestCase;
  * @author David Calavera
  * @since 11/01/08
  */
-public class JSONStreamTest extends TestCase {
+public class JSONStreamTest {
 
 	@Test
 	public void testJSONStreamContent() throws Exception {

Modified: abdera/java/trunk/extensions/oauth/src/test/java/org/apache/abdera/ext/oauth/OAuthSchemeTest.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/extensions/oauth/src/test/java/org/apache/abdera/ext/oauth/OAuthSchemeTest.java?rev=944740&r1=944739&r2=944740&view=diff
==============================================================================
--- abdera/java/trunk/extensions/oauth/src/test/java/org/apache/abdera/ext/oauth/OAuthSchemeTest.java
(original)
+++ abdera/java/trunk/extensions/oauth/src/test/java/org/apache/abdera/ext/oauth/OAuthSchemeTest.java
Sat May 15 23:04:36 2010
@@ -17,17 +17,19 @@
 */
 package org.apache.abdera.ext.oauth;
 
-import org.apache.commons.httpclient.auth.AuthenticationException;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
-import junit.framework.TestCase;
+import org.junit.Test;
 
 
-public class OAuthSchemeTest extends TestCase {
+public class OAuthSchemeTest {
 	
 	OAuthScheme scheme = new OAuthScheme();	
 	OAuthCredentials credentials;
 	
-	public void testAuthenticate() {
+	@Test
+	public void testAuthenticate() throws Exception {
 		
 		credentials = 
 		  new OAuthCredentials(
@@ -36,7 +38,6 @@ public class OAuthSchemeTest extends Tes
 		    "HMAC-SHA1", 
 		    "http://photos.example.net/");
 		
-		try {
 			String header = 
 			  scheme.authenticate(
 			    credentials, 
@@ -49,9 +50,7 @@ public class OAuthSchemeTest extends Tes
 				"oauth_timestamp=\"[^\"]+\", oauth_nonce=\"[^\"]+\"(, oauth_version=\"[^\"]+\")?";
 			
 			assertTrue( header.matches( regex ));
-		} catch (AuthenticationException e) {
-			e.printStackTrace();
-		}
+
 	}
 	
 }



Mime
View raw message