airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject [26/44] airavata git commit: Mongo Registry WIP
Date Sun, 07 Jun 2015 17:01:07 GMT
http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/mongo/repository/ProjectRepository.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/mongo/repository/ProjectRepository.java b/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/mongo/repository/ProjectRepository.java
new file mode 100644
index 0000000..f7a7d73
--- /dev/null
+++ b/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/mongo/repository/ProjectRepository.java
@@ -0,0 +1,191 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.persistance.registry.mongo.repository;
+
+import org.apache.airavata.model.workspace.Gateway;
+import org.apache.airavata.model.workspace.Project;
+import org.apache.airavata.model.workspace.User;
+import org.apache.airavata.persistance.registry.mongo.dao.ProjectDao;
+import org.apache.airavata.registry.cpi.RegistryException;
+import org.apache.airavata.registry.cpi.ResultOrderType;
+import org.apache.airavata.registry.cpi.utils.Constants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.*;
+
+public class ProjectRepository {
+    private final static Logger logger = LoggerFactory.getLogger(ProjectRepository.class);
+
+    private Gateway gateway;
+    private User user;
+
+    private ProjectDao projectDao;
+    private GatewayRepository gatewayRepository;
+    private UserRepository userRepository;
+
+    public ProjectRepository(Gateway gateway, User user) throws RegistryException {
+        this.projectDao = new ProjectDao();
+        this.userRepository = new UserRepository();
+
+        if(gatewayRepository.getGateway(gateway.getGatewayId()) == null){
+            gatewayRepository.addGateway(gateway);
+        }
+        //Todo check for gateway workers
+
+        this.gateway = gateway;
+        this.user = user;
+    }
+
+    public String addProject (Project project, String gatewayId) throws RegistryException{
+        try {
+            if (!userRepository.isUserExists(project.getOwner())){
+                userRepository.addUser(new User(project.getOwner()));
+            }
+            project.setProjectId(getProjectId(project.getName()));
+            projectDao.createProject(project);
+            return project.getProjectId();
+        }catch (Exception e){
+            logger.error("Error while saving project to registry", e);
+           throw new RegistryException(e);
+        }
+    }
+
+    private String getProjectId (String projectName){
+        String pro = projectName.replaceAll("\\s", "");
+        return pro + "_" + UUID.randomUUID();
+    }
+
+    public void updateProject (Project project, String projectId) throws RegistryException{
+        try {
+            //check project owner is a gateway user else add gateway user
+            projectDao.updateProject(project);
+        }catch (Exception e){
+            logger.error("Error while saving project to registry", e);
+           throw new RegistryException(e);
+        }
+    }
+
+    public Project getProject (String projectId) throws RegistryException{
+        try {
+            return projectDao.getProject(projectId);
+        }catch (Exception e){
+            logger.error("Error while retrieving project from registry", e);
+           throw new RegistryException(e);
+        }
+    }
+
+    /**
+     * Get list of projects of the user
+     * @param fieldName
+     * @param value
+     * @return
+     * @throws RegistryException
+     */
+    public List<Project> getProjectList (String fieldName, Object value) throws RegistryException{
+        return getProjectList(fieldName, value, -1, -1, null, null);
+    }
+
+    /**
+     * Get projects list with pagination and result ordering
+     * @param fieldName
+     * @param value
+     * @param limit
+     * @param offset
+     * @param orderByIdentifier
+     * @param resultOrderType
+     * @return
+     * @throws RegistryException
+     */
+    public List<Project> getProjectList (String fieldName, Object value, int limit, int offset,
+                                         Object orderByIdentifier, ResultOrderType resultOrderType) throws RegistryException{
+        try {
+                Map<String, String> filters = new HashMap();
+                filters.put(fieldName, (String)value);
+                return  projectDao.searchProjects(filters, limit, offset, orderByIdentifier, resultOrderType);
+        }catch (Exception e){
+            logger.error("Error while retrieving project from registry", e);
+            throw new RegistryException(e);
+        }
+    }
+
+    /**
+     * To search the projects of user with the given filter criteria and retrieve the results with
+     * pagination support. Results can be ordered based on an identifier (i.e column) either ASC or
+     * DESC.
+     *
+     * @param filters
+     * @param limit
+     * @param offset
+     * @param orderByIdentifier
+     * @param resultOrderType
+     * @return
+     * @throws RegistryException
+     */
+    public List<Project> searchProjects(Map<String, String> filters, int limit,
+            int offset, Object orderByIdentifier, ResultOrderType resultOrderType) throws RegistryException {
+          try {
+                return  projectDao.searchProjects(filters, limit, offset, orderByIdentifier, resultOrderType);
+            }catch (Exception e){
+                logger.error("Error while retrieving project from registry", e);
+                throw new RegistryException(e);
+            }
+
+    }
+
+    public List<String> getProjectIds (String fieldName, Object value) throws RegistryException{
+        List<String> projectIds = new ArrayList<String>();
+        try {
+            if (fieldName.equals(Constants.FieldConstants.ProjectConstants.OWNER)){
+                Map<String, String> filters = new HashMap();
+                filters.put(fieldName, (String)value);
+                projectDao.searchProjects(filters, -1, -1, null, null).stream()
+                .forEach(pr->projectIds.add(pr.getProjectId()));
+                return projectIds;
+            }
+        }catch (Exception e){
+            logger.error("Error while retrieving projects from registry", e);
+           throw new RegistryException(e);
+        }
+        return projectIds;
+    }
+
+    public void removeProject (String projectId) throws RegistryException {
+        try {
+            Project project = new Project();
+            project.setProjectId(projectId);
+            projectDao.deleteProject(project);
+        } catch (Exception e) {
+            logger.error("Error while removing the project..", e);
+           throw new RegistryException(e);
+        }
+    }
+
+    public boolean isProjectExist(String projectId) throws RegistryException {
+        try {
+            return projectDao.getProject(projectId) != null;
+        } catch (Exception e) {
+            logger.error("Error while retrieving project...", e);
+           throw new RegistryException(e);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/mongo/repository/UserRepository.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/mongo/repository/UserRepository.java b/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/mongo/repository/UserRepository.java
new file mode 100644
index 0000000..0beeba3
--- /dev/null
+++ b/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/mongo/repository/UserRepository.java
@@ -0,0 +1,65 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.persistance.registry.mongo.repository;
+
+import org.apache.airavata.model.workspace.User;
+import org.apache.airavata.persistance.registry.mongo.dao.UserDao;
+import org.apache.airavata.registry.cpi.RegistryException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class UserRepository {
+    private final static Logger logger = LoggerFactory.getLogger(UserRepository.class);
+    private UserDao userDao;
+
+    public UserRepository(){
+        this.userDao = new UserDao();
+    }
+
+    public String addUser (User user) throws RegistryException {
+        try {
+            userDao.createUser(user);
+            return user.getUserName();
+        }catch (Exception e){
+            logger.error("Error while saving user to registry", e);
+            throw new RegistryException(e);
+        }
+    }
+
+    public User getUser(String userName) throws RegistryException {
+        try {
+            return userDao.getUser(userName);
+        }catch (Exception e){
+            logger.error("Error while retrieving user from registry", e);
+            throw new RegistryException(e);
+        }
+    }
+
+    public boolean isUserExists(String userName) throws RegistryException {
+        try {
+            return userDao.getUser(userName) != null;
+        }catch (Exception e){
+            logger.error("Error while retrieving user from registry", e);
+            throw new RegistryException(e);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/mongo/utils/MongoUtil.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/mongo/utils/MongoUtil.java b/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/mongo/utils/MongoUtil.java
new file mode 100644
index 0000000..996ee23
--- /dev/null
+++ b/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/mongo/utils/MongoUtil.java
@@ -0,0 +1,70 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.persistance.registry.mongo.utils;
+
+import com.mongodb.DB;
+import com.mongodb.MongoClient;
+import com.mongodb.MongoException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class MongoUtil {
+    private final static Logger logger = LoggerFactory.getLogger(MongoUtil.class);
+
+    private static final int port = 27017;
+    private static final String host = "localhost";
+    private static MongoClient mongoClient = null;
+    private static DB airavataRegistry;
+    public static String AIRAVATA_REGISTRY_NAME = "airavata-registry";
+
+    public static MongoClient getMongoClient() {
+        if (mongoClient == null) {
+            try {
+                mongoClient = new MongoClient(host, port);
+                logger.debug("New Mongo Client created with [" + host + "] and ["
+                        + port + "]");
+            } catch (MongoException e) {
+                logger.error(e.getMessage());
+            }
+        }
+        return mongoClient;
+    }
+
+    public static DB getAiravataRegistry(){
+        if (airavataRegistry == null) {
+            try {
+                airavataRegistry = getMongoClient().getDB(AIRAVATA_REGISTRY_NAME);
+            } catch (MongoException e) {
+                logger.error(e.getMessage());
+            }
+        }
+        return airavataRegistry;
+    }
+
+    public static void dropAiravataRegistry(){
+        try {
+            getMongoClient().dropDatabase(AIRAVATA_REGISTRY_NAME);
+            logger.debug("Dropped Airavata Registry");
+        } catch (MongoException e) {
+            logger.error(e.getMessage());
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-mongo-registry/src/main/resources/META-INF/persistence.xml
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-mongo-registry/src/main/resources/META-INF/persistence.xml b/modules/registry/airavata-mongo-registry/src/main/resources/META-INF/persistence.xml
index 2ba8ce4..6b3d9d3 100644
--- a/modules/registry/airavata-mongo-registry/src/main/resources/META-INF/persistence.xml
+++ b/modules/registry/airavata-mongo-registry/src/main/resources/META-INF/persistence.xml
@@ -23,31 +23,31 @@
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0">
     <persistence-unit name="airavata_data">
         <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
-        <class>org.apache.airavata.persistance.registry.jpa.model.Gateway</class>
-        <class>org.apache.airavata.persistance.registry.jpa.model.Configuration</class>
-        <class>org.apache.airavata.persistance.registry.jpa.model.Users</class>
-        <class>org.apache.airavata.persistance.registry.jpa.model.Gateway_Worker</class>
-        <class>org.apache.airavata.persistance.registry.jpa.model.Project</class>
-        <class>org.apache.airavata.persistance.registry.jpa.model.ProjectUser</class>
-        <class>org.apache.airavata.persistance.registry.jpa.model.Experiment</class>
-        <class>org.apache.airavata.persistance.registry.jpa.model.Notification_Email</class>
-        <class>org.apache.airavata.persistance.registry.jpa.model.Experiment_Input</class>
-        <class>org.apache.airavata.persistance.registry.jpa.model.Experiment_Output</class>
-        <class>org.apache.airavata.persistance.registry.jpa.model.WorkflowNodeDetail</class>
-        <class>org.apache.airavata.persistance.registry.jpa.model.TaskDetail</class>
-		<class>org.apache.airavata.persistance.registry.jpa.model.ErrorDetail</class>
-		<class>org.apache.airavata.persistance.registry.jpa.model.ApplicationInput</class>
-		<class>org.apache.airavata.persistance.registry.jpa.model.ApplicationOutput</class>
-		<class>org.apache.airavata.persistance.registry.jpa.model.NodeInput</class>
-		<class>org.apache.airavata.persistance.registry.jpa.model.NodeOutput</class>
-		<class>org.apache.airavata.persistance.registry.jpa.model.JobDetail</class>
-		<class>org.apache.airavata.persistance.registry.jpa.model.DataTransferDetail</class>
-		<class>org.apache.airavata.persistance.registry.jpa.model.Status</class>
-		<class>org.apache.airavata.persistance.registry.jpa.model.ExperimentConfigData</class>
-		<class>org.apache.airavata.persistance.registry.jpa.model.Computational_Resource_Scheduling</class>
-		<class>org.apache.airavata.persistance.registry.jpa.model.AdvancedInputDataHandling</class>
-		<class>org.apache.airavata.persistance.registry.jpa.model.AdvancedOutputDataHandling</class>
-		<class>org.apache.airavata.persistance.registry.jpa.model.QosParam</class>
+        <class>org.apache.airavata.persistance.registry.mongo.model.Gateway</class>
+        <class>org.apache.airavata.persistance.registry.mongo.model.Configuration</class>
+        <class>org.apache.airavata.persistance.registry.mongo.model.Users</class>
+        <class>org.apache.airavata.persistance.registry.mongo.model.Gateway_Worker</class>
+        <class>org.apache.airavata.persistance.registry.mongo.model.Project</class>
+        <class>org.apache.airavata.persistance.registry.mongo.model.ProjectUser</class>
+        <class>org.apache.airavata.persistance.registry.mongo.model.Experiment</class>
+        <class>org.apache.airavata.persistance.registry.mongo.model.Notification_Email</class>
+        <class>org.apache.airavata.persistance.registry.mongo.model.Experiment_Input</class>
+        <class>org.apache.airavata.persistance.registry.mongo.model.Experiment_Output</class>
+        <class>org.apache.airavata.persistance.registry.mongo.model.WorkflowNodeDetail</class>
+        <class>org.apache.airavata.persistance.registry.mongo.model.TaskDetail</class>
+		<class>org.apache.airavata.persistance.registry.mongo.model.ErrorDetail</class>
+		<class>org.apache.airavata.persistance.registry.mongo.model.ApplicationInput</class>
+		<class>org.apache.airavata.persistance.registry.mongo.model.ApplicationOutput</class>
+		<class>org.apache.airavata.persistance.registry.mongo.model.NodeInput</class>
+		<class>org.apache.airavata.persistance.registry.mongo.model.NodeOutput</class>
+		<class>org.apache.airavata.persistance.registry.mongo.model.JobDetail</class>
+		<class>org.apache.airavata.persistance.registry.mongo.model.DataTransferDetail</class>
+		<class>org.apache.airavata.persistance.registry.mongo.model.Status</class>
+		<class>org.apache.airavata.persistance.registry.mongo.model.ExperimentConfigData</class>
+		<class>org.apache.airavata.persistance.registry.mongo.model.Computational_Resource_Scheduling</class>
+		<class>org.apache.airavata.persistance.registry.mongo.model.AdvancedInputDataHandling</class>
+		<class>org.apache.airavata.persistance.registry.mongo.model.AdvancedOutputDataHandling</class>
+		<class>org.apache.airavata.persistance.registry.mongo.model.QosParam</class>
         <exclude-unlisted-classes>true</exclude-unlisted-classes>
         <properties>
             <property name="openjpa.ConnectionURL"

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-mongo-registry/src/test/java/org/apache/airavata/persistence/registry/mongo/AbstractDaoTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-mongo-registry/src/test/java/org/apache/airavata/persistence/registry/mongo/AbstractDaoTest.java b/modules/registry/airavata-mongo-registry/src/test/java/org/apache/airavata/persistence/registry/mongo/AbstractDaoTest.java
new file mode 100644
index 0000000..9fe57f7
--- /dev/null
+++ b/modules/registry/airavata-mongo-registry/src/test/java/org/apache/airavata/persistence/registry/mongo/AbstractDaoTest.java
@@ -0,0 +1,37 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.persistence.registry.mongo;
+
+import com.mongodb.MongoClient;
+import org.apache.airavata.persistance.registry.mongo.utils.MongoUtil;
+import org.junit.AfterClass;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class AbstractDaoTest {
+    private final static Logger logger = LoggerFactory.getLogger(AbstractDaoTest.class);
+
+    @AfterClass
+    public static void tearDown(){
+        MongoClient mongoClient = MongoUtil.getMongoClient();
+        mongoClient.dropDatabase("airavata-registry");
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-mongo-registry/src/test/java/org/apache/airavata/persistence/registry/mongo/ExperimentDaoTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-mongo-registry/src/test/java/org/apache/airavata/persistence/registry/mongo/ExperimentDaoTest.java b/modules/registry/airavata-mongo-registry/src/test/java/org/apache/airavata/persistence/registry/mongo/ExperimentDaoTest.java
index 1def159..6f587be 100644
--- a/modules/registry/airavata-mongo-registry/src/test/java/org/apache/airavata/persistence/registry/mongo/ExperimentDaoTest.java
+++ b/modules/registry/airavata-mongo-registry/src/test/java/org/apache/airavata/persistence/registry/mongo/ExperimentDaoTest.java
@@ -20,87 +20,41 @@
 */
 package org.apache.airavata.persistence.registry.mongo;
 
-import com.mongodb.MongoClient;
 import junit.framework.Assert;
 import org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType;
 import org.apache.airavata.model.workspace.experiment.*;
-import org.apache.airavata.persistance.registry.jpa.impl.RegistryFactory;
-import org.apache.airavata.persistance.registry.jpa.mongo.dao.ExperimentDao;
-import org.apache.airavata.persistance.registry.jpa.mongo.utils.MongoUtil;
-import org.apache.airavata.registry.cpi.Registry;
+import org.apache.airavata.persistance.registry.mongo.dao.ExperimentDao;
 import org.apache.airavata.registry.cpi.RegistryException;
-import org.apache.airavata.registry.cpi.RegistryModelType;
-import org.apache.airavata.registry.cpi.ResultOrderType;
 import org.apache.airavata.registry.cpi.utils.Constants;
-import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.BufferedReader;
-import java.io.FileReader;
 import java.io.IOException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
+import java.util.*;
 
-public class ExperimentDaoTest {
+public class ExperimentDaoTest extends AbstractDaoTest{
     private final static Logger logger = LoggerFactory.getLogger(ExperimentDaoTest.class);
 
-    private static String gatewayId = "php_reference_gateway";
-
     private static ExperimentDao experimentDao;
+
     @BeforeClass
     public static void setupBeforeClass() throws Exception{
         experimentDao = new ExperimentDao();
     }
 
-    @AfterClass
-    public static void tearDown(){
-        MongoClient mongoClient = MongoUtil.getMongoClient();
-        mongoClient.dropDatabase("airavata-data");
-    }
 
     @Test
-    public void testExperimentDao() throws RegistryException {
-        String TAG = System.currentTimeMillis() + "";
-        //creating sample echo experiment
-        InputDataObjectType inputDataObjectType = new InputDataObjectType();
-        inputDataObjectType.setName("Input_to_Echo");
-        inputDataObjectType.setValue("Hello World");
-
-        ComputationalResourceScheduling scheduling = new ComputationalResourceScheduling();
-        scheduling.setResourceHostId(UUID.randomUUID().toString());
-        scheduling.setComputationalProjectAccount("TG-STA110014S");
-        scheduling.setTotalCpuCount(1);
-        scheduling.setNodeCount(1);
-        scheduling.setWallTimeLimit(15);
-        scheduling.setQueueName("normal");
-
-        UserConfigurationData userConfigurationData = new UserConfigurationData();
-        userConfigurationData.setAiravataAutoSchedule(false);
-        userConfigurationData.setOverrideManualScheduledParams(false);
-        userConfigurationData.setComputationalResourceScheduling(scheduling);
-
-        Experiment experiment = new Experiment();
-        experiment.setExperimentId("28395669237854235"+TAG);
-        experiment.setProjectId("2392519y92312341" + TAG);
-        experiment.setUserName("TestUser" + TAG);
-        experiment.setName("TestExperiment"+TAG);
-        experiment.setDescription("experiment");
-        experiment.setApplicationId("2358382458362846287"+TAG);
-        experiment.setUserConfigurationData(userConfigurationData);
-        experiment.addToExperimentInputs(inputDataObjectType);
-        experiment.setGatewayExecutionId("329619820461624214"+TAG);
-
+    public void testExperimentOperations() throws RegistryException {
+        Experiment experiment = createExperiment();
         experimentDao.createExperiment(experiment);
-        Experiment persistedExperiement = experimentDao.getExperiment(experiment.getExperimentId());
+        Experiment persistedExperiement
+                = experimentDao.getExperiment(experiment.getExperimentId());
         Assert.assertNotNull(persistedExperiement);
         Assert.assertEquals(experiment, persistedExperiement);
 
-        experiment.setName("New Name"+TAG);
+        experiment.setName("New Name");
         experimentDao.updateExperiment(experiment);
         persistedExperiement = experimentDao.getExperiment(experiment.getExperimentId());
         Assert.assertEquals(experiment, persistedExperiement);
@@ -108,171 +62,97 @@ public class ExperimentDaoTest {
         List<Experiment> experimentList = experimentDao.getAllExperiments();
         Assert.assertTrue(experimentList.size()==1);
 
+        Map<String, String> filters = new HashMap();
+        filters.put(Constants.FieldConstants.ExperimentConstants.EXPERIMENT_NAME,
+                experiment.getName().substring(1, 4));
+        experimentList = experimentDao.searchExperiments(filters, 1, 0, null, null);
+        Assert.assertTrue(experimentList.size()==1);
+
         experimentDao.deleteExperiment(experiment);
         experimentList = experimentDao.getAllExperiments();
         Assert.assertTrue(experimentList.size()==0);
     }
 
-    @Test
-    public void test() throws RegistryException, IOException {
-        Registry registry = RegistryFactory.getDefaultRegistry();
-        MongoUtil.dropAiravataRegistry();
-
-        ExperimentDao experimentDao = new ExperimentDao();
-        BufferedReader reader = new BufferedReader(new FileReader("/home/supun/Downloads/EXPERIMENT.csv"));
-        String temp = reader.readLine();
-        int i = 1;
-        long time1 = System.currentTimeMillis();
-        while(temp != null && !temp.isEmpty()){
-            try{
-                Experiment experiement = (Experiment) registry.get(RegistryModelType.EXPERIMENT, temp.trim());
-                experimentDao.createExperiment(experiement);
-                Experiment persistedExperiment = experimentDao.getExperiment(temp.trim());
-//                List<Experiment> experimentList = experimentDao.getAllExperiments();
-                Assert.assertEquals(experiement, persistedExperiment);
-                System.out.println(i+" :"+experiement.getExperimentId());
-                i++;
-            }catch (Exception e){
-                System.out.println(temp);
-                e.printStackTrace();
-            }
-            temp = reader.readLine();
-        }
-        long time2  = System.currentTimeMillis();
-        System.out.println(time2-time1);
-    }
 
     @Test
-    public void testGetExperimentOfWFNode() throws RegistryException, IOException {
-//        String nodeId = "IDontNeedaNode_48c545a1-bedd-46cf-90d4-e4390b129693";
-//        ExperimentDao experimentDao = new ExperimentDao();
-//        long time1 = System.currentTimeMillis();
-//        Experiment experiment = experimentDao.getExperimentOfWFNode(nodeId);
-//        long time2 = System.currentTimeMillis();
-//        System.out.println(time2-time1);
-//        Assert.assertNotNull(experiment);
-
-        ExperimentDao experimentDao = new ExperimentDao();
-        BufferedReader reader = new BufferedReader(new FileReader("/home/supun/Downloads/WORKFLOW_NODE_DETAIL.csv"));
-        String temp = reader.readLine();
-        int i = 1;
-        int count  = 0;
-        long time1 = System.currentTimeMillis();
-        while(temp != null && !temp.isEmpty()){
-            try{
-                Experiment experiment = experimentDao.getParentExperimentOfWFNode(temp.trim());
-                if(experiment != null) {
-                    System.out.println(i + " :" + experiment.getExperimentId());
-                    count++;
-                }else{
-                    System.out.println("FAILED: " + temp);
-                }
-                i++;
-            }catch (Exception e){
-                System.out.println(temp);
-                e.printStackTrace();
-            }
-            temp = reader.readLine();
-        }
-        long time2  = System.currentTimeMillis();
-        System.out.println(count);
-        System.out.println(time2-time1);
-    }
+    public void testWFOperations() throws RegistryException, IOException {
+        Experiment experiment = createExperiment();
+        experimentDao.createExperiment(experiment);
+        WorkflowNodeDetails wfnd = createWorkFlowNodeDetails();
+        experimentDao.createWFNode(experiment.getExperimentId(), wfnd);
+        Assert.assertEquals(wfnd, experimentDao.getWFNode(wfnd.getNodeInstanceId()));
 
-    @Test
-    public void testGetExperimentOfTask() throws RegistryException, IOException {
-//        String taskId = "tempNode_fceda7f7-267c-4197-bf20-a54f4fff395b";
-//        ExperimentDao experimentDao = new ExperimentDao();
-//        long time1 = System.currentTimeMillis();
-//        Experiment experiment = experimentDao.getExperimentOfTask(taskId);
-//        long time2 = System.currentTimeMillis();
-//        System.out.println(time2-time1);
-//        Assert.assertNotNull(experiment);
-//        AiravataUtils.setExecutionAsServer();
-//        Registry registry = RegistryFactory.getDefaultRegistry();
-//        MongoUtil.dropAiravataRegistry();
+        wfnd.setNodeName("NewName");
+        experimentDao.updateWFNode(wfnd);
+        Assert.assertEquals(wfnd.getNodeName(),
+                experimentDao.getWFNode(wfnd.getNodeInstanceId()).getNodeName());
 
-        ExperimentDao experimentDao = new ExperimentDao();
-        BufferedReader reader = new BufferedReader(new FileReader("/home/supun/Downloads/TASK_DETAIL.csv"));
-        String temp = reader.readLine();
-        int i = 1;
-        int count  = 0;
-        long time1 = System.currentTimeMillis();
-        while(temp != null && !temp.isEmpty()){
-            try{
-                Experiment experiment = experimentDao.getParentExperimentOfTask(temp.trim());
-                if(experiment != null) {
-                    //System.out.println(i + " :" + experiment.getExperimentId());
-                    count++;
-                }else{
-                    System.out.println("FAILED: " + temp);
-                }
-                i++;
-            }catch (Exception e){
-                System.out.println(temp);
-                e.printStackTrace();
-            }
-            temp = reader.readLine();
-        }
-        long time2  = System.currentTimeMillis();
-        System.out.println(count);
-        System.out.println(time2-time1);
+        experimentDao.deleteWFNode(wfnd);
+        Assert.assertNull(experimentDao.getWFNode(wfnd.getNodeInstanceId()));
     }
 
     @Test
-    public void testWorkFlow() throws RegistryException {
-        String nodeId = "tempNode_758b52ba-091b-43a5-a7b7-4c3a239c5d1e";
-        String newNodeId = "newNode_758b52ba-091b-43a5-a7b7-4c3a2325d1e";
-        String expId = "AlamoTest3_3965f4e2-0213-4434-9c3f-fe898b018666";
-        ExperimentDao experimentDao = new ExperimentDao();
-        WorkflowNodeDetails wfNode = experimentDao.getWFNode("newNode_758b52ba-091b-43a5-a7b7-4c3a239c5d1e");
-        Assert.assertTrue(wfNode.getNodeInstanceId().equals("newNode_758b52ba-091b-43a5-a7b7-4c3a239c5d1e"));
-
-        wfNode.setNodeName("New2 Name"+System.currentTimeMillis());
-        experimentDao.updateWFNode(wfNode);
-        WorkflowNodeDetails updatedWfNode = experimentDao.getWFNode("newNode_758b52ba-091b-43a5-a7b7-4c3a239c5d1e");
-        Assert.assertTrue(updatedWfNode.getNodeName().equals(wfNode.getNodeName()));
-
-        WorkflowNodeDetails newWfNode = wfNode;
-        newWfNode.setTaskDetailsList(null);
-        newWfNode.setNodeInstanceId(newNodeId);
-        experimentDao.createWFNode(expId, newWfNode);
-
-        Experiment experiment = experimentDao.getExperiment(expId);
-
-        experimentDao.deleteWFNode(newWfNode);
-
-        experiment = experimentDao.getExperiment(expId);
-
-        System.out.println();
+    public void testTaskOperations() throws RegistryException, IOException {
     }
 
-    @Test
-    public void testTask() throws RegistryException {
-        String taskId = "tempNode_58e1b2e4-f7d6-4543-9281-43dcb58e2c1a";
-        ExperimentDao experimentDao = new ExperimentDao();
-        TaskDetails taskDetails = experimentDao.getTaskDetail(taskId);
-        Assert.assertTrue(taskDetails.getTaskId().equals(taskId));
+    //Todo set all the fields in the experiment object
+    private Experiment createExperiment(){
+        String TAG = System.currentTimeMillis() + "";
+        //creating sample echo experiment
+        InputDataObjectType inputDataObjectType = new InputDataObjectType();
+        inputDataObjectType.setName("Input_to_Echo");
+        inputDataObjectType.setValue("Hello World");
 
-        taskDetails.setTaskStatus(null);
-        experimentDao.updateTaskDetail(taskDetails);
-        taskDetails = experimentDao.getTaskDetail(taskId);
-        Assert.assertTrue(taskDetails.getTaskId().equals(taskId));
+        ComputationalResourceScheduling scheduling = new ComputationalResourceScheduling();
+        scheduling.setResourceHostId(UUID.randomUUID().toString());
+        scheduling.setComputationalProjectAccount("TG-STA110014S");
+        scheduling.setTotalCpuCount(1);
+        scheduling.setNodeCount(1);
+        scheduling.setWallTimeLimit(15);
+        scheduling.setQueueName("normal");
 
-        String expid = "alamotest2_5420547e-877a-4a9c-8752-377c2806906c";
-        Experiment experiment = experimentDao.getExperiment(expid);
-        System.out.println();
+        UserConfigurationData userConfigurationData = new UserConfigurationData();
+        userConfigurationData.setAiravataAutoSchedule(false);
+        userConfigurationData.setOverrideManualScheduledParams(false);
+        userConfigurationData.setComputationalResourceScheduling(scheduling);
+
+        Experiment experiment = new Experiment();
+        experiment.setExperimentId("28395669237854235"+TAG);
+        experiment.setProjectId("2392519y92312341" + TAG);
+        experiment.setUserName("TestUser" + TAG);
+        experiment.setName("TestExperiment" + TAG);
+        experiment.setDescription("experiment");
+        experiment.setApplicationId("2358382458362846287" + TAG);
+        experiment.setUserConfigurationData(userConfigurationData);
+        experiment.addToExperimentInputs(inputDataObjectType);
+        experiment.setGatewayExecutionId("default");
+        experiment.setEnableEmailNotification(true);
+        ArrayList<String> emailList = new ArrayList();
+        emailList.add("qwerty123@gmail.com");
+        experiment.setEmailAddresses(emailList);
+        ExperimentStatus experimentStatus = new ExperimentStatus();
+        experimentStatus.setExperimentState(ExperimentState.CREATED);
+        experiment.setExperimentStatus(experimentStatus);
+
+        experiment.addToWorkflowNodeDetailsList(createWorkFlowNodeDetails());
+        return experiment;
     }
 
-    @Test
-    public void testSearch() throws RegistryException{
-        Map<String, String> filters = new HashMap();
-        filters.put(Constants.FieldConstants.ExperimentConstants.USER_NAME, "Eroma123");
-        filters.put(Constants.FieldConstants.ExperimentConstants.EXPERIMENT_DESC, "Test");
-        List<Experiment> result = experimentDao.searchExperiments(
-                filters, 10, 2, Constants.FieldConstants.ExperimentConstants.CREATION_TIME, ResultOrderType.DESC);
-        Assert.assertNotNull(result);
-        Assert.assertTrue(result.size()==10);
-        Assert.assertTrue(result.get(0).getCreationTime() > result.get(9).getCreationTime());
+    private WorkflowNodeDetails createWorkFlowNodeDetails(){
+        String TAG = System.currentTimeMillis() + "";
+        WorkflowNodeDetails wfnd = new WorkflowNodeDetails();
+        wfnd.setNodeInstanceId("tempNode_4e1582bd-f9dd-4563-8808-472470c93dbc"+TAG);
+        wfnd.setNodeName("Temp Node" + TAG);
+        wfnd.setExecutionUnit(ExecutionUnit.APPLICATION);
+        WorkflowNodeStatus workflowNodeStatus = new WorkflowNodeStatus();
+        workflowNodeStatus.setWorkflowNodeState(WorkflowNodeState.UNKNOWN);
+        wfnd.setWorkflowNodeStatus(workflowNodeStatus);
+
+        TaskDetails taskDetails = new TaskDetails();
+        taskDetails.setTaskId("Temp_Task"+TAG);
+        taskDetails.setApplicationId("Ultrascan_856df1d5-944a-49d3-a476-d969e57a8f37");
+
+        wfnd.addToTaskDetailsList(taskDetails);
+        return wfnd;
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-mongo-registry/src/test/java/org/apache/airavata/persistence/registry/mongo/org/apache/airavata/persistence/registry/RegistryUseCaseTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-mongo-registry/src/test/java/org/apache/airavata/persistence/registry/mongo/org/apache/airavata/persistence/registry/RegistryUseCaseTest.java b/modules/registry/airavata-mongo-registry/src/test/java/org/apache/airavata/persistence/registry/mongo/org/apache/airavata/persistence/registry/RegistryUseCaseTest.java
deleted file mode 100644
index 0f0bd85..0000000
--- a/modules/registry/airavata-mongo-registry/src/test/java/org/apache/airavata/persistence/registry/mongo/org/apache/airavata/persistence/registry/RegistryUseCaseTest.java
+++ /dev/null
@@ -1,291 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.persistence.registry.mongo.org.apache.airavata.persistence.registry;
-
-import junit.framework.Assert;
-import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.utils.ServerSettings;
-import org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType;
-import org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType;
-import org.apache.airavata.model.workspace.Project;
-import org.apache.airavata.model.workspace.experiment.ComputationalResourceScheduling;
-import org.apache.airavata.model.workspace.experiment.Experiment;
-import org.apache.airavata.model.workspace.experiment.ExperimentSummary;
-import org.apache.airavata.model.workspace.experiment.UserConfigurationData;
-import org.apache.airavata.persistance.registry.jpa.impl.RegistryFactory;
-import org.apache.airavata.registry.cpi.*;
-import org.apache.airavata.registry.cpi.utils.Constants;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import java.sql.SQLException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-/**
- * This class contains test cases for the RegistryImpl class which is the default registry
- * implementation. These test cases are written from the perspective of the Airavata API
- * such as creating/updating/deleting/searching projects and experiments etc.
- */
-public class RegistryUseCaseTest {
-
-    private static Registry registry;
-
-    @BeforeClass
-    public static void setupBeforeClass() throws RegistryException, SQLException {
-        registry = RegistryFactory.getDefaultRegistry();
-    }
-
-    @Test
-    public void testProject(){
-        try {
-            String TAG = System.currentTimeMillis() + "";
-
-            String gatewayId = ServerSettings.getDefaultUserGateway();
-
-            //testing the creation of a project
-            Project project = new Project();
-            project.setOwner("TestUser"+TAG);
-            project.setName("TestProject"+TAG);
-            project.setDescription("This is a test project"+TAG);
-            String projectId1 = (String)registry.add(ParentDataType.PROJECT, project, gatewayId);
-            Assert.assertNotNull(projectId1);
-
-            //testing the updateExperiment of a project
-            Project updatedProject = new Project();
-            updatedProject.setProjectId(projectId1);
-            updatedProject.setOwner("TestUser"+TAG);
-            updatedProject.setName("UpdatedTestProject"+TAG);
-            updatedProject.setDescription("This is an updated test project"+TAG);
-            registry.update(RegistryModelType.PROJECT, updatedProject, projectId1);
-
-            //testing project retrieval
-            Project retrievedProject = (Project)registry.get(RegistryModelType.PROJECT, projectId1);
-            Assert.assertEquals(updatedProject.getProjectId(), retrievedProject.getProjectId());
-            Assert.assertEquals(updatedProject.getOwner(), retrievedProject.getOwner());
-            Assert.assertEquals(updatedProject.getName(), retrievedProject.getName());
-            Assert.assertEquals(updatedProject.getDescription(), retrievedProject.getDescription());
-            Assert.assertNotNull(retrievedProject.getCreationTime());
-            //created user should be in the shared users list
-            Assert.assertTrue(retrievedProject.getSharedUsers().size()==1);
-
-            //creating more projects for the same user
-            project = new Project();
-            project.setOwner("TestUser"+TAG);
-            project.setName("Project Terrible"+TAG);
-            project.setDescription("This is a test project_2"+TAG);
-            String projectId2 = (String)registry.add(ParentDataType.PROJECT, project, gatewayId);
-            Assert.assertNotNull(projectId2);
-
-            project = new Project();
-            project.setOwner("TestUser"+TAG);
-            project.setName("Project Funny"+TAG);
-            project.setDescription("This is a test project_3"+TAG);
-            String projectId3 = (String)registry.add(ParentDataType.PROJECT, project, gatewayId);
-            Assert.assertNotNull(projectId3);
-
-            project = new Project();
-            project.setOwner("TestUser"+TAG);
-            project.setName("Project Stupid"+TAG);
-            project.setDescription("This is a test project_4"+TAG);
-            String projectId4 = (String)registry.add(ParentDataType.PROJECT, project, gatewayId);
-            Assert.assertNotNull(projectId4);
-
-            project = new Project();
-            project.setOwner("TestUser"+TAG);
-            project.setName("Project Boring"+TAG);
-            project.setDescription("This is a test project_5"+TAG);
-            String projectId5 = (String)registry.add(ParentDataType.PROJECT, project, gatewayId);
-            Assert.assertNotNull(projectId5);
-
-            //test getExperiment all projects created by the user
-            List<Object> list = registry.get(RegistryModelType.PROJECT,
-                    Constants.FieldConstants.ProjectConstants.OWNER, "TestUser"+TAG);
-            Assert.assertTrue(list.size()==5);
-
-            //search project by project name
-            Map<String, String> filters = new HashMap<String, String>();
-            filters.put(Constants.FieldConstants.ProjectConstants.OWNER, "TestUser"+TAG);
-            filters.put(Constants.FieldConstants.ProjectConstants.PROJECT_NAME, "Terrible"+TAG);
-            list = registry.search(RegistryModelType.PROJECT, filters);
-            Assert.assertTrue(list.size()==1);
-
-            //search project by project description
-            filters = new HashMap<String, String>();
-            filters.put(Constants.FieldConstants.ProjectConstants.OWNER, "TestUser"+TAG);
-            filters.put(Constants.FieldConstants.ProjectConstants.DESCRIPTION, "test project_2"+TAG);
-            list = registry.search(RegistryModelType.PROJECT, filters);
-            Assert.assertTrue(list.size()==1);
-
-            //search project with only ownername
-            filters = new HashMap<String, String>();
-            filters.put(Constants.FieldConstants.ProjectConstants.OWNER, "TestUser"+TAG);
-            list = registry.search(RegistryModelType.PROJECT, filters);
-            Assert.assertTrue(list.size()==5);
-
-            //search projects with pagination
-            filters = new HashMap<String, String>();
-            filters.put(Constants.FieldConstants.ProjectConstants.OWNER, "TestUser"+TAG);
-            list = registry.search(RegistryModelType.PROJECT, filters, 2, 2,
-                    Constants.FieldConstants.ProjectConstants.CREATION_TIME, ResultOrderType.DESC);
-            Assert.assertTrue(list.size()==2);
-            Project project1 = (Project)list.get(0);
-            Project project2 = (Project)list.get(1);
-            Assert.assertTrue(project1.getCreationTime()-project2.getCreationTime() > 0);
-        } catch (RegistryException e) {
-            e.printStackTrace();
-            Assert.fail();
-        } catch (ApplicationSettingsException e) {
-            e.printStackTrace();
-        }
-    }
-
-    @Test
-    public void testExperiment(){
-        try {
-            String TAG = System.currentTimeMillis() + "";
-
-            String gatewayId = ServerSettings.getDefaultUserGateway();
-
-            //creating project
-            Project project = new Project();
-            project.setOwner("TestUser"+TAG);
-            project.setName("TestProject"+TAG);
-            project.setDescription("This is a test project"+TAG);
-            String projectId1 = (String)registry.add(ParentDataType.PROJECT, project, gatewayId);
-            Assert.assertNotNull(projectId1);
-
-            //creating sample echo experiment. assumes echo application is already defined
-            InputDataObjectType inputDataObjectType = new InputDataObjectType();
-            inputDataObjectType.setName("Input_to_Echo");
-            inputDataObjectType.setValue("Hello World");
-
-            ComputationalResourceScheduling scheduling = new ComputationalResourceScheduling();
-            scheduling.setResourceHostId(UUID.randomUUID().toString());
-            scheduling.setComputationalProjectAccount("TG-STA110014S");
-            scheduling.setTotalCpuCount(1);
-            scheduling.setNodeCount(1);
-            scheduling.setWallTimeLimit(15);
-            scheduling.setQueueName("normal");
-
-            UserConfigurationData userConfigurationData = new UserConfigurationData();
-            userConfigurationData.setAiravataAutoSchedule(false);
-            userConfigurationData.setOverrideManualScheduledParams(false);
-            userConfigurationData.setComputationalResourceScheduling(scheduling);
-
-            Experiment experiment = new Experiment();
-            experiment.setProjectId(projectId1);
-            experiment.setUserName("TestUser" + TAG);
-            experiment.setName("TestExperiment"+TAG);
-            experiment.setDescription("Test 1 experiment");
-            experiment.setApplicationId(UUID.randomUUID().toString());
-            experiment.setUserConfigurationData(userConfigurationData);
-            experiment.addToExperimentInputs(inputDataObjectType);
-
-            String experimentId1 = (String)registry.add(ParentDataType.EXPERIMENT, experiment, gatewayId);
-            Assert.assertNotNull(experimentId1);
-
-            //retrieving the stored experiment
-            Experiment retrievedExperiment = (Experiment)registry.get(RegistryModelType.EXPERIMENT,
-                    experimentId1);
-            Assert.assertNotNull(retrievedExperiment);
-            Assert.assertEquals(retrievedExperiment.getProjectId(), experiment.getProjectId());
-            Assert.assertEquals(retrievedExperiment.getDescription(), experiment.getDescription());
-            Assert.assertEquals(retrievedExperiment.getName(), experiment.getName());
-            Assert.assertEquals(retrievedExperiment.getApplicationId(), experiment.getApplicationId());
-            Assert.assertNotNull(retrievedExperiment.getUserConfigurationData());
-            Assert.assertNotNull(retrievedExperiment.getExperimentInputs());
-
-            //updating an existing experiment
-            experiment.setName("NewExperimentName"+TAG);
-            OutputDataObjectType outputDataObjectType = new OutputDataObjectType();
-            outputDataObjectType.setName("Output_to_Echo");
-            outputDataObjectType.setValue("Hello World");
-            experiment.addToExperimentOutputs(outputDataObjectType);
-            registry.update(RegistryModelType.EXPERIMENT, experiment, experimentId1);
-
-            //creating more experiments
-            experiment = new Experiment();
-            experiment.setProjectId(projectId1);
-            experiment.setUserName("TestUser" + TAG);
-            experiment.setName("TestExperiment2" + TAG);
-            experiment.setDescription("Test 2 experiment");
-            experiment.setApplicationId(UUID.randomUUID().toString());
-            experiment.setUserConfigurationData(userConfigurationData);
-            experiment.addToExperimentInputs(inputDataObjectType);
-
-            String experimentId2 = (String)registry.add(ParentDataType.EXPERIMENT, experiment, gatewayId);
-            Assert.assertNotNull(experimentId2);
-
-            experiment = new Experiment();
-            experiment.setProjectId(projectId1);
-            experiment.setUserName("TestUser" + TAG);
-            experiment.setName("TestExperiment3"+TAG);
-            experiment.setDescription("Test 3 experiment");
-            experiment.setApplicationId(UUID.randomUUID().toString());
-            experiment.setUserConfigurationData(userConfigurationData);
-            experiment.addToExperimentInputs(inputDataObjectType);
-
-            String experimentId3 = (String)registry.add(ParentDataType.EXPERIMENT, experiment, gatewayId);
-            Assert.assertNotNull(experimentId3);
-
-            //searching experiments by name
-            Map<String, String> filters = new HashMap<String, String>();
-            filters.put(Constants.FieldConstants.ExperimentConstants.USER_NAME, "TestUser" + TAG);
-            filters.put(Constants.FieldConstants.ExperimentConstants.GATEWAY, gatewayId);
-            filters.put(Constants.FieldConstants.ExperimentConstants.EXPERIMENT_NAME, "Experiment2");
-            List<Object> results = registry.search(RegistryModelType.EXPERIMENT, filters);
-            Assert.assertTrue(results.size()==1);
-
-            //retrieving all experiments in project
-            List<Object> list = registry.get(RegistryModelType.EXPERIMENT,
-                    Constants.FieldConstants.ExperimentConstants.PROJECT_ID, projectId1);
-            Assert.assertTrue(list.size()==3);
-
-            //searching all user experiments
-            filters = new HashMap<String, String>();
-            filters.put(Constants.FieldConstants.ExperimentConstants.USER_NAME, "TestUser" + TAG);
-            filters.put(Constants.FieldConstants.ExperimentConstants.GATEWAY, gatewayId);
-            list = registry.search(RegistryModelType.EXPERIMENT, filters);
-            Assert.assertTrue(list.size()==3);
-
-            //searching user experiemets with pagination
-            filters = new HashMap<String, String>();
-            filters.put(Constants.FieldConstants.ExperimentConstants.USER_NAME, "TestUser" + TAG);
-            filters.put(Constants.FieldConstants.ExperimentConstants.GATEWAY, gatewayId);
-            list = registry.search(RegistryModelType.EXPERIMENT, filters, 2, 1,
-                    Constants.FieldConstants.ExperimentConstants.CREATION_TIME, ResultOrderType.DESC);
-            Assert.assertTrue(list.size()==2);
-            ExperimentSummary exp1 = (ExperimentSummary)list.get(0);
-            ExperimentSummary exp2 = (ExperimentSummary)list.get(1);
-            Assert.assertTrue(exp1.getCreationTime()-exp2.getCreationTime() > 0);
-
-        } catch (RegistryException e) {
-            e.printStackTrace();
-            Assert.fail();
-        } catch (ApplicationSettingsException e) {
-            e.printStackTrace();
-        }
-    }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/interpretor/WorkflowInterpreter.java
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/interpretor/WorkflowInterpreter.java b/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/interpretor/WorkflowInterpreter.java
index a09d236..805477d 100644
--- a/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/interpretor/WorkflowInterpreter.java
+++ b/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/interpretor/WorkflowInterpreter.java
@@ -74,7 +74,6 @@ import org.apache.airavata.workflow.model.wf.WorkflowExecutionState;
 import org.apache.thrift.TException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.xmlpull.infoset.XmlElement;
 
 import javax.xml.xpath.XPath;
 import javax.xml.xpath.XPathConstants;


Mime
View raw message