NIFI-51 made a test a little nicer about cleanup as it kept messing up the build and addressed the possible NPE/ordering logic for 51

This commit is contained in:
joewitt 2014-12-23 16:05:43 -05:00
parent ed3452f527
commit 7f0eb2e352
2 changed files with 10 additions and 10 deletions

View File

@ -374,20 +374,18 @@ public class NiFiProperties extends Properties {
return getPropertyAsPort(REMOTE_INPUT_PORT, DEFAULT_REMOTE_INPUT_PORT);
}
/**
* @return False if property value is 'false'; True otherwise.
*/
public Boolean isSiteToSiteSecure() {
final String secureVal = getProperty(SITE_TO_SITE_SECURE);
if (secureVal == null) {
return null;
}
final String secureVal = getProperty(SITE_TO_SITE_SECURE, "true");
if ("true".equalsIgnoreCase(secureVal)) {
return true;
}
if ("false".equalsIgnoreCase(secureVal)) {
return false;
}else{
return true;
}
throw new IllegalStateException("Property value for " + SITE_TO_SITE_SECURE + " is " + secureVal + "; expected 'true' or 'false'");
}
/**

View File

@ -74,8 +74,8 @@ public class DataFlowManagementServiceImplTest {
@Before
public void setup() throws IOException {
primaryLocation = new File(System.getProperty("java.io.tmpdir") + "/primary");
restoreLocation = new File(System.getProperty("java.io.tmpdir") + "/restore");
primaryLocation = new File(System.getProperty("java.io.tmpdir") + "/primary" + this.getClass().getSimpleName());
restoreLocation = new File(System.getProperty("java.io.tmpdir") + "/restore" + this.getClass().getSimpleName());
FileUtils.deleteDirectory(primaryLocation);
FileUtils.deleteDirectory(restoreLocation);
@ -114,6 +114,8 @@ public class DataFlowManagementServiceImplTest {
ex.printStackTrace(System.out);
}
}
FileUtils.deleteDirectory(primaryLocation);
FileUtils.deleteDirectory(restoreLocation);
}