You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by la...@apache.org on 2012/02/16 20:07:58 UTC
svn commit: r1245121 - in
/incubator/airavata/trunk/modules/commons/registry-api/src/test/java/org/apache/airavata/registry/api/impl:
JCRRegistryDeleteTest.java JCRRegistryRestartTest.java
JCRRegistrySearchTest.java JCRRegistryTest.java
Author: lahiru
Date: Thu Feb 16 19:07:57 2012
New Revision: 1245121
URL: http://svn.apache.org/viewvc?rev=1245121&view=rev
Log:
fixing registry-api tests.
Modified:
incubator/airavata/trunk/modules/commons/registry-api/src/test/java/org/apache/airavata/registry/api/impl/JCRRegistryDeleteTest.java
incubator/airavata/trunk/modules/commons/registry-api/src/test/java/org/apache/airavata/registry/api/impl/JCRRegistryRestartTest.java
incubator/airavata/trunk/modules/commons/registry-api/src/test/java/org/apache/airavata/registry/api/impl/JCRRegistrySearchTest.java
incubator/airavata/trunk/modules/commons/registry-api/src/test/java/org/apache/airavata/registry/api/impl/JCRRegistryTest.java
Modified: incubator/airavata/trunk/modules/commons/registry-api/src/test/java/org/apache/airavata/registry/api/impl/JCRRegistryDeleteTest.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/test/java/org/apache/airavata/registry/api/impl/JCRRegistryDeleteTest.java?rev=1245121&r1=1245120&r2=1245121&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/test/java/org/apache/airavata/registry/api/impl/JCRRegistryDeleteTest.java (original)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/test/java/org/apache/airavata/registry/api/impl/JCRRegistryDeleteTest.java Thu Feb 16 19:07:57 2012
@@ -45,7 +45,7 @@ public class JCRRegistryDeleteTest {
* Create database
*/
Map<String,String> config = new HashMap<String,String>();
- config.put("org.apache.jackrabbit.repository.home","target");
+ config.put("org.apache.jackrabbit.repository.home","target" + File.separator + "jackrabbit1");
AiravataJCRRegistry jcrRegistry = new AiravataJCRRegistry(null, "org.apache.jackrabbit.core.RepositoryFactoryImpl",
"admin", "admin", config);
@@ -79,7 +79,7 @@ public class JCRRegistryDeleteTest {
* Create database
*/
Map<String,String> config = new HashMap<String,String>();
- config.put("org.apache.jackrabbit.repository.home","target");
+ config.put("org.apache.jackrabbit.repository.home","target" + File.separator + "jackrabbit2");
AiravataJCRRegistry jcrRegistry = new AiravataJCRRegistry(null, "org.apache.jackrabbit.core.RepositoryFactoryImpl",
"admin", "admin", config);
@@ -116,11 +116,5 @@ public class JCRRegistryDeleteTest {
Assert.assertTrue(false);
}
- @After
- public void cleanup(){
- File jackrabbit = new File(".");
- String s = jackrabbit.getAbsolutePath() + File.separator +
- "modules" + File.separator + "registry-api" + File.separator +"jackrabbit";
- IOUtil.deleteDirectory(new File(s));
- }
+
}
Modified: incubator/airavata/trunk/modules/commons/registry-api/src/test/java/org/apache/airavata/registry/api/impl/JCRRegistryRestartTest.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/test/java/org/apache/airavata/registry/api/impl/JCRRegistryRestartTest.java?rev=1245121&r1=1245120&r2=1245121&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/test/java/org/apache/airavata/registry/api/impl/JCRRegistryRestartTest.java (original)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/test/java/org/apache/airavata/registry/api/impl/JCRRegistryRestartTest.java Thu Feb 16 19:07:57 2012
@@ -48,7 +48,7 @@ public class JCRRegistryRestartTest {
* Create database
*/
Map<String,String> config = new HashMap<String,String>();
- config.put("org.apache.jackrabbit.repository.home","target");
+ config.put("org.apache.jackrabbit.repository.home","target" + File.separator + "jackrabbit3");
AiravataJCRRegistry jcrRegistry = new AiravataJCRRegistry(null, "org.apache.jackrabbit.core.RepositoryFactoryImpl",
"admin", "admin", config);
@@ -82,12 +82,5 @@ public class JCRRegistryRestartTest {
fail(e.getMessage());
}
}
- @After
- public void cleanup(){
- File jackrabbit = new File(".");
- String s = jackrabbit.getAbsolutePath() + File.separator +
- "modules" + File.separator + "registry-api" + File.separator +"jackrabbit";
- IOUtil.deleteDirectory(new File(s));
- }
}
Modified: incubator/airavata/trunk/modules/commons/registry-api/src/test/java/org/apache/airavata/registry/api/impl/JCRRegistrySearchTest.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/test/java/org/apache/airavata/registry/api/impl/JCRRegistrySearchTest.java?rev=1245121&r1=1245120&r2=1245121&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/test/java/org/apache/airavata/registry/api/impl/JCRRegistrySearchTest.java (original)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/test/java/org/apache/airavata/registry/api/impl/JCRRegistrySearchTest.java Thu Feb 16 19:07:57 2012
@@ -45,17 +45,16 @@ import org.junit.Test;
public class JCRRegistrySearchTest {
@Before
- public void setUp() throws Exception {
- /*
- * Create database
- */
- Map<String,String> config = new HashMap<String,String>();
- config.put("org.apache.jackrabbit.repository.home","target");
- AiravataJCRRegistry jcrRegistry = new AiravataJCRRegistry(null,
- "org.apache.jackrabbit.core.RepositoryFactoryImpl", "admin",
- "admin", config);
- /*
+ @Test
+ public void searchServiceDescriptionTest() {
+ try {
+ Map<String,String> config = new HashMap<String,String>();
+ config.put("org.apache.jackrabbit.repository.home", "target" + File.separator + "jackrabbit10");
+ AiravataJCRRegistry jcrRegistry = new AiravataJCRRegistry(null,
+ "org.apache.jackrabbit.core.RepositoryFactoryImpl", "admin",
+ "admin", config);
+ /*
* Host
*/
HostDescription host = new HostDescription();
@@ -134,17 +133,6 @@ public class JCRRegistrySearchTest {
.getType().getHostName());
jcrRegistry.deployServiceOnHost(serv1.getType().getName(), host1
.getType().getHostName());
-
- }
-
- @Test
- public void searchServiceDescriptionTest() {
- try {
- Map<String,String> config = new HashMap<String,String>();
- config.put("org.apache.jackrabbit.repository.home","target");
- AiravataJCRRegistry jcrRegistry = new AiravataJCRRegistry(null,
- "org.apache.jackrabbit.core.RepositoryFactoryImpl", "admin",
- "admin", config);
List<ServiceDescription> simpleEcho = jcrRegistry.searchServiceDescription("SimpleEchoSearch");
if(simpleEcho.size() == 0){
Assert.assertTrue(false);
@@ -163,10 +151,89 @@ public class JCRRegistrySearchTest {
public void searchDeploymentDescriptorTest() {
try {
Map<String,String> config = new HashMap<String,String>();
- config.put("org.apache.jackrabbit.repository.home","target");
+ config.put("org.apache.jackrabbit.repository.home","target" + File.separator + "jackrabbit11" );
AiravataJCRRegistry jcrRegistry = new AiravataJCRRegistry(null,
"org.apache.jackrabbit.core.RepositoryFactoryImpl", "admin",
"admin", config);
+ /*
+ * Host
+ */
+ HostDescription host = new HostDescription();
+ host.getType().setHostName("localhostsearch");
+ host.getType().setHostAddress("localhost");
+
+ HostDescription host1 = new HostDescription();
+ host1.getType().setHostName("localhost");
+ host1.getType().setHostAddress("121.121.12.121");
+
+ /*
+ * App
+ */
+ ApplicationDeploymentDescription appDesc = new ApplicationDeploymentDescription();
+ ApplicationDeploymentDescriptionType app = appDesc.getType();
+ ApplicationDeploymentDescriptionType.ApplicationName name = ApplicationDeploymentDescriptionType.ApplicationName.Factory.newInstance();
+ name.setStringValue("EchoLocalSearch");
+ app.setApplicationName(name);
+ app.setExecutableLocation("/bin/echo");
+ app.setScratchWorkingDirectory("/tmp");
+ app.setStaticWorkingDirectory("/tmp");
+ app.setInputDataDirectory("/tmp/input");
+ app.setOutputDataDirectory("/tmp/output");
+ app.setStandardOutput("/tmp/echo.stdout");
+ app.setStandardError("/tmp/echo.stdout");
+
+ /*
+ * Service
+ */
+ ServiceDescription serv = new ServiceDescription();
+ serv.getType().setName("SimpleEchoSearch");
+
+ ServiceDescription serv1 = new ServiceDescription();
+ serv1.getType().setName("MathService");
+
+ List<InputParameterType> inputList = new ArrayList<InputParameterType>();
+ InputParameterType input = InputParameterType.Factory.newInstance();
+ input.setParameterName("echo_input");
+ input.setParameterType(StringParameterType.Factory.newInstance());
+ inputList.add(input);
+ InputParameterType[] inputParamList = inputList.toArray(new InputParameterType[inputList
+ .size()]);
+
+ List<OutputParameterType> outputList = new ArrayList<OutputParameterType>();
+ OutputParameterType output = OutputParameterType.Factory.newInstance();
+ output.setParameterName("echo_output");
+ output.setParameterType(StringParameterType.Factory.newInstance());
+ outputList.add(output);
+ OutputParameterType[] outputParamList = outputList
+ .toArray(new OutputParameterType[outputList.size()]);
+
+ serv.getType().setInputParametersArray(inputParamList);
+ serv.getType().setOutputParametersArray(outputParamList);
+
+ serv1.getType().setInputParametersArray(inputParamList);
+ serv1.getType().setOutputParametersArray(outputParamList);
+
+ /*
+ * Save to registry
+ */
+ jcrRegistry.saveHostDescription(host);
+ jcrRegistry.saveHostDescription(host1);
+
+ jcrRegistry.saveDeploymentDescription(serv.getType().getName(), host
+ .getType().getHostName(), appDesc);
+ jcrRegistry.saveDeploymentDescription(serv1.getType().getName(), host
+ .getType().getHostName(), appDesc);
+ jcrRegistry.saveDeploymentDescription(serv1.getType().getName(), host1
+ .getType().getHostName(), appDesc);
+
+ jcrRegistry.saveServiceDescription(serv);
+ jcrRegistry.saveServiceDescription(serv1);
+ jcrRegistry.deployServiceOnHost(serv.getType().getName(), host
+ .getType().getHostName());
+ jcrRegistry.deployServiceOnHost(serv1.getType().getName(), host
+ .getType().getHostName());
+ jcrRegistry.deployServiceOnHost(serv1.getType().getName(), host1
+ .getType().getHostName());
Map<ApplicationDeploymentDescription,String> applicationDeploymentDescriptionStringMap = jcrRegistry.searchDeploymentDescription();
if(applicationDeploymentDescriptionStringMap.size() == 0){
Assert.assertTrue(false);
@@ -185,10 +252,89 @@ public class JCRRegistrySearchTest {
public void searchDeploymentDescriptorWithAllTest() {
try {
Map<String,String> config = new HashMap<String,String>();
- config.put("org.apache.jackrabbit.repository.home","target");
+ config.put("org.apache.jackrabbit.repository.home","target" + File.separator + "jackrabbit12");
AiravataJCRRegistry jcrRegistry = new AiravataJCRRegistry(null,
"org.apache.jackrabbit.core.RepositoryFactoryImpl", "admin",
"admin", config);
+ /*
+ * Host
+ */
+ HostDescription host = new HostDescription();
+ host.getType().setHostName("localhostsearch");
+ host.getType().setHostAddress("localhost");
+
+ HostDescription host1 = new HostDescription();
+ host1.getType().setHostName("localhost");
+ host1.getType().setHostAddress("121.121.12.121");
+
+ /*
+ * App
+ */
+ ApplicationDeploymentDescription appDesc = new ApplicationDeploymentDescription();
+ ApplicationDeploymentDescriptionType app = appDesc.getType();
+ ApplicationDeploymentDescriptionType.ApplicationName name = ApplicationDeploymentDescriptionType.ApplicationName.Factory.newInstance();
+ name.setStringValue("EchoLocalSearch");
+ app.setApplicationName(name);
+ app.setExecutableLocation("/bin/echo");
+ app.setScratchWorkingDirectory("/tmp");
+ app.setStaticWorkingDirectory("/tmp");
+ app.setInputDataDirectory("/tmp/input");
+ app.setOutputDataDirectory("/tmp/output");
+ app.setStandardOutput("/tmp/echo.stdout");
+ app.setStandardError("/tmp/echo.stdout");
+
+ /*
+ * Service
+ */
+ ServiceDescription serv = new ServiceDescription();
+ serv.getType().setName("SimpleEchoSearch");
+
+ ServiceDescription serv1 = new ServiceDescription();
+ serv1.getType().setName("MathService");
+
+ List<InputParameterType> inputList = new ArrayList<InputParameterType>();
+ InputParameterType input = InputParameterType.Factory.newInstance();
+ input.setParameterName("echo_input");
+ input.setParameterType(StringParameterType.Factory.newInstance());
+ inputList.add(input);
+ InputParameterType[] inputParamList = inputList.toArray(new InputParameterType[inputList
+ .size()]);
+
+ List<OutputParameterType> outputList = new ArrayList<OutputParameterType>();
+ OutputParameterType output = OutputParameterType.Factory.newInstance();
+ output.setParameterName("echo_output");
+ output.setParameterType(StringParameterType.Factory.newInstance());
+ outputList.add(output);
+ OutputParameterType[] outputParamList = outputList
+ .toArray(new OutputParameterType[outputList.size()]);
+
+ serv.getType().setInputParametersArray(inputParamList);
+ serv.getType().setOutputParametersArray(outputParamList);
+
+ serv1.getType().setInputParametersArray(inputParamList);
+ serv1.getType().setOutputParametersArray(outputParamList);
+
+ /*
+ * Save to registry
+ */
+ jcrRegistry.saveHostDescription(host);
+ jcrRegistry.saveHostDescription(host1);
+
+ jcrRegistry.saveDeploymentDescription(serv.getType().getName(), host
+ .getType().getHostName(), appDesc);
+ jcrRegistry.saveDeploymentDescription(serv1.getType().getName(), host
+ .getType().getHostName(), appDesc);
+ jcrRegistry.saveDeploymentDescription(serv1.getType().getName(), host1
+ .getType().getHostName(), appDesc);
+
+ jcrRegistry.saveServiceDescription(serv);
+ jcrRegistry.saveServiceDescription(serv1);
+ jcrRegistry.deployServiceOnHost(serv.getType().getName(), host
+ .getType().getHostName());
+ jcrRegistry.deployServiceOnHost(serv1.getType().getName(), host
+ .getType().getHostName());
+ jcrRegistry.deployServiceOnHost(serv1.getType().getName(), host1
+ .getType().getHostName());
List<ApplicationDeploymentDescription> applicationDeploymentDescriptions =
jcrRegistry.searchDeploymentDescription("SimpleEchoSearch", "localhostsearch", "EchoLocalSearch");
@@ -209,10 +355,89 @@ public class JCRRegistrySearchTest {
public void searchDeploymentDescriptorWithServiceNameTest() {
try {
Map<String,String> config = new HashMap<String,String>();
- config.put("org.apache.jackrabbit.repository.home","target");
+ config.put("org.apache.jackrabbit.repository.home","target" + File.separator + "jackrabbit13");
AiravataJCRRegistry jcrRegistry = new AiravataJCRRegistry(null,
"org.apache.jackrabbit.core.RepositoryFactoryImpl", "admin",
"admin", config);
+ /*
+ * Host
+ */
+ HostDescription host = new HostDescription();
+ host.getType().setHostName("localhostsearch");
+ host.getType().setHostAddress("localhost");
+
+ HostDescription host1 = new HostDescription();
+ host1.getType().setHostName("localhost");
+ host1.getType().setHostAddress("121.121.12.121");
+
+ /*
+ * App
+ */
+ ApplicationDeploymentDescription appDesc = new ApplicationDeploymentDescription();
+ ApplicationDeploymentDescriptionType app = appDesc.getType();
+ ApplicationDeploymentDescriptionType.ApplicationName name = ApplicationDeploymentDescriptionType.ApplicationName.Factory.newInstance();
+ name.setStringValue("EchoLocalSearch");
+ app.setApplicationName(name);
+ app.setExecutableLocation("/bin/echo");
+ app.setScratchWorkingDirectory("/tmp");
+ app.setStaticWorkingDirectory("/tmp");
+ app.setInputDataDirectory("/tmp/input");
+ app.setOutputDataDirectory("/tmp/output");
+ app.setStandardOutput("/tmp/echo.stdout");
+ app.setStandardError("/tmp/echo.stdout");
+
+ /*
+ * Service
+ */
+ ServiceDescription serv = new ServiceDescription();
+ serv.getType().setName("SimpleEchoSearch");
+
+ ServiceDescription serv1 = new ServiceDescription();
+ serv1.getType().setName("MathService");
+
+ List<InputParameterType> inputList = new ArrayList<InputParameterType>();
+ InputParameterType input = InputParameterType.Factory.newInstance();
+ input.setParameterName("echo_input");
+ input.setParameterType(StringParameterType.Factory.newInstance());
+ inputList.add(input);
+ InputParameterType[] inputParamList = inputList.toArray(new InputParameterType[inputList
+ .size()]);
+
+ List<OutputParameterType> outputList = new ArrayList<OutputParameterType>();
+ OutputParameterType output = OutputParameterType.Factory.newInstance();
+ output.setParameterName("echo_output");
+ output.setParameterType(StringParameterType.Factory.newInstance());
+ outputList.add(output);
+ OutputParameterType[] outputParamList = outputList
+ .toArray(new OutputParameterType[outputList.size()]);
+
+ serv.getType().setInputParametersArray(inputParamList);
+ serv.getType().setOutputParametersArray(outputParamList);
+
+ serv1.getType().setInputParametersArray(inputParamList);
+ serv1.getType().setOutputParametersArray(outputParamList);
+
+ /*
+ * Save to registry
+ */
+ jcrRegistry.saveHostDescription(host);
+ jcrRegistry.saveHostDescription(host1);
+
+ jcrRegistry.saveDeploymentDescription(serv.getType().getName(), host
+ .getType().getHostName(), appDesc);
+ jcrRegistry.saveDeploymentDescription(serv1.getType().getName(), host
+ .getType().getHostName(), appDesc);
+ jcrRegistry.saveDeploymentDescription(serv1.getType().getName(), host1
+ .getType().getHostName(), appDesc);
+
+ jcrRegistry.saveServiceDescription(serv);
+ jcrRegistry.saveServiceDescription(serv1);
+ jcrRegistry.deployServiceOnHost(serv.getType().getName(), host
+ .getType().getHostName());
+ jcrRegistry.deployServiceOnHost(serv1.getType().getName(), host
+ .getType().getHostName());
+ jcrRegistry.deployServiceOnHost(serv1.getType().getName(), host1
+ .getType().getHostName());
Map<HostDescription, List<ApplicationDeploymentDescription>> simpleEchoSearch =
jcrRegistry.searchDeploymentDescription("MathService");
if((simpleEchoSearch).size() == 0){
@@ -232,10 +457,89 @@ public class JCRRegistrySearchTest {
public void searchDeploymentDescriptorWithServiceAndHostTest() {
try {
Map<String,String> config = new HashMap<String,String>();
- config.put("org.apache.jackrabbit.repository.home","target");
+ config.put("org.apache.jackrabbit.repository.home","target" + File.separator + "jackrabbit14");
AiravataJCRRegistry jcrRegistry = new AiravataJCRRegistry(null,
"org.apache.jackrabbit.core.RepositoryFactoryImpl", "admin",
"admin", config);
+ /*
+ * Host
+ */
+ HostDescription host = new HostDescription();
+ host.getType().setHostName("localhostsearch");
+ host.getType().setHostAddress("localhost");
+
+ HostDescription host1 = new HostDescription();
+ host1.getType().setHostName("localhost");
+ host1.getType().setHostAddress("121.121.12.121");
+
+ /*
+ * App
+ */
+ ApplicationDeploymentDescription appDesc = new ApplicationDeploymentDescription();
+ ApplicationDeploymentDescriptionType app = appDesc.getType();
+ ApplicationDeploymentDescriptionType.ApplicationName name = ApplicationDeploymentDescriptionType.ApplicationName.Factory.newInstance();
+ name.setStringValue("EchoLocalSearch");
+ app.setApplicationName(name);
+ app.setExecutableLocation("/bin/echo");
+ app.setScratchWorkingDirectory("/tmp");
+ app.setStaticWorkingDirectory("/tmp");
+ app.setInputDataDirectory("/tmp/input");
+ app.setOutputDataDirectory("/tmp/output");
+ app.setStandardOutput("/tmp/echo.stdout");
+ app.setStandardError("/tmp/echo.stdout");
+
+ /*
+ * Service
+ */
+ ServiceDescription serv = new ServiceDescription();
+ serv.getType().setName("SimpleEchoSearch");
+
+ ServiceDescription serv1 = new ServiceDescription();
+ serv1.getType().setName("MathService");
+
+ List<InputParameterType> inputList = new ArrayList<InputParameterType>();
+ InputParameterType input = InputParameterType.Factory.newInstance();
+ input.setParameterName("echo_input");
+ input.setParameterType(StringParameterType.Factory.newInstance());
+ inputList.add(input);
+ InputParameterType[] inputParamList = inputList.toArray(new InputParameterType[inputList
+ .size()]);
+
+ List<OutputParameterType> outputList = new ArrayList<OutputParameterType>();
+ OutputParameterType output = OutputParameterType.Factory.newInstance();
+ output.setParameterName("echo_output");
+ output.setParameterType(StringParameterType.Factory.newInstance());
+ outputList.add(output);
+ OutputParameterType[] outputParamList = outputList
+ .toArray(new OutputParameterType[outputList.size()]);
+
+ serv.getType().setInputParametersArray(inputParamList);
+ serv.getType().setOutputParametersArray(outputParamList);
+
+ serv1.getType().setInputParametersArray(inputParamList);
+ serv1.getType().setOutputParametersArray(outputParamList);
+
+ /*
+ * Save to registry
+ */
+ jcrRegistry.saveHostDescription(host);
+ jcrRegistry.saveHostDescription(host1);
+
+ jcrRegistry.saveDeploymentDescription(serv.getType().getName(), host
+ .getType().getHostName(), appDesc);
+ jcrRegistry.saveDeploymentDescription(serv1.getType().getName(), host
+ .getType().getHostName(), appDesc);
+ jcrRegistry.saveDeploymentDescription(serv1.getType().getName(), host1
+ .getType().getHostName(), appDesc);
+
+ jcrRegistry.saveServiceDescription(serv);
+ jcrRegistry.saveServiceDescription(serv1);
+ jcrRegistry.deployServiceOnHost(serv.getType().getName(), host
+ .getType().getHostName());
+ jcrRegistry.deployServiceOnHost(serv1.getType().getName(), host
+ .getType().getHostName());
+ jcrRegistry.deployServiceOnHost(serv1.getType().getName(), host1
+ .getType().getHostName());
List<ApplicationDeploymentDescription> applicationDeploymentDescriptions =
jcrRegistry.searchDeploymentDescription("MathService", "localhostsearch");
if((applicationDeploymentDescriptions).size() == 0){
@@ -250,17 +554,4 @@ public class JCRRegistrySearchTest {
}
Assert.assertTrue(true);
}
-
- @After
- public void cleanup(){
- File jackrabbit = new File(".");
- String s = jackrabbit.getAbsolutePath() + File.separator +
- "jackrabbit";
- IOUtil.deleteDirectory(new File(s));
-
- jackrabbit = new File(".");
- s = jackrabbit.getAbsolutePath() + File.separator +
- "modules" + File.separator + "registry-api" + File.separator +"jackrabbit";
- IOUtil.deleteDirectory(new File(s));
- }
}
Modified: incubator/airavata/trunk/modules/commons/registry-api/src/test/java/org/apache/airavata/registry/api/impl/JCRRegistryTest.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/test/java/org/apache/airavata/registry/api/impl/JCRRegistryTest.java?rev=1245121&r1=1245120&r2=1245121&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/test/java/org/apache/airavata/registry/api/impl/JCRRegistryTest.java (original)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/test/java/org/apache/airavata/registry/api/impl/JCRRegistryTest.java Thu Feb 16 19:07:57 2012
@@ -49,17 +49,10 @@ public class JCRRegistryTest {
@Test
public void testSaveLoadHostDescription() {
try {
- Map<String,String> map = new HashMap<String,String>();
- map.put("org.apache.jackrabbit.repository.uri","http://localhost:8080/rmi");
- map.put("jcr.class","org.apache.jackrabbit.rmi.repository.RmiRepositoryFactory");
- map.put("jcr.user","admin");
- map.put("jcr.pass","admin");
- map.put("org.apache.jackrabbit.repository.home","target");
- /*
- * Create database
- */
+ Map<String,String> config = new HashMap<String,String>();
+ config.put("org.apache.jackrabbit.repository.home","target" + File.separator + "jackrabbit4");
AiravataJCRRegistry jcrRegistry = new AiravataJCRRegistry(null, "org.apache.jackrabbit.core.RepositoryFactoryImpl",
- "admin", "admin", map);
+ "admin", "admin", config);
String hostId = "localhost";
String address = "127.0.0.1";
@@ -112,7 +105,7 @@ public class JCRRegistryTest {
public void testSaveLoadServiceDescription() {
try {
Map<String,String> config = new HashMap<String,String>();
- config.put("org.apache.jackrabbit.repository.home","target");
+ config.put("org.apache.jackrabbit.repository.home","target" + File.separator + "jackrabbit4");
AiravataJCRRegistry jcrRegistry = new AiravataJCRRegistry(null, "org.apache.jackrabbit.core.RepositoryFactoryImpl",
"admin", "admin", config);
@@ -171,7 +164,7 @@ public class JCRRegistryTest {
public void testSaveLoadApplicationDescription() {
try {
Map<String,String> config = new HashMap<String,String>();
- config.put("org.apache.jackrabbit.repository.home","target");
+ config.put("org.apache.jackrabbit.repository.home","target" + File.separator + "jackrabbit5");
AiravataJCRRegistry jcrRegistry = new AiravataJCRRegistry(null, "org.apache.jackrabbit.core.RepositoryFactoryImpl",
"admin", "admin", config);
@@ -244,12 +237,5 @@ public class JCRRegistryTest {
fail(e.getMessage());
}
}
- @After
- public void cleanup(){
- File jackrabbit = new File(".");
- String s = jackrabbit.getAbsolutePath() + File.separator +
- "modules" + File.separator + "registry-api" + File.separator +"jackrabbit";
- IOUtil.deleteDirectory(new File(s));
- }
-
+
}