DATAES-194 - Tests should clean up "data" directory.

This commit is contained in:
Mohsin Husen
2015-09-17 12:02:51 +01:00
parent 49708d38c0
commit c2f13c3820
11 changed files with 76 additions and 50 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -40,6 +40,7 @@ public class NodeClientFactoryBean implements FactoryBean<NodeClient>, Initializ
private boolean enableHttp;
private String clusterName;
private NodeClient nodeClient;
private String pathData;
NodeClientFactoryBean() {
}
@@ -65,8 +66,10 @@ public class NodeClientFactoryBean implements FactoryBean<NodeClient>, Initializ
@Override
public void afterPropertiesSet() throws Exception {
ImmutableSettings.Builder settings = ImmutableSettings.settingsBuilder().put("http.enabled",
String.valueOf(this.enableHttp));
ImmutableSettings.Builder settings = ImmutableSettings.settingsBuilder()
.put("http.enabled", String.valueOf(this.enableHttp))
.put("path.data", this.pathData);
nodeClient = (NodeClient) nodeBuilder().settings(settings).clusterName(this.clusterName).local(this.local).node()
.client();
@@ -84,6 +87,10 @@ public class NodeClientFactoryBean implements FactoryBean<NodeClient>, Initializ
this.clusterName = clusterName;
}
public void setPathData(String pathData) {
this.pathData = pathData;
}
@Override
public void destroy() throws Exception {
try {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -43,6 +43,7 @@ public class NodeClientBeanDefinitionParser extends AbstractBeanDefinitionParser
builder.addPropertyValue("local", Boolean.valueOf(element.getAttribute("local")));
builder.addPropertyValue("clusterName", element.getAttribute("cluster-name"));
builder.addPropertyValue("enableHttp", Boolean.valueOf(element.getAttribute("http-enabled")));
builder.addPropertyValue("pathData", element.getAttribute("path-data"));
}
private AbstractBeanDefinition getSourcedBeanDefinition(BeanDefinitionBuilder builder, Element source,