hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r936246 - in /httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http: ./ entity/
Date Wed, 21 Apr 2010 10:38:34 GMT
Author: sebb
Date: Wed Apr 21 10:38:34 2010
New Revision: 936246

URL: http://svn.apache.org/viewvc?rev=936246&view=rev
Log:
No need for main() and suite() methods in Test classes

Modified:
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/TestHttpExceptions.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/TestHttpHost.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/TestHttpVersion.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestAbstractHttpEntity.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestBasicHttpEntity.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestBufferedHttpEntity.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestByteArrayEntity.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestEntityTemplate.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestFileEntity.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestHttpEntityWrapper.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestInputStreamEntity.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestSerializableEntity.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestStringEntity.java

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/TestHttpExceptions.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/TestHttpExceptions.java?rev=936246&r1=936245&r2=936246&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/TestHttpExceptions.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/TestHttpExceptions.java
Wed Apr 21 10:38:34 2010
@@ -27,7 +27,7 @@
 
 package org.apache.http;
 
-import junit.framework.*;
+import junit.framework.TestCase;
 
 /**
  * Simple tests for various HTTP exception classes.
@@ -41,18 +41,8 @@ public class TestHttpExceptions extends 
         super(testName);
     }
 
-    // ------------------------------------------------------------------- Main
-    public static void main(String args[]) {
-        String[] testCaseName = { TestHttpExceptions.class.getName() };
-        junit.textui.TestRunner.main(testCaseName);
-    }
-
     // ------------------------------------------------------- TestCase Methods
 
-    public static Test suite() {
-        return new TestSuite(TestHttpExceptions.class);
-    }
-
     public void testConstructor() {
         Throwable cause = new Exception();
         new HttpException();

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/TestHttpHost.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/TestHttpHost.java?rev=936246&r1=936245&r2=936246&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/TestHttpHost.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/TestHttpHost.java
Wed Apr 21 10:38:34 2010
@@ -32,9 +32,7 @@ import java.io.ByteArrayOutputStream;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 
-import junit.framework.Test;
 import junit.framework.TestCase;
-import junit.framework.TestSuite;
 
 /**
  * Unit tests for {@link HttpHost}.
@@ -46,15 +44,6 @@ public class TestHttpHost extends TestCa
         super(testName);
     }
 
-    public static void main(String args[]) {
-        String[] testCaseName = { TestHttpHost.class.getName() };
-        junit.textui.TestRunner.main(testCaseName);
-    }
-
-    public static Test suite() {
-        return new TestSuite(TestHttpHost.class);
-    }
-
     public void testConstructor() {
         HttpHost host1 = new HttpHost("somehost");
         assertEquals("somehost", host1.getHostName()); 

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/TestHttpVersion.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/TestHttpVersion.java?rev=936246&r1=936245&r2=936246&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/TestHttpVersion.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/TestHttpVersion.java
Wed Apr 21 10:38:34 2010
@@ -32,9 +32,7 @@ import java.io.ByteArrayOutputStream;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 
-import junit.framework.Test;
 import junit.framework.TestCase;
-import junit.framework.TestSuite;
 
 /**
  * Test cases for HTTP version class
@@ -48,12 +46,6 @@ public class TestHttpVersion extends Tes
         super(name);
     }
 
-    // ------------------------------------------------------- TestCase Methods
-
-    public static Test suite() {
-        return new TestSuite(TestHttpVersion.class);
-    }
-
     // ------------------------------------------------------------------ Tests
     
     public void testHttpVersionInvalidConstructorInput() throws Exception {

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestAbstractHttpEntity.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestAbstractHttpEntity.java?rev=936246&r1=936245&r2=936246&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestAbstractHttpEntity.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestAbstractHttpEntity.java
Wed Apr 21 10:38:34 2010
@@ -27,15 +27,13 @@
 
 package org.apache.http.entity;
 
+import junit.framework.TestCase;
+
 import org.apache.http.Header;
 import org.apache.http.message.BasicHeader;
 import org.apache.http.mockup.HttpEntityMockup;
 import org.apache.http.protocol.HTTP;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
 /**
  * Unit tests for {@link AbstractHttpEntity}.
  *
@@ -46,15 +44,6 @@ public class TestAbstractHttpEntity exte
         super(testName);
     }
 
-    public static void main(String args[]) {
-        String[] testCaseName = { TestAbstractHttpEntity.class.getName() };
-        junit.textui.TestRunner.main(testCaseName);
-    }
-
-    public static Test suite() {
-        return new TestSuite(TestAbstractHttpEntity.class);
-    }
-
     public void testContentType() throws Exception {
         HttpEntityMockup httpentity = new HttpEntityMockup();
         httpentity.setContentType(new BasicHeader(HTTP.CONTENT_TYPE, HTTP.PLAIN_TEXT_TYPE));

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestBasicHttpEntity.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestBasicHttpEntity.java?rev=936246&r1=936245&r2=936246&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestBasicHttpEntity.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestBasicHttpEntity.java
Wed Apr 21 10:38:34 2010
@@ -33,9 +33,7 @@ import java.io.InputStream;
 
 import org.apache.http.protocol.HTTP;
 
-import junit.framework.Test;
 import junit.framework.TestCase;
-import junit.framework.TestSuite;
 
 /**
  * Unit tests for {@link BasicHttpEntity}.
@@ -47,15 +45,6 @@ public class TestBasicHttpEntity extends
         super(testName);
     }
 
-    public static void main(String args[]) {
-        String[] testCaseName = { TestBasicHttpEntity.class.getName() };
-        junit.textui.TestRunner.main(testCaseName);
-    }
-
-    public static Test suite() {
-        return new TestSuite(TestBasicHttpEntity.class);
-    }
-
     public void testBasics() throws Exception {
         
         byte[] bytes = "Message content".getBytes(HTTP.US_ASCII);

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestBufferedHttpEntity.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestBufferedHttpEntity.java?rev=936246&r1=936245&r2=936246&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestBufferedHttpEntity.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestBufferedHttpEntity.java
Wed Apr 21 10:38:34 2010
@@ -30,9 +30,7 @@ package org.apache.http.entity;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 
-import junit.framework.Test;
 import junit.framework.TestCase;
-import junit.framework.TestSuite;
 
 import org.apache.http.protocol.HTTP;
 
@@ -46,15 +44,6 @@ public class TestBufferedHttpEntity exte
         super(testName);
     }
 
-    public static void main(String args[]) {
-        String[] testCaseName = { TestBufferedHttpEntity.class.getName() };
-        junit.textui.TestRunner.main(testCaseName);
-    }
-
-    public static Test suite() {
-        return new TestSuite(TestBufferedHttpEntity.class);
-    }
-
     public void testBufferingEntity() throws Exception {
         byte[] bytes = "Message content".getBytes(HTTP.US_ASCII);
         InputStreamEntity httpentity = new InputStreamEntity(new ByteArrayInputStream(bytes),
-1);

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestByteArrayEntity.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestByteArrayEntity.java?rev=936246&r1=936245&r2=936246&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestByteArrayEntity.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestByteArrayEntity.java
Wed Apr 21 10:38:34 2010
@@ -29,9 +29,7 @@ package org.apache.http.entity;
 
 import java.io.ByteArrayOutputStream;
 
-import junit.framework.Test;
 import junit.framework.TestCase;
-import junit.framework.TestSuite;
 
 import org.apache.http.protocol.HTTP;
 
@@ -45,15 +43,6 @@ public class TestByteArrayEntity extends
         super(testName);
     }
 
-    public static void main(String args[]) {
-        String[] testCaseName = { TestByteArrayEntity.class.getName() };
-        junit.textui.TestRunner.main(testCaseName);
-    }
-
-    public static Test suite() {
-        return new TestSuite(TestByteArrayEntity.class);
-    }
-
     public void testBasics() throws Exception {
         byte[] bytes = "Message content".getBytes(HTTP.US_ASCII);
         ByteArrayEntity httpentity = new ByteArrayEntity(bytes);

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestEntityTemplate.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestEntityTemplate.java?rev=936246&r1=936245&r2=936246&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestEntityTemplate.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestEntityTemplate.java
Wed Apr 21 10:38:34 2010
@@ -31,9 +31,7 @@ import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.OutputStream;
 
-import junit.framework.Test;
 import junit.framework.TestCase;
-import junit.framework.TestSuite;
 
 import org.apache.http.HttpEntity;
 
@@ -47,15 +45,6 @@ public class TestEntityTemplate extends 
         super(testName);
     }
 
-    public static void main(String args[]) {
-        String[] testCaseName = { TestEntityTemplate.class.getName() };
-        junit.textui.TestRunner.main(testCaseName);
-    }
-
-    public static Test suite() {
-        return new TestSuite(TestEntityTemplate.class);
-    }
-
     public void testBasics() throws Exception {
 
         HttpEntity httpentity = new EntityTemplate(new ContentProducer() {

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestFileEntity.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestFileEntity.java?rev=936246&r1=936245&r2=936246&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestFileEntity.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestFileEntity.java
Wed Apr 21 10:38:34 2010
@@ -31,9 +31,7 @@ import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.FileOutputStream;
 
-import junit.framework.Test;
 import junit.framework.TestCase;
-import junit.framework.TestSuite;
 
 import org.apache.http.protocol.HTTP;
 
@@ -47,15 +45,6 @@ public class TestFileEntity extends Test
         super(testName);
     }
 
-    public static void main(String args[]) {
-        String[] testCaseName = { TestFileEntity.class.getName() };
-        junit.textui.TestRunner.main(testCaseName);
-    }
-
-    public static Test suite() {
-        return new TestSuite(TestFileEntity.class);
-    }
-
     public void testBasics() throws Exception {
         File tmpfile = File.createTempFile("testfile", ".txt");
         tmpfile.deleteOnExit();

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestHttpEntityWrapper.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestHttpEntityWrapper.java?rev=936246&r1=936245&r2=936246&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestHttpEntityWrapper.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestHttpEntityWrapper.java
Wed Apr 21 10:38:34 2010
@@ -29,9 +29,7 @@ package org.apache.http.entity;
 
 import java.io.ByteArrayOutputStream;
 
-import junit.framework.Test;
 import junit.framework.TestCase;
-import junit.framework.TestSuite;
 
 import org.apache.http.protocol.HTTP;
 import org.apache.http.util.EntityUtils;
@@ -46,15 +44,6 @@ public class TestHttpEntityWrapper exten
         super(testName);
     }
 
-    public static void main(String args[]) {
-        String[] testCaseName = { TestHttpEntityWrapper.class.getName() };
-        junit.textui.TestRunner.main(testCaseName);
-    }
-
-    public static Test suite() {
-        return new TestSuite(TestHttpEntityWrapper.class);
-    }
-
     public void testBasics() throws Exception {
         String s = "Message content";
         StringEntity httpentity = new StringEntity(s, HTTP.ISO_8859_1);

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestInputStreamEntity.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestInputStreamEntity.java?rev=936246&r1=936245&r2=936246&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestInputStreamEntity.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestInputStreamEntity.java
Wed Apr 21 10:38:34 2010
@@ -31,11 +31,9 @@ import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
 
-import org.apache.http.protocol.HTTP;
-
-import junit.framework.Test;
 import junit.framework.TestCase;
-import junit.framework.TestSuite;
+
+import org.apache.http.protocol.HTTP;
 
 /**
  * Unit tests for {@link InputStreamEntity}.
@@ -47,15 +45,6 @@ public class TestInputStreamEntity exten
         super(testName);
     }
 
-    public static void main(String args[]) {
-        String[] testCaseName = { TestInputStreamEntity.class.getName() };
-        junit.textui.TestRunner.main(testCaseName);
-    }
-
-    public static Test suite() {
-        return new TestSuite(TestInputStreamEntity.class);
-    }
-
     public void testBasics() throws Exception {
         byte[] bytes = "Message content".getBytes(HTTP.ISO_8859_1);
         InputStream instream = new ByteArrayInputStream(bytes);

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestSerializableEntity.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestSerializableEntity.java?rev=936246&r1=936245&r2=936246&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestSerializableEntity.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestSerializableEntity.java
Wed Apr 21 10:38:34 2010
@@ -33,9 +33,7 @@ import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.io.Serializable;
 
-import junit.framework.Test;
 import junit.framework.TestCase;
-import junit.framework.TestSuite;
 
 public class TestSerializableEntity extends TestCase {
 
@@ -54,15 +52,6 @@ public class TestSerializableEntity exte
         super(testName);
     }
 
-    public static void main(String args[]) {
-        String[] testCaseName = { TestSerializableEntity.class.getName() };
-        junit.textui.TestRunner.main(testCaseName);
-    }
-
-    public static Test suite() {
-        return new TestSuite(TestSerializableEntity.class);
-    }
-
     public void testBasicsBuff() throws Exception {
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ObjectOutputStream out = new ObjectOutputStream(baos);

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestStringEntity.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestStringEntity.java?rev=936246&r1=936245&r2=936246&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestStringEntity.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/entity/TestStringEntity.java
Wed Apr 21 10:38:34 2010
@@ -29,9 +29,7 @@ package org.apache.http.entity;
 
 import java.io.ByteArrayOutputStream;
 
-import junit.framework.Test;
 import junit.framework.TestCase;
-import junit.framework.TestSuite;
 
 import org.apache.http.protocol.HTTP;
 
@@ -45,15 +43,6 @@ public class TestStringEntity extends Te
         super(testName);
     }
 
-    public static void main(String args[]) {
-        String[] testCaseName = { TestStringEntity.class.getName() };
-        junit.textui.TestRunner.main(testCaseName);
-    }
-
-    public static Test suite() {
-        return new TestSuite(TestStringEntity.class);
-    }
-
     public void testBasics() throws Exception {
         String s = "Message content";
         StringEntity httpentity = new StringEntity(s, HTTP.ISO_8859_1);



Mime
View raw message