You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by li...@apache.org on 2007/03/13 03:46:50 UTC
svn commit: r517502 -
/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/FileNotFoundExceptionTest.java
Author: liangyx
Date: Mon Mar 12 19:46:49 2007
New Revision: 517502
URL: http://svn.apache.org/viewvc?view=rev&rev=517502
Log:
Apply patch for HARMONY-3353([classlib][test] Refactor test for java.io.FileNotFoundException's constructor)
Modified:
harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/FileNotFoundExceptionTest.java
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/FileNotFoundExceptionTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/FileNotFoundExceptionTest.java?view=diff&rev=517502&r1=517501&r2=517502
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/FileNotFoundExceptionTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/FileNotFoundExceptionTest.java Mon Mar 12 19:46:49 2007
@@ -17,32 +17,25 @@
package tests.api.java.io;
+import java.io.FileNotFoundException;
+
public class FileNotFoundExceptionTest extends junit.framework.TestCase {
- /**
- * @tests java.io.FileNotFoundException#FileNotFoundException()
- */
- public void test_Constructor() {
- // Test for method java.io.FileNotFoundException()
- try {
- new java.io.FileInputStream("9://0//l");
- } catch (java.io.FileNotFoundException e) {
- return;
- }
- fail("Failed to generate Exception");
- }
+ /**
+ * @tests java.io.FileNotFoundException#FileNotFoundException()
+ */
+ public void test_Constructor() {
+ FileNotFoundException e = new FileNotFoundException();
+ assertNull(e.getMessage());
+ }
/**
* @tests java.io.FileNotFoundException#FileNotFoundException(java.lang.String)
*/
public void test_ConstructorLjava_lang_String() {
- // Test for method java.io.FileNotFoundException(java.lang.String)
- try {
- new java.io.FileInputStream("9://0//l");
- } catch (java.io.FileNotFoundException e) {
- return;
- }
- fail("Failed to generate Exception");
+ String message = "Cannot found file: 9://0//l";
+ FileNotFoundException e = new FileNotFoundException(message);
+ assertSame(message, e.getMessage());
}
/**