package sis.util; import junit.framework.*; import java.io.*; public class TestUtil { public static void assertGone(String... filenames) { for (String filename: filenames) Assert.assertFalse(new File(filename).exists()); } public static void delete(String filename) { File file = new File(filename); if (file.exists()) Assert.assertTrue(file.delete()); } } Only tests use code in the TestUtil class. Since TestUtil does not extend from junit.framework.TestCase, it does not have instance access to any assert methods. However, the class junit.framework.Assert defines the assert methods as class methods, allowing you to access them anywhere. Other things you will need to do:
|