bloritsch 2003/06/10 07:19:35
Modified: sourceresolve/src/test/org/apache/excalibur/source/test
FileSourceTestCase.java
Log:
minor updates to make test a bit more robust--but more work is needed.
Revision Changes Path
1.5 +9 -9
avalon-excalibur/sourceresolve/src/test/org/apache/excalibur/source/test/FileSourceTestCase.java
Index: FileSourceTestCase.java
===================================================================
RCS file:
/home/cvs/avalon-excalibur/sourceresolve/src/test/org/apache/excalibur/source/test/FileSourceTestCase.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- FileSourceTestCase.java 10 Jun 2003 14:15:31 -0000 1.4
+++ FileSourceTestCase.java 10 Jun 2003 14:19:35 -0000 1.5
@@ -70,7 +70,7 @@
/**
* Test case for FileSource.
- *
+ *
* @author <a href="mailto:[EMAIL PROTECTED]">Sylvain Wallez</a>
* @version $Id$
*/
@@ -215,12 +215,12 @@
FileSource child = (FileSource) src.getChild("child.txt");
assertTrue("New file already exists", !child.exists());
- OutputStream os = child.getOutputStream();
+ child.getOutputStream();
try
{
// Get it a second time
- OutputStream os2 = child.getOutputStream();
+ child.getOutputStream();
}
catch (ConcurrentModificationException cme)
{
@@ -244,9 +244,9 @@
SourceValidity validity = child.getValidity();
assertEquals("Validity is not valid", 1, validity.isValid());
- // Wait 1 second before updating the file
- Thread.sleep(2000L);
-
+ // Wait 2 seconds before updating the file
+ Thread.sleep(2 * 1000L);
+
// Now change its content
PrintWriter pw = new PrintWriter(child.getOutputStream());
pw.write(text);
@@ -256,7 +256,7 @@
pw.close();
assertTrue("File length not modified", length != child.getContentLength());
-
+
assertEquals("Validity is valid", -1, validity.isValid());
}
@@ -285,7 +285,7 @@
OutputStream os = src.getOutputStream();
PrintWriter pw = new PrintWriter(os);
- pw.println("Writing to a source");
+ pw.println(text);
pw.close();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]