Tries to fix the build (tests).

cusax-fix
Lyubomir Marinov 14 years ago
parent 34d54b1d84
commit 5986cc0119

@ -592,6 +592,10 @@
<!-- Tell the slick runner where to store test results. --> <!-- Tell the slick runner where to store test results. -->
<sysproperty key="net.java.sip.communicator.slick.runner.OUTPUT_DIR" <sysproperty key="net.java.sip.communicator.slick.runner.OUTPUT_DIR"
value="${test.reports.dir}"/> value="${test.reports.dir}"/>
<sysproperty key="net.java.sip.communicator.SC_HOME_DIR_LOCATION"
value="${test.reports.dir}"/>
<sysproperty key="net.java.sip.communicator.SC_HOME_DIR_NAME"
value="schome"/>
<!-- Tell the slick runner which Test classes to run. --> <!-- Tell the slick runner which Test classes to run. -->
<sysproperty key="net.java.sip.communicator.slick.runner.TEST_LIST" <sysproperty key="net.java.sip.communicator.slick.runner.TEST_LIST"
@ -689,6 +693,10 @@
<!-- Tell the slick runner where to store test results. --> <!-- Tell the slick runner where to store test results. -->
<sysproperty key="net.java.sip.communicator.slick.runner.OUTPUT_DIR" <sysproperty key="net.java.sip.communicator.slick.runner.OUTPUT_DIR"
value="${test.reports.dir}"/> value="${test.reports.dir}"/>
<sysproperty key="net.java.sip.communicator.SC_HOME_DIR_LOCATION"
value="${test.reports.dir}"/>
<sysproperty key="net.java.sip.communicator.SC_HOME_DIR_NAME"
value="schome"/>
<!-- use a meta contact list file different to normal client. --> <!-- use a meta contact list file different to normal client. -->
<sysproperty key="net.java.sip.communicator.CONTACTLIST_FILE_NAME" <sysproperty key="net.java.sip.communicator.CONTACTLIST_FILE_NAME"

@ -94,13 +94,14 @@ public Iterator<HistoryID> getExistingIDs()
List<File> vect = new Vector<File>(); List<File> vect = new Vector<File>();
File histDir = null; File histDir = null;
try { try {
String userSetDataDirectory = System.getProperty("HistoryServiceDirectory"); String userSetDataDirectory
if(userSetDataDirectory != null) = System.getProperty("HistoryServiceDirectory");
histDir = this.fileAccessService
.getPrivatePersistentDirectory(userSetDataDirectory); histDir
else = getFileAccessService().getPrivatePersistentDirectory(
histDir = this.fileAccessService (userSetDataDirectory == null)
.getPrivatePersistentDirectory(DATA_DIRECTORY); ? DATA_DIRECTORY
: userSetDataDirectory);
findDatFiles(vect, histDir); findDatFiles(vect, histDir);
} catch (Exception e) } catch (Exception e)
@ -259,15 +260,20 @@ private File createHistoryDirectories(HistoryID id)
System.arraycopy(idComponents, 0, dirs, 1, dirs.length - 1); System.arraycopy(idComponents, 0, dirs, 1, dirs.length - 1);
File directory = null; File directory = null;
try { try
directory = this.fileAccessService
.getPrivatePersistentDirectory(dirs);
} catch (Exception e)
{ {
throw (IOException) new IOException( directory
"Could not create history due to file system error") = getFileAccessService().getPrivatePersistentDirectory(dirs);
.initCause(e); }
} catch (Exception e)
{
IOException ioe
= new IOException(
"Could not create history due to file system error");
ioe.initCause(e);
throw ioe;
}
if (!directory.exists() && !directory.mkdirs()) if (!directory.exists() && !directory.mkdirs())
{ {
@ -363,13 +369,9 @@ private static ConfigurationService getConfigurationService(
} }
private static FileAccessService getFileAccessService( private static FileAccessService getFileAccessService(
BundleContext bundleContext) BundleContext bundleContext)
{ {
ServiceReference serviceReference = return ServiceUtils.getService(bundleContext, FileAccessService.class);
bundleContext
.getServiceReference(FileAccessService.class.getName());
return (serviceReference == null) ? null
: (FileAccessService) bundleContext.getService(serviceReference);
} }
/** /**
@ -416,9 +418,7 @@ private File getDirForHistory(HistoryID id)
for (int i = 0; i < dirNames.length; i++) for (int i = 0; i < dirNames.length; i++)
{ {
if (i > 0) if (i > 0)
{
dirName.append(File.separatorChar); dirName.append(File.separatorChar);
}
dirName.append(dirNames[i]); dirName.append(dirNames[i]);
} }
@ -426,18 +426,16 @@ private File getDirForHistory(HistoryID id)
File histDir = null; File histDir = null;
try try
{ {
String userSetDataDirectory = String userSetDataDirectory
System.getProperty("HistoryServiceDirectory"); = System.getProperty("HistoryServiceDirectory");
if(userSetDataDirectory != null) histDir
histDir = this.fileAccessService = getFileAccessService().getPrivatePersistentDirectory(
.getPrivatePersistentDirectory(userSetDataDirectory); (userSetDataDirectory == null)
else ? DATA_DIRECTORY
histDir = this.fileAccessService : userSetDataDirectory);
.getPrivatePersistentDirectory(DATA_DIRECTORY); }
catch (Exception e)
} catch (Exception e)
{ {
logger.error("Error opening directory", e); logger.error("Error opening directory", e);
} }

Loading…
Cancel
Save