You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by ml...@apache.org on 2006/12/21 11:25:38 UTC
svn commit: r489315 -
/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/ConnectExceptionTest.java
Author: mloenko
Date: Thu Dec 21 02:25:38 2006
New Revision: 489315
URL: http://svn.apache.org/viewvc?view=rev&rev=489315
Log:
removed duplicates of SocketTest; followed Junit guidlines
Modified:
harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/ConnectExceptionTest.java
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/ConnectExceptionTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/ConnectExceptionTest.java?view=diff&rev=489315&r1=489314&r2=489315
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/ConnectExceptionTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/ConnectExceptionTest.java Thu Dec 21 02:25:38 2006
@@ -27,48 +27,10 @@
/**
* @tests java.net.ConnectException#ConnectException()
+ * @tests java.net.ConnectException#ConnectException(java.lang.String)
*/
public void test_Constructor() {
- // Test for method java.net.ConnectException()
-
- try {
- int portNumber = Support_PortManager.getNextPort();
- new Socket(InetAddress.getLocalHost().getHostName(), portNumber);
- } catch (ConnectException e) {
- return;
- } catch (Exception e) {
- fail("Exception during Constructor test : " + e.getMessage());
- }
- fail("Failed to generate exception");
- }
-
- /**
- * @tests java.net.ConnectException#ConnectException(java.lang.String)
- */
- public void test_ConstructorLjava_lang_String() {
- // Test for method java.net.ConnectException(java.lang.String)
- try {
- int portNumber = Support_PortManager.getNextPort();
- new Socket(InetAddress.getLocalHost().getHostName(), portNumber);
- } catch (ConnectException e) {
- return;
- } catch (Exception e) {
- fail("Exception during Constructor test : " + e.getMessage());
- }
- fail("Failed to generate exception");
- }
-
- /**
- * Sets up the fixture, for example, open a network connection. This method
- * is called before a test is executed.
- */
- protected void setUp() {
- }
-
- /**
- * Tears down the fixture, for example, close a network connection. This
- * method is called after a test is executed.
- */
- protected void tearDown() {
+ assertNull("Wrong message", new ConnectException().getMessage());
+ assertEquals("Wrong message", "message", new ConnectException("message").getMessage());
}
}