1 19 package org.netbeans.core.startup.preferences; 20 21 import java.util.prefs.Preferences ; 22 import java.util.prefs.PreferencesFactory ; 23 import org.netbeans.junit.MockServices; 24 import org.netbeans.junit.NbTestCase; 25 26 29 public class TestNbPreferencesFactory extends NbPreferencesTest.TestBasicSetup { 30 public TestNbPreferencesFactory(String testName) { 31 super(testName); 32 } 33 34 37 public void testUserRoot() { 38 assertSame(new NbPreferencesFactory().userRoot().getClass(), Preferences.userRoot().getClass()); 39 assertNotNull(Preferences.userRoot()); 40 assertTrue(Preferences.userRoot().isUserNode()); 41 assertTrue(Preferences.userRoot() instanceof NbPreferences); 42 } 43 44 47 public void testSystemRoot() { 48 assertSame(new NbPreferencesFactory().systemRoot(), Preferences.systemRoot()); 49 assertNotNull(Preferences.systemRoot()); 50 assertFalse(Preferences.systemRoot().isUserNode()); 51 assertTrue(Preferences.systemRoot() instanceof NbPreferences); 52 } 53 54 protected void setUp() throws Exception { 55 super.setUp(); 56 } 57 } 58 | Popular Tags |