airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject git commit: add unit tests - AIRAVATA-1025
Date Tue, 25 Feb 2014 21:45:40 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 204aab12f -> db954ff0c


add unit tests - AIRAVATA-1025


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/db954ff0
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/db954ff0
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/db954ff0

Branch: refs/heads/master
Commit: db954ff0ceecb89a2fa896f748ab8f92f216316d
Parents: 204aab1
Author: chathuri <chathuri@apache.org>
Authored: Tue Feb 25 16:45:23 2014 -0500
Committer: chathuri <chathuri@apache.org>
Committed: Tue Feb 25 16:45:23 2014 -0500

----------------------------------------------------------------------
 .../jpa/resources/AbstractResource.java         | 140 +++++++++----------
 .../ComputationSchedulingResource.java          |   8 +-
 .../registry/jpa/resources/Utils.java           |  24 ++--
 .../jpa/ComputationalSchedulingTest.java        |  84 +++++++++++
 .../registry/jpa/util/Initialize.java           |   2 +-
 .../src/test/resources/registry-derby.sql       |   1 +
 6 files changed, 177 insertions(+), 82 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/db954ff0/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/AbstractResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/AbstractResource.java
b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/AbstractResource.java
index ff21c16..0cb4143 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/AbstractResource.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/AbstractResource.java
@@ -39,7 +39,7 @@ public abstract class AbstractResource implements Resource {
 	public static final String SERVICE_DESCRIPTOR = "Service_Descriptor";
 	public static final String APPLICATION_DESCRIPTOR = "Application_Descriptor";
 	public static final String EXPERIMENT = "Experiment";
-	public static final String EXPERIMENT_CONFIG_DATA = "Configuration_Data";
+	public static final String EXPERIMENT_CONFIG_DATA = "ExperimentConfigData";
 	public static final String EXPERIMENT_INPUT = "Experiment_Input";
 	public static final String EXPERIMENT_OUTPUT = "Experiment_Output";
 	public static final String WORKFLOW_NODE_DETAIL = "WorkflowNodeDetail";
@@ -53,9 +53,9 @@ public abstract class AbstractResource implements Resource {
 	public static final String DATA_TRANSFER_DETAIL = "DataTransferDetail";
 	public static final String STATUS = "Status";
 	public static final String CONFIG_DATA = "Config_Data";
-	public static final String COMPUTATIONAL_RESOURCE_SCHEDULING = "Computation_Resource_Scheduling";
-	public static final String ADVANCE_INPUT_DATA_HANDLING = "AdvanceInputDataHandling";
-	public static final String ADVANCE_OUTPUT_DATA_HANDLING = "AdvanceOutputDataHandling";
+	public static final String COMPUTATIONAL_RESOURCE_SCHEDULING = "Computational_Resource_Scheduling";
+	public static final String ADVANCE_INPUT_DATA_HANDLING = "AdvancedInputDataHandling";
+	public static final String ADVANCE_OUTPUT_DATA_HANDLING = "AdvancedOutputDataHandling";
 	public static final String QOS_PARAMS = "QosParams";
 
 
@@ -160,67 +160,67 @@ public abstract class AbstractResource implements Resource {
     // Experiment Configuration Data table
     public final class ExperimentConfigurationDataConstants {
         public static final String EXPERIMENT_ID = "expId";
-        public static final String AIRAVATA_AUTO_SCHEDULE = "airavata_auto_schedule";
-        public static final String OVERRIDE_MANUAL_SCHEDULE = "override_manual_schedule";
-        public static final String SHARE_EXPERIMENT = "share_experiment";
+        public static final String AIRAVATA_AUTO_SCHEDULE = "airavataAutoSchedule";
+        public static final String OVERRIDE_MANUAL_SCHEDULE = "overrideManualParams";
+        public static final String SHARE_EXPERIMENT = "shareExp";
     }
 
     //Experiment Input table
     public final class ExperimentInputConstants {
-        public static final String EXPERIMENT_ID = "expId";
-        public static final String EXPERIMENT_INPUT_KEY = "input_key";
+        public static final String EXPERIMENT_ID = "experiment_id";
+        public static final String EXPERIMENT_INPUT_KEY = "ex_key";
         public static final String EXPERIMENT_INPUT_VAL = "value";
-        public static final String INPUT_TYPE = "input_type";
+        public static final String INPUT_TYPE = "inputType";
         public static final String METADATA = "metadata";
     }
 
     //Experiment Output table
     public final class ExperimentOutputConstants {
-        public static final String EXPERIMENT_ID = "expId";
-        public static final String EXPERIMENT_OUTPUT_KEY = "output_key";
+        public static final String EXPERIMENT_ID = "experiment_id";
+        public static final String EXPERIMENT_OUTPUT_KEY = "ex_key";
         public static final String EXPERIMENT_OUTPUT_VAL = "value";
-        public static final String OUTPUT_TYPE = "output_type";
+        public static final String OUTPUT_TYPE = "outputKeyType";
         public static final String METADATA = "metadata";
     }
 
 	// Workflow_Data table
 	public final class WorkflowNodeDetailsConstants {
-		public static final String EXPERIMENT_ID = "experiment_ID";
+		public static final String EXPERIMENT_ID = "expId";
 		public static final String NODE_INSTANCE_ID = "nodeId";
-		public static final String CREATION_TIME = "creation_time";
-		public static final String NODE_NAME = "node_name";
+		public static final String CREATION_TIME = "creationTime";
+		public static final String NODE_NAME = "nodeName";
 	}
 
 	// TaskDetail table
 	public final class TaskDetailConstants {
 		public static final String TASK_ID = "taskId";
 		public static final String NODE_INSTANCE_ID = "nodeId";
-		public static final String CREATION_TIME = "creation_type";
-		public static final String APPLICATION_ID = "application_id";
-		public static final String APPLICATION_VERSION = "application_version";
+		public static final String CREATION_TIME = "creationTime";
+		public static final String APPLICATION_ID = "appId";
+		public static final String APPLICATION_VERSION = "appVersion";
 	}
 
 	// ErrorDetails table
 	public final class ErrorDetailConstants {
-		public static final String ERROR_ID = "error_id";
+		public static final String ERROR_ID = "errorID";
 		public static final String EXPERIMENT_ID = "expId";
 		public static final String TASK_ID = "taskId";
-		public static final String JOB_ID = "job_id";
+		public static final String JOB_ID = "jobId";
 		public static final String NODE_INSTANCE_ID = "nodeId";
-		public static final String CREATION_TIME = "creation_time";
-		public static final String ACTUAL_ERROR_MESSAGE = "actual_error_message";
-		public static final String USER_FRIEDNLY_ERROR_MSG = "user_friendly_error_msg";
-		public static final String TRANSIENT_OR_PERSISTENT = "transient_or_persistent";
-		public static final String ERROR_CATEGORY = "error_category";
-		public static final String CORRECTIVE_ACTION = "corrective_action";
-		public static final String ACTIONABLE_GROUP = "actionable_group";
+		public static final String CREATION_TIME = "creationTime";
+		public static final String ACTUAL_ERROR_MESSAGE = "actualErrorMsg";
+		public static final String USER_FRIEDNLY_ERROR_MSG = "userFriendlyErrorMsg";
+		public static final String TRANSIENT_OR_PERSISTENT = "transientPersistent";
+		public static final String ERROR_CATEGORY = "errorCategory";
+		public static final String CORRECTIVE_ACTION = "correctiveAction";
+		public static final String ACTIONABLE_GROUP = "actionableGroup";
 	}
 
     // ApplicationInput table
 	public final class ApplicationInputConstants {
 		public static final String TASK_ID = "taskId";
-		public static final String INPUT_KEY = "input_key";
-		public static final String INPUT_KEY_TYPE = "input_key_type";
+		public static final String INPUT_KEY = "inputKey";
+		public static final String INPUT_KEY_TYPE = "inputKeyType";
 		public static final String METADATA = "metadata";
 		public static final String VALUE = "value";
 	}
@@ -228,8 +228,8 @@ public abstract class AbstractResource implements Resource {
     // ApplicationOutput table
     public final class ApplicationOutputConstants {
         public static final String TASK_ID = "taskId";
-        public static final String OUTPUT_KEY = "output_key";
-        public static final String OUTPUT_KEY_TYPE = "output_key_type";
+        public static final String OUTPUT_KEY = "outputKey";
+        public static final String OUTPUT_KEY_TYPE = "outputKeyType";
         public static final String METADATA = "metadata";
         public static final String VALUE = "value";
     }
@@ -237,8 +237,8 @@ public abstract class AbstractResource implements Resource {
     // NodeInput table
     public final class NodeInputConstants {
         public static final String NODE_INSTANCE_ID = "nodeId";
-        public static final String INPUT_KEY = "input_key";
-        public static final String INPUT_KEY_TYPE = "input_key_type";
+        public static final String INPUT_KEY = "inputKey";
+        public static final String INPUT_KEY_TYPE = "inputKeyType";
         public static final String METADATA = "metadata";
         public static final String VALUE = "value";
     }
@@ -246,82 +246,82 @@ public abstract class AbstractResource implements Resource {
     // NodeOutput table
     public final class NodeOutputConstants {
         public static final String NODE_INSTANCE_ID = "nodeId";
-        public static final String OUTPUT_KEY = "output_key";
-        public static final String OUTPUT_KEY_TYPE = "output_key_type";
+        public static final String OUTPUT_KEY = "outputKey";
+        public static final String OUTPUT_KEY_TYPE = "outputKeyType";
         public static final String METADATA = "metadata";
         public static final String VALUE = "value";
     }
 
     // Job Details table constants
     public final class JobDetailConstants{
-        public static final String JOB_ID = "job_id";
+        public static final String JOB_ID = "jobId";
         public static final String TASK_ID = "taskId";
-        public static final String JOB_DESCRIPTION = "job_description";
-        public static final String CREATION_TIME = "creation_time";
+        public static final String JOB_DESCRIPTION = "jobDescription";
+        public static final String CREATION_TIME = "jobDescription";
     }
 
     // Data transfer Details table constants
     public final class DataTransferDetailConstants{
-        public static final String TRANSFER_ID = "transfer_id";
+        public static final String TRANSFER_ID = "transferId";
         public static final String TASK_ID = "taskId";
-        public static final String TRANSFER_DESC = "transfer_description";
-        public static final String CREATION_TIME = "creation_time";
+        public static final String TRANSFER_DESC = "transferDesc";
+        public static final String CREATION_TIME = "creationTime";
     }
 
     // Status table constants
     public final class StatusConstants {
-        public static final String STATUS_ID = "status_id";
+        public static final String STATUS_ID = "statusId";
         public static final String EXPERIMENT_ID = "expId";
         public static final String NODE_INSTANCE_ID = "nodeId";
-        public static final String TRANSFER_ID = "transfer_id";
+        public static final String TRANSFER_ID = "transferId";
         public static final String TASK_ID = "taskId";
-        public static final String JOB_ID = "job_id";
+        public static final String JOB_ID = "jobId";
         public static final String STATE = "state";
-        public static final String STATUS_UPDATE_TIME = "status_update_time";
-        public static final String STATUS_TYPE = "status_type";
+        public static final String STATUS_UPDATE_TIME = "statusUpdateTime";
+        public static final String STATUS_TYPE = "statusType";
     }
 
     public static final class ComputationalResourceSchedulingConstants{
-        public static final String RESOURCE_SCHEDULING_ID = "resource_scheduling_id";
+        public static final String RESOURCE_SCHEDULING_ID = "schedulingId";
         public static final String EXPERIMENT_ID = "expId";
         public static final String TASK_ID = "taskId";
-        public static final String RESOURCE_HOST_ID = "resource_host_id";
-        public static final String CPU_COUNT = "cpu_count";
-        public static final String NODE_COUNT = "node_count";
-        public static final String NO_OF_THREADS = "no_of_threads";
-        public static final String QUEUE_NAME = "queue_name";
-        public static final String WALLTIME_LIMIT = "walltime_limit";
-        public static final String JOB_START_TIME = "job_start_time";
-        public static final String TOTAL_PHYSICAL_MEMORY = "total_physical_memory";
-        public static final String COMPUTATIONAL_PROJECT_ACCOUNT = "computational_project_accont";
+        public static final String RESOURCE_HOST_ID = "resourceHostId";
+        public static final String CPU_COUNT = "cpuCount";
+        public static final String NODE_COUNT = "nodeCount";
+        public static final String NO_OF_THREADS = "numberOfThreads";
+        public static final String QUEUE_NAME = "queueName";
+        public static final String WALLTIME_LIMIT = "wallTimeLimit";
+        public static final String JOB_START_TIME = "jobStartTime";
+        public static final String TOTAL_PHYSICAL_MEMORY = "totalPhysicalmemory";
+        public static final String COMPUTATIONAL_PROJECT_ACCOUNT = "projectName";
     }
 
     public static final class AdvancedInputDataHandlingConstants {
-        public static final String INPUT_DATA_HANDLING_ID = "input_data_handling_id";
+        public static final String INPUT_DATA_HANDLING_ID = "dataHandlingId";
         public static final String EXPERIMENT_ID = "expId";
         public static final String TASK_ID = "taskId";
-        public static final String WORKING_DIR_PARENT = "working_dir_parent";
-        public static final String UNIQUE_WORKING_DIR = "unique_working_dir";
-        public static final String STAGE_INPUT_FILES_TO_WORKING_DIR = "stage_input_files_to_working_dir";
-        public static final String CLEAN_AFTER_JOB = "clean_after_job";
+        public static final String WORKING_DIR_PARENT = "parentWorkingDir";
+        public static final String UNIQUE_WORKING_DIR = "workingDir";
+        public static final String STAGE_INPUT_FILES_TO_WORKING_DIR = "stageInputsToWorkingDir";
+        public static final String CLEAN_AFTER_JOB = "cleanAfterJob";
     }
 
     public static final class AdvancedOutputDataHandlingConstants {
-        public static final String OUTPUT_DATA_HANDLING_ID = "output_data_handling_id";
+        public static final String OUTPUT_DATA_HANDLING_ID = "outputDataHandlingId";
         public static final String EXPERIMENT_ID = "expId";
         public static final String TASK_ID = "taskId";
-        public static final String OUTPUT_DATA_DIR = "output_data_dir";
-        public static final String DATA_REG_URL = "data_reg_url";
-        public static final String PERSIST_OUTPUT_DATA = "persist_output_data";
+        public static final String OUTPUT_DATA_DIR = "outputDataDir";
+        public static final String DATA_REG_URL = "dataRegUrl";
+        public static final String PERSIST_OUTPUT_DATA = "persistOutputData";
     }
 
     public static final class QosParamsConstants {
-        public static final String QOS_ID = "qos_id";
+        public static final String QOS_ID = "qosId";
         public static final String EXPERIMENT_ID = "expId";
         public static final String TASK_ID = "taskId";
-        public static final String START_EXECUTION_AT = "start_execution_at";
-        public static final String EXECUTE_BEFORE = "execute_before";
-        public static final String NO_OF_RETRIES = "no_of_retries";
+        public static final String START_EXECUTION_AT = "startExecutionAt";
+        public static final String EXECUTE_BEFORE = "executeBefore";
+        public static final String NO_OF_RETRIES = "noOfRetries";
     }
 
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/db954ff0/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ComputationSchedulingResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ComputationSchedulingResource.java
b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ComputationSchedulingResource.java
index 0056bbb..6bfab5b 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ComputationSchedulingResource.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ComputationSchedulingResource.java
@@ -176,11 +176,13 @@ public class ComputationSchedulingResource extends AbstractResource
{
 
         Computational_Resource_Scheduling scheduling = new Computational_Resource_Scheduling();
         Experiment experiment = em.find(Experiment.class, experimentResource.getExpID());
-        TaskDetail taskDetail = em.find(TaskDetail.class, taskDetailResource.getTaskId());
+        if (taskDetailResource != null){
+            TaskDetail taskDetail = em.find(TaskDetail.class, taskDetailResource.getTaskId());
+            scheduling.setTask(taskDetail);
+            scheduling.setTaskId(taskDetailResource.getTaskId());
+        }
         scheduling.setExpId(experimentResource.getExpID());
         scheduling.setExperiment(experiment);
-        scheduling.setTaskId(taskDetailResource.getTaskId());
-        scheduling.setTask(taskDetail);
         scheduling.setResourceHostId(resourceHostId);
         scheduling.setCpuCount(cpuCount);
         scheduling.setNodeCount(nodeCount);

http://git-wip-us.apache.org/repos/asf/airavata/blob/db954ff0/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java
b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java
index 7626a41..7e0cfeb 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java
@@ -744,8 +744,10 @@ public class Utils {
         ComputationSchedulingResource schedulingResource = new ComputationSchedulingResource();
         ExperimentResource experimentResource = (ExperimentResource)createExperiment(o.getExperiment());
         schedulingResource.setExperimentResource(experimentResource);
-        TaskDetailResource taskDetailResource = (TaskDetailResource)createTaskDetail(o.getTask());
-        schedulingResource.setTaskDetailResource(taskDetailResource);
+        if (o.getTask() != null){
+            TaskDetailResource taskDetailResource = (TaskDetailResource)createTaskDetail(o.getTask());
+            schedulingResource.setTaskDetailResource(taskDetailResource);
+        }
         schedulingResource.setSchedulingId(o.getSchedulingId());
         schedulingResource.setResourceHostId(o.getResourceHostId());
         schedulingResource.setCpuCount(o.getCpuCount());
@@ -763,8 +765,10 @@ public class Utils {
         AdvanceInputDataHandlingResource dataHandlingResource = new AdvanceInputDataHandlingResource();
         ExperimentResource experimentResource = (ExperimentResource)createExperiment(o.getExperiment());
         dataHandlingResource.setExperimentResource(experimentResource);
-        TaskDetailResource taskDetailResource = (TaskDetailResource)createTaskDetail(o.getTask());
-        dataHandlingResource.setTaskDetailResource(taskDetailResource);
+        if (o.getTask() != null){
+            TaskDetailResource taskDetailResource = (TaskDetailResource)createTaskDetail(o.getTask());
+            dataHandlingResource.setTaskDetailResource(taskDetailResource);
+        }
         dataHandlingResource.setDataHandlingId(o.getDataHandlingId());
         dataHandlingResource.setWorkingDirParent(o.getParentWorkingDir());
         dataHandlingResource.setWorkingDir(o.getWorkingDir());
@@ -777,8 +781,10 @@ public class Utils {
         AdvancedOutputDataHandlingResource dataHandlingResource = new AdvancedOutputDataHandlingResource();
         ExperimentResource experimentResource = (ExperimentResource)createExperiment(o.getExperiment());
         dataHandlingResource.setExperimentResource(experimentResource);
-        TaskDetailResource taskDetailResource = (TaskDetailResource)createTaskDetail(o.getTask());
-        dataHandlingResource.setTaskDetailResource(taskDetailResource);
+        if (o.getTask() != null){
+            TaskDetailResource taskDetailResource = (TaskDetailResource)createTaskDetail(o.getTask());
+            dataHandlingResource.setTaskDetailResource(taskDetailResource);
+        }
         dataHandlingResource.setOutputDataHandlingId(o.getOutputDataHandlingId());
         dataHandlingResource.setOutputDataDir(o.getOutputDataDir());
         dataHandlingResource.setDataRegUrl(o.getDataRegUrl());
@@ -790,8 +796,10 @@ public class Utils {
         QosParamResource qosParamResource = new QosParamResource();
         ExperimentResource experimentResource = (ExperimentResource)createExperiment(o.getExperiment());
         qosParamResource.setExperimentResource(experimentResource);
-        TaskDetailResource taskDetailResource = (TaskDetailResource)createTaskDetail(o.getTask());
-        qosParamResource.setTaskDetailResource(taskDetailResource);
+        if (o.getTask() != null){
+            TaskDetailResource taskDetailResource = (TaskDetailResource)createTaskDetail(o.getTask());
+            qosParamResource.setTaskDetailResource(taskDetailResource);
+        }
         qosParamResource.setQosId(o.getQosId());
         qosParamResource.setExecuteBefore(o.getExecuteBefore());
         qosParamResource.setStartExecutionAt(o.getStartExecutionAt());

http://git-wip-us.apache.org/repos/asf/airavata/blob/db954ff0/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ComputationalSchedulingTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ComputationalSchedulingTest.java
b/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ComputationalSchedulingTest.java
new file mode 100644
index 0000000..2282de1
--- /dev/null
+++ b/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ComputationalSchedulingTest.java
@@ -0,0 +1,84 @@
+/*
+ *
+ * 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.jpa;
+
+import org.apache.airavata.persistance.registry.jpa.resources.ComputationSchedulingResource;
+import org.apache.airavata.persistance.registry.jpa.resources.ExperimentResource;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.sql.Timestamp;
+import java.util.Date;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+public class ComputationalSchedulingTest extends AbstractResourceTest {
+    private ExperimentResource experimentResource;
+    private ComputationSchedulingResource schedulingResource;
+    private String experimentID = "testExpID";
+
+    @Override
+    @Before
+    public void setUp() throws Exception {
+        super.setUp();
+        experimentResource = (ExperimentResource) getGatewayResource().create(ResourceType.EXPERIMENT);
+        experimentResource.setExpID(experimentID);
+        experimentResource.setWorker(getWorkerResource());
+        experimentResource.setProject(getProjectResource());
+        Timestamp currentDate = new Timestamp(new Date().getTime());
+        experimentResource.setCreationTime(currentDate);
+        experimentResource.setApplicationId("testApplication");
+        experimentResource.setApplicationVersion("1.0");
+        experimentResource.setDescription("Test Application");
+        experimentResource.setExpName("TestExperiment");
+        experimentResource.save();
+
+        schedulingResource = (ComputationSchedulingResource)experimentResource.create(ResourceType.COMPUTATIONAL_RESOURCE_SCHEDULING);
+        schedulingResource.setResourceHostId("testResource");
+        schedulingResource.setCpuCount(10);
+        schedulingResource.setNodeCount(5);
+        schedulingResource.setPhysicalMemory(1000);
+        schedulingResource.setProjectName("project1");
+        schedulingResource.setQueueName("testQueue");
+        schedulingResource.save();
+        System.out.println("scheduling id : " + schedulingResource.getSchedulingId());
+    }
+
+
+    @Test
+    public void testSave() throws Exception {
+        assertTrue("Computational schedule successfully", experimentResource.isExists(ResourceType.COMPUTATIONAL_RESOURCE_SCHEDULING,
experimentID));
+    }
+
+    @Test
+    public void testRemove() throws Exception {
+        experimentResource.remove(ResourceType.COMPUTATIONAL_RESOURCE_SCHEDULING, experimentID);
+        assertFalse("Computational schedule removed successfully", experimentResource.isExists(ResourceType.COMPUTATIONAL_RESOURCE_SCHEDULING,
experimentID));
+    }
+
+    @After
+    public void tearDown() throws Exception {
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/db954ff0/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/util/Initialize.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/util/Initialize.java
b/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/util/Initialize.java
index 936ab67..daa64b3 100644
--- a/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/util/Initialize.java
+++ b/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/util/Initialize.java
@@ -45,7 +45,7 @@ import java.util.StringTokenizer;
 public class Initialize {
     private static final Logger logger = LoggerFactory.getLogger(Initialize.class);
     public static final String DERBY_SERVER_MODE_SYS_PROPERTY = "derby.drda.startNetworkServer";
-    public  String scriptName = "airavata-registry-derby.sql";
+    public  String scriptName = "registry-derby.sql";
     private NetworkServerControl server;
     private static final String delimiter = ";";
     public static final String PERSISTANT_DATA = "Configuration";

http://git-wip-us.apache.org/repos/asf/airavata/blob/db954ff0/modules/registry/airavata-jpa-registry/src/test/resources/registry-derby.sql
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/test/resources/registry-derby.sql
b/modules/registry/airavata-jpa-registry/src/test/resources/registry-derby.sql
index d65118c..7b8fb39 100644
--- a/modules/registry/airavata-jpa-registry/src/test/resources/registry-derby.sql
+++ b/modules/registry/airavata-jpa-registry/src/test/resources/registry-derby.sql
@@ -193,6 +193,7 @@ CREATE TABLE ERROR_DETAIL
          EXPERIMENT_ID VARCHAR(255),
          TASK_ID VARCHAR(255),
          NODE_INSTANCE_ID VARCHAR(255),
+         JOB_ID VARCHAR(255),
          CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
          ACTUAL_ERROR_MESSAGE CLOB,
          USER_FRIEDNLY_ERROR_MSG VARCHAR(255),


Mime
View raw message