use of jmri.profile.Profile in project JMRI by JMRI.
the class JmriJTablePersistenceManagerTest method testInitialize.
/**
* Test of initialize method, of class JmriJTablePersistenceManager.
*/
@Test
@Ignore
public void testInitialize() throws Exception {
System.out.println("initialize");
Profile profile = null;
JmriJTablePersistenceManager instance = new JmriJTablePersistenceManager();
instance.initialize(profile);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
use of jmri.profile.Profile in project JMRI by JMRI.
the class JmriJTablePersistenceManagerTest method testSavePreferences.
/**
* Test of savePreferences method, of class JmriJTablePersistenceManager.
*/
@Test
@Ignore
public void testSavePreferences() {
System.out.println("savePreferences");
Profile profile = null;
JmriJTablePersistenceManager instance = new JmriJTablePersistenceManager();
instance.savePreferences(profile);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
use of jmri.profile.Profile in project JMRI by JMRI.
the class JmriConfigurationProviderTest method testGetConfigurationFragment.
public void testGetConfigurationFragment() throws IOException {
String id = Long.toString((new Date()).getTime());
String elementName = "test:testElement";
String namespace = "test";
Profile project = new Profile(this.getName(), id, new File(this.workspace.toFile(), id));
AuxiliaryConfiguration config = JmriConfigurationProvider.getConfiguration(project);
Element e = config.getConfigurationFragment(elementName, namespace, true);
assertNull(e);
e = document.createElementNS(namespace, elementName);
config.putConfigurationFragment(e, true);
FileUtil.delete(project.getPath());
}
use of jmri.profile.Profile in project JMRI by JMRI.
the class JmriPreferencesProviderTest method testGetPreferences.
/**
* Test of getPreferences method, of class JmriPreferencesProvider.
* @throws java.io.IOException
*/
public void testGetPreferences() throws IOException {
String id = Long.toString((new Date()).getTime());
Profile project = new Profile(this.getName(), id, new File(this.workspace.toFile(), id));
Class<?> clazz = this.getClass();
Preferences shared = JmriPreferencesProvider.getPreferences(project, clazz, true);
Preferences privat = JmriPreferencesProvider.getPreferences(project, clazz, false);
assertNotNull(shared);
assertNotNull(privat);
assertNotSame(shared, privat);
try {
assertEquals(shared.keys().length, 0);
} catch (BackingStoreException ex) {
assertNotNull(ex);
}
try {
assertEquals(privat.keys().length, 0);
} catch (BackingStoreException ex) {
assertNotNull(ex);
}
FileUtil.delete(project.getPath());
}
use of jmri.profile.Profile in project JMRI by JMRI.
the class JmriPreferencesProviderTest method testIsFirstUse.
/**
* Test of isFirstUse method, of class JmriPreferencesProvider.
* @throws java.io.IOException
*/
public void testIsFirstUse() throws IOException {
String id = Long.toString((new Date()).getTime());
Profile project = new Profile(this.getName(), id, new File(this.workspace.toFile(), id));
JmriPreferencesProvider shared = JmriPreferencesProvider.findProvider(project.getPath(), true);
assertEquals(shared.isFirstUse(), true);
Preferences prefs = shared.getPreferences(this.getClass());
prefs.put("test", "test");
try {
// force write
prefs.flush();
} catch (BackingStoreException ex) {
assertNull(ex);
}
shared = new JmriPreferencesProvider(project.getPath(), true);
assertEquals(shared.isFirstUse(), false);
}
Aggregations