ConfigurationMngrImpl implements IConfigurationMngr { @Override public File getWorkingDirectory() { return this.workingDirectory; } ConfigurationMngrImpl(); @Override File getWorkingDirectory(); @Override void setWorkingDirectory( File workingDirectory ); @Override File findIconFromPath( String urlPath );  }
@Test public void testDefault_notInKaraf() { File defaultConfigurationDirectory = new File( System.getProperty( "java.io.tmpdir" ), "roboconf-dm" ); Assert.assertEquals( defaultConfigurationDirectory, this.mngr.getWorkingDirectory()); }
@Test public void testDefault_inKaraf() throws Exception { File dir = this.folder.newFolder(); try { System.setProperty( "karaf.data", dir.getAbsolutePath()); this.mngr = new ConfigurationMngrImpl(); Assert.assertEquals( new File( dir, "roboconf" ), this.mngr.getWorkingDirectory()); } finally { System.setProperty( "karaf.data", "" ); } }