perfsonar-dev - [pS-dev] [GEANT/SA2/ps-java-services] r5716 - in trunk/perfsonar-java-base2/src: main/java/org/perfsonar/base2/service/configuration/migration test/java/org/perfsonar/base2/service/configuration/migration
Subject: perfsonar development work
List archive
[pS-dev] [GEANT/SA2/ps-java-services] r5716 - in trunk/perfsonar-java-base2/src: main/java/org/perfsonar/base2/service/configuration/migration test/java/org/perfsonar/base2/service/configuration/migration
Chronological Thread
- From:
- To:
- Subject: [pS-dev] [GEANT/SA2/ps-java-services] r5716 - in trunk/perfsonar-java-base2/src: main/java/org/perfsonar/base2/service/configuration/migration test/java/org/perfsonar/base2/service/configuration/migration
- Date: Mon, 9 Aug 2010 15:48:59 +0100
Author: psnc.pietrzak
Date: 2010-08-09 15:48:59 +0100 (Mon, 09 Aug 2010)
New Revision: 5716
Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/migration/ConfigFilesCollection.java
trunk/perfsonar-java-base2/src/test/java/org/perfsonar/base2/service/configuration/migration/ConfigFilesCollectionTest.java
Log:
PSSERVICES-484 When the config directory does not exist the exception is not
thrown.
Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/migration/ConfigFilesCollection.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/migration/ConfigFilesCollection.java
2010-08-09 11:37:32 UTC (rev 5715)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/migration/ConfigFilesCollection.java
2010-08-09 14:48:59 UTC (rev 5716)
@@ -65,7 +65,7 @@
final File file = getConfigPath();
if (!file.exists())
- throw new FileNotFoundException("File: " +
file.getAbsolutePath() + " does not exist.");
+ return result;
if (!file.isDirectory())
throw new IOException("Invalid directory path: " +
configPath);
Modified:
trunk/perfsonar-java-base2/src/test/java/org/perfsonar/base2/service/configuration/migration/ConfigFilesCollectionTest.java
===================================================================
---
trunk/perfsonar-java-base2/src/test/java/org/perfsonar/base2/service/configuration/migration/ConfigFilesCollectionTest.java
2010-08-09 11:37:32 UTC (rev 5715)
+++
trunk/perfsonar-java-base2/src/test/java/org/perfsonar/base2/service/configuration/migration/ConfigFilesCollectionTest.java
2010-08-09 14:48:59 UTC (rev 5716)
@@ -48,18 +48,12 @@
public void testGetFilesDirectoryDoesNotExist() throws IOException {
configCollection = new ConfigFilesCollection(new
File(CONFIG_PATH + File.separator + "does_not_exist"));
- try {
- configCollection.getFiles();
- fail("FileNotFoundException not thrown for non
existing directory.");
- } catch (FileNotFoundException ex) { }
+ assertEquals(0, configCollection.getFiles().size());
}
- public void testGetFilesFilePath() {
+ public void testGetFilesFilePath() throws IOException {
configCollection = new ConfigFilesCollection(new
File(CONFIG_PATH + File.separator + "ConfigurationMigratorTest.class"));
- try {
- configCollection.getFiles();
- fail("IOException not thrown for invalid directory
path.");
- } catch (IOException ex) { }
+ assertEquals(0, configCollection.getFiles().size());
}
public void testRemoveFiles() throws IOException {
- [pS-dev] [GEANT/SA2/ps-java-services] r5716 - in trunk/perfsonar-java-base2/src: main/java/org/perfsonar/base2/service/configuration/migration test/java/org/perfsonar/base2/service/configuration/migration, svn-noreply, 08/09/2010
Archive powered by MHonArc 2.6.16.