1 19 20 package org.netbeans.core.startup.preferences; 21 22 import java.util.prefs.Preferences ; 23 import junit.framework.Test; 24 import junit.framework.TestResult; 25 import junit.framework.TestSuite; 26 import org.netbeans.junit.NbTestCase; 27 28 32 public class NbPreferencesTest extends NbTestCase { 33 public NbPreferencesTest(String testName) { 34 super(testName); 35 } 36 37 public static Test suite() { 38 TestSuite suite = new TestSuite(); 39 suite.addTestSuite(TestPreferences.class); 40 suite.addTestSuite(TestFileStorage.class); 41 suite.addTestSuite(TestPropertiesStorage.class); 42 suite.addTestSuite(TestNbPreferencesFactory.class); 43 44 return suite; 45 } 46 47 public static class TestBasicSetup extends NbTestCase { 48 public TestBasicSetup(String testName) { 49 super(testName); 50 } 51 52 public void run(final TestResult result) { 53 NbPreferencesFactory.doRegistration(); 55 Preferences.userRoot(); 56 super.run(result); 57 } 58 59 protected void tearDown() throws Exception { 60 super.tearDown(); 61 67 } 68 69 protected void setUp() throws Exception { 70 super.setUp(); 71 Statistics.CHILDREN_NAMES.reset(); 72 Statistics.FLUSH.reset(); 73 Statistics.LOAD.reset(); 74 Statistics.REMOVE_NODE.reset(); 75 } 76 } 77 } | Popular Tags |