Skip to content
Browse files

minor JU4 updates

  • Loading branch information...
bobjacobsen committed Sep 9, 2018
1 parent d9393ef commit c02b773dc88c0d787bddcda1e4938464d8539026
Showing with 15 additions and 4 deletions.
  1. +15 −4 help/en/html/doc/Technical/JUnit.shtml
@@ -672,15 +672,16 @@
You then reference "folder" in your test code:
<pre style="font-family: monospace;">
// create a file in "temp"
File rosterDir = folder.newFolder();
File backupDir = folder.newFolder();
// create a temporary file
File randomNameFile = folder.newFile();
// create a temporary directory
File randomNameDir = folder.newFolder();

JUnit4 will make sure the file or folder is removed afterwards regardless of whether the
test succeeds or fails. For more information on this, see the
<a href="">Javadoc for TemporaryFolderTest</a>.
<a href="">Javadoc for TemporaryFolder</a>.

If you're not using JUnit4, consider converting the
@@ -1172,6 +1173,16 @@ import org.junit.Test;

<li>If you have bare <code>assert</code> calls, like
<pre style="font-family: monospace;">
assertEquals(k, ind);
change them to the JUnit4 form:
<pre style="font-family: monospace;">
Assert.assertEquals(k, ind);

<li>More of our Test classes have a "from here down is
testing infrastructure" comment, followed by setup code.
Some of that can be removed. First, remove the class

0 comments on commit c02b773

Please sign in to comment.
You can’t perform that action at this time.