airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject [2/6] Adding data models for execution - AIRAVATA-994 - Integration test failures can occur
Date Tue, 04 Feb 2014 19:52:17 GMT
http://git-wip-us.apache.org/repos/asf/airavata/blob/10b41d86/modules/registry/airavata-jpa-registry/src/main/resources/airavata-registry-mysql.sql
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/resources/airavata-registry-mysql.sql b/modules/registry/airavata-jpa-registry/src/main/resources/airavata-registry-mysql.sql
new file mode 100644
index 0000000..f5e9f4f
--- /dev/null
+++ b/modules/registry/airavata-jpa-registry/src/main/resources/airavata-registry-mysql.sql
@@ -0,0 +1,319 @@
+/*
+ *
+ * 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.
+ *
+ */
+CREATE TABLE GATEWAY
+(
+        GATEWAY_NAME VARCHAR(255),
+	      OWNER VARCHAR(255),
+        PRIMARY KEY (GATEWAY_NAME)
+);
+
+
+CREATE TABLE CONFIGURATION
+(
+        CONFIG_KEY VARCHAR(255),
+        CONFIG_VAL VARCHAR(255),
+        EXPIRE_DATE TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+        CATEGORY_ID VARCHAR (255),
+        PRIMARY KEY(CONFIG_KEY, CONFIG_VAL, CATEGORY_ID)
+);
+
+INSERT INTO CONFIGURATION (CONFIG_KEY, CONFIG_VAL, EXPIRE_DATE, CATEGORY_ID) VALUES('registry.version', '0.12', CURRENT_TIMESTAMP ,'SYSTEM');
+
+CREATE TABLE USERS
+(
+        USER_NAME VARCHAR(255),
+        PASSWORD VARCHAR(255),
+        PRIMARY KEY(USER_NAME)
+);
+
+CREATE TABLE GATEWAY_WORKER
+(
+        GATEWAY_NAME VARCHAR(255),
+        USER_NAME VARCHAR(255),
+        PRIMARY KEY (GATEWAY_NAME, USER_NAME),
+        FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
+        FOREIGN KEY (USER_NAME) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
+);
+
+CREATE TABLE PROJECT
+(
+         GATEWAY_NAME VARCHAR(255),
+         USER_NAME VARCHAR(255),
+         PROJECT_NAME VARCHAR(255),
+         PRIMARY KEY (PROJECT_NAME),
+         FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
+         FOREIGN KEY (USER_NAME) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
+);
+
+CREATE TABLE PUBLISHED_WORKFLOW
+(
+         GATEWAY_NAME VARCHAR(255),
+         CREATED_USER VARCHAR(255),
+         PUBLISH_WORKFLOW_NAME VARCHAR(255),
+         VERSION VARCHAR(255),
+         PUBLISHED_DATE TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+         PATH VARCHAR (255),
+         WORKFLOW_CONTENT BLOB,
+         PRIMARY KEY(GATEWAY_NAME, PUBLISH_WORKFLOW_NAME),
+         FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
+         FOREIGN KEY (CREATED_USER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
+);
+
+CREATE TABLE USER_WORKFLOW
+(
+         GATEWAY_NAME VARCHAR(255),
+         OWNER VARCHAR(255),
+         TEMPLATE_NAME VARCHAR(255),
+         LAST_UPDATED_TIME TIMESTAMP DEFAULT NOW() ON UPDATE NOW(),
+         PATH VARCHAR (255),
+         WORKFLOW_GRAPH BLOB,
+         PRIMARY KEY(GATEWAY_NAME, OWNER, TEMPLATE_NAME),
+         FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
+         FOREIGN KEY (OWNER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
+);
+
+CREATE TABLE HOST_DESCRIPTOR
+(
+         GATEWAY_NAME VARCHAR(255),
+         UPDATED_USER VARCHAR(255),
+         HOST_DESCRIPTOR_ID VARCHAR(255),
+         HOST_DESCRIPTOR_XML BLOB,
+         PRIMARY KEY(GATEWAY_NAME, HOST_DESCRIPTOR_ID),
+         FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
+         FOREIGN KEY (UPDATED_USER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
+);
+
+CREATE TABLE SERVICE_DESCRIPTOR
+(
+         GATEWAY_NAME VARCHAR(255),
+         UPDATED_USER VARCHAR(255),
+         SERVICE_DESCRIPTOR_ID VARCHAR(255),
+         SERVICE_DESCRIPTOR_XML BLOB,
+         PRIMARY KEY(GATEWAY_NAME,SERVICE_DESCRIPTOR_ID),
+         FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
+         FOREIGN KEY (UPDATED_USER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
+);
+
+CREATE TABLE APPLICATION_DESCRIPTOR
+(
+         GATEWAY_NAME VARCHAR(255),
+         UPDATED_USER VARCHAR(255),
+         APPLICATION_DESCRIPTOR_ID VARCHAR(255),
+         HOST_DESCRIPTOR_ID VARCHAR(255),
+         SERVICE_DESCRIPTOR_ID VARCHAR(255),
+         APPLICATION_DESCRIPTOR_XML BLOB,
+         PRIMARY KEY(GATEWAY_NAME,APPLICATION_DESCRIPTOR_ID),
+         FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
+         FOREIGN KEY (UPDATED_USER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
+);
+
+CREATE TABLE EXPERIMENT_METADATA
+(
+          EXPERIMENT_ID VARCHAR(255) NOT NULL,
+          EXPERIMENT_NAME VARCHAR(255) NOT NULL,
+          DESCRIPTION VARCHAR(255),
+          SUBMITTED_DATE TIMESTAMP DEFAULT NOW() ON UPDATE NOW(),
+          EXECUTION_USER VARCHAR(255),
+          GATEWAY_NAME VARCHAR(255),
+          SHARE_EXPERIMENT SMALLINT,
+          PROJECT_NAME VARCHAR(255),
+          PRIMARY KEY (EXPERIMENT_ID),
+          FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
+          FOREIGN KEY (EXECUTION_USER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE,
+          FOREIGN KEY (PROJECT_NAME) REFERENCES PROJECT(PROJECT_NAME) ON DELETE CASCADE
+);
+
+CREATE TABLE EXPERIMENT_SUMMARY
+(
+          EXPERIMENT_ID VARCHAR(255) NOT NULL,
+          STATUS VARCHAR(255),
+          LAST_UPDATED_TIME TIMESTAMP DEFAULT NOW() ON UPDATE NOW(),
+          PRIMARY KEY(EXPERIMENT_ID),
+          FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT_METADATA(EXPERIMENT_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE EXPERIMENT_CONFIGURATION_DATA
+(
+          EXPERIMENT_ID VARCHAR(255) NOT NULL,
+          RESOURCE_HOST_ID VARCHAR (255),
+          TOTAL_CPU_COUNT INT(11),
+          NODE_COUNT INT(11),
+          NUMBER_OF_THREADS INT(11),
+          QUEUE_NAME VARCHAR (255),
+          WALLTIME_LIMIT INT(11),
+          JOB_START_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+          TOTAL_PHYSICAL_MEMORY INT(11),
+          COMPUTATIONAL_PROJECT_ACCOUNT VARCHAR(255),
+          AIRAVATA_AUTO_SCHEDULE SMALLINT,
+          OVERRIDE_MANUAL_SCHEDULE_PARAMS SMALLINT,
+          WORKING_DIR VARCHAR(255),
+          STAGE_INPUT_FILES_TO_WORKING_DIR SMALLINT,
+          OUTPUT_DATA_DIR VARCHAR(255),
+          DATA_REG_URL VARCHAR (255),
+          PERSIST_OUTPUT_DATA SMALLINT,
+          CLEAN_AFTER_JOB SMALLINT,
+          EXPERIMENT_CONFIG_DATA BLOB,
+          PRIMARY KEY (EXPERIMENT_ID),
+          FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT_METADATA(EXPERIMENT_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE EXPERIMENT_INPUT
+(
+        EXPERIMENT_ID VARCHAR(255) NOT NULL,
+        EX_KEY VARCHAR(255) NOT NULL,
+        VALUE VARCHAR(255),
+        PRIMARY KEY (EXPERIMENT_ID, EX_KEY),
+        FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT_METADATA(EXPERIMENT_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE EXPERIMENT_OUTPUT
+(
+        EXPERIMENT_ID VARCHAR(255) NOT NULL,
+        EX_KEY VARCHAR (255) NOT NULL,
+        VALUE VARCHAR (255),
+        PRIMARY KEY (EXPERIMENT_ID, EX_KEY),
+        FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT_METADATA(EXPERIMENT_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE WORKFLOW_DATA
+(
+       EXPERIMENT_ID VARCHAR(255),
+       WORKFLOW_INSTANCE_ID VARCHAR(255),
+       TEMPLATE_NAME VARCHAR(255),
+       STATUS VARCHAR(255),
+       START_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+       LAST_UPDATE_TIME TIMESTAMP DEFAULT NOW() ON UPDATE NOW(),
+       PRIMARY KEY(WORKFLOW_INSTANCE_ID),
+       FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT_METADATA(EXPERIMENT_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE NODE_DATA
+(
+       WORKFLOW_INSTANCE_ID VARCHAR(255),
+       NODE_ID VARCHAR(255),
+       NODE_TYPE VARCHAR(255),
+       INPUTS BLOB,
+       OUTPUTS BLOB,
+       STATUS VARCHAR(255),
+       START_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+       LAST_UPDATE_TIME TIMESTAMP DEFAULT NOW() ON UPDATE NOW(),
+       EXECUTION_INDEX INT(11) NOT NULL,
+       PRIMARY KEY(WORKFLOW_INSTANCE_ID, NODE_ID, EXECUTION_INDEX),
+       FOREIGN KEY (WORKFLOW_INSTANCE_ID) REFERENCES WORKFLOW_DATA(WORKFLOW_INSTANCE_ID) ON DELETE CASCADE
+);
+
+-- need to remove this in future
+CREATE TABLE GRAM_DATA
+(
+       WORKFLOW_INSTANCE_ID VARCHAR(255),
+       NODE_ID VARCHAR(255),
+       RSL BLOB,
+       INVOKED_HOST VARCHAR(255),
+       LOCAL_JOB_ID VARCHAR(255),
+       PRIMARY KEY(WORKFLOW_INSTANCE_ID, NODE_ID),
+       FOREIGN KEY (WORKFLOW_INSTANCE_ID) REFERENCES WORKFLOW_DATA(WORKFLOW_INSTANCE_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE GFAC_JOB_DATA
+(
+       EXPERIMENT_ID VARCHAR(255),
+       WORKFLOW_INSTANCE_ID VARCHAR(255),
+       NODE_ID VARCHAR(255),
+       APPLICATION_DESC_ID VARCHAR(255),
+       HOST_DESC_ID VARCHAR(255),
+       SERVICE_DESC_ID VARCHAR(255),
+       JOB_DATA LONGTEXT,
+       LOCAL_JOB_ID VARCHAR(255) NOT NULL,
+       SUBMITTED_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+       STATUS_UPDATE_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+       STATUS VARCHAR(255),
+       METADATA LONGTEXT,
+       PRIMARY KEY(LOCAL_JOB_ID),
+       FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT_METADATA(EXPERIMENT_ID),
+       FOREIGN KEY (WORKFLOW_INSTANCE_ID) REFERENCES WORKFLOW_DATA(WORKFLOW_INSTANCE_ID)
+);
+
+CREATE TABLE GFAC_JOB_STATUS
+(
+       LOCAL_JOB_ID VARCHAR(255) NOT NULL,
+       STATUS_UPDATE_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+       STATUS VARCHAR(255),
+       FOREIGN KEY (LOCAL_JOB_ID) REFERENCES GFAC_JOB_DATA(LOCAL_JOB_ID)
+);
+
+
+CREATE TABLE COMMUNITY_USER
+(
+        GATEWAY_NAME VARCHAR(256) NOT NULL,
+        COMMUNITY_USER_NAME VARCHAR(256) NOT NULL,
+        TOKEN_ID VARCHAR(256) NOT NULL,
+        COMMUNITY_USER_EMAIL VARCHAR(256) NOT NULL,
+        PRIMARY KEY (GATEWAY_NAME, COMMUNITY_USER_NAME, TOKEN_ID)
+);
+
+
+CREATE TABLE CREDENTIALS
+(
+        GATEWAY_ID VARCHAR(256) NOT NULL,
+        TOKEN_ID VARCHAR(256) NOT NULL,
+        CREDENTIAL BLOB NOT NULL,
+        PORTAL_USER_ID VARCHAR(256) NOT NULL,
+        TIME_PERSISTED TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+        PRIMARY KEY (GATEWAY_ID, TOKEN_ID)
+);
+
+CREATE TABLE EXECUTION_ERROR
+(
+       ERROR_ID INT(11) NOT NULL AUTO_INCREMENT,
+       EXPERIMENT_ID VARCHAR(255),
+       WORKFLOW_INSTANCE_ID VARCHAR(255),
+       NODE_ID VARCHAR(255),
+       GFAC_JOB_ID VARCHAR(255),
+       SOURCE_TYPE VARCHAR(255),
+       ERROR_DATE TIMESTAMP DEFAULT NOW() ON UPDATE NOW(),
+       ERROR_MSG LONGTEXT,
+       ERROR_DESC LONGTEXT,
+       ERROR_CODE VARCHAR(255),
+       ERROR_REPORTER VARCHAR(255),
+       ERROR_LOCATION VARCHAR(255),
+       ACTION_TAKEN VARCHAR(255),
+       ERROR_REFERENCE INT,
+       PRIMARY KEY(ERROR_ID),
+       FOREIGN KEY (WORKFLOW_INSTANCE_ID) REFERENCES WORKFLOW_DATA(WORKFLOW_INSTANCE_ID) ON DELETE CASCADE,
+       FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT_METADATA(EXPERIMENT_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE ORCHESTRATOR
+(
+        EXPERIMENT_ID VARCHAR(255) NOT NULL,
+        USERNAME VARCHAR(255),
+        STATUS VARCHAR(255),
+        STATE VARCHAR(255),
+        GFAC_EPR VARCHAR(255),
+        APPLICATION_NAME VARCHAR(255),
+        JOBREQUEST LONGTEXT,
+        SUBMITTED_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+        STATUS_UPDATE_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+        PRIMARY KEY (EXPERIMENT_ID),
+        FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT_METADATA(EXPERIMENT_ID) ON DELETE CASCADE
+);
+
+

http://git-wip-us.apache.org/repos/asf/airavata/blob/10b41d86/modules/registry/airavata-jpa-registry/src/main/resources/data-derby.sql
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/resources/data-derby.sql b/modules/registry/airavata-jpa-registry/src/main/resources/data-derby.sql
deleted file mode 100644
index b759c75..0000000
--- a/modules/registry/airavata-jpa-registry/src/main/resources/data-derby.sql
+++ /dev/null
@@ -1,282 +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.
- *
- */
-create table Gateway
-(
-        gateway_name varchar(255),
-	      owner varchar(255),
-        PRIMARY KEY (gateway_name)
-);
-
-
-create table Configuration
-(
-        config_key varchar(255),
-        config_val varchar(255),
-        expire_date TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-        category_id varchar (255),
-        PRIMARY KEY(config_key, config_val, category_id)
-);
-
-INSERT INTO CONFIGURATION (config_key, config_val, expire_date, category_id) VALUES('registry.version', '0.11', CURRENT_TIMESTAMP ,'SYSTEM');
-
-create table Users
-(
-        user_name varchar(255),
-        password varchar(255),
-        PRIMARY KEY(user_name)
-);
-
-create table Gateway_Worker
-(
-      gateway_name varchar(255),
-      user_name varchar(255),
-      PRIMARY KEY (gateway_name, user_name),
-      FOREIGN KEY (gateway_name) REFERENCES Gateway(gateway_name) ON DELETE CASCADE,
-      FOREIGN KEY (user_name) REFERENCES Users(user_name) ON DELETE CASCADE
-
-);
-
-create table Project
-(
-       gateway_name varchar(255),
-       user_name varchar(255),
-       project_name varchar(255),
-       PRIMARY KEY (project_name),
-       FOREIGN KEY (gateway_name) REFERENCES Gateway(gateway_name) ON DELETE CASCADE,
-       FOREIGN KEY (user_name) REFERENCES Users(user_name) ON DELETE CASCADE
-);
-
-create table Published_Workflow
-(
-       gateway_name varchar(255),
-       created_user varchar(255),
-       publish_workflow_name varchar(255),
-       version varchar(255),
-       published_date TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-       path varchar (255),
-       workflow_content BLOB,
-       PRIMARY KEY(gateway_name, publish_workflow_name),
-       FOREIGN KEY (gateway_name) REFERENCES Gateway(gateway_name) ON DELETE CASCADE,
-       FOREIGN KEY (created_user) REFERENCES Users(user_name) ON DELETE CASCADE
-);
-
-create table User_Workflow
-
-(
-       gateway_name varchar(255),
-       owner varchar(255),
-       template_name varchar(255),
-       last_updated_date TIMESTAMP DEFAULT CURRENT TIMESTAMP,
-       path varchar (255),
-       workflow_graph BLOB,
-       PRIMARY KEY(gateway_name, owner, template_name),
-       FOREIGN KEY (gateway_name) REFERENCES Gateway(gateway_name) ON DELETE CASCADE,
-       FOREIGN KEY (owner) REFERENCES Users(user_name) ON DELETE CASCADE
-);
-
-
-create table Host_Descriptor
-(
-       gateway_name varchar(255),
-       updated_user varchar(255),
-       host_descriptor_ID varchar(255),
-       host_descriptor_xml BLOB,
-       PRIMARY KEY(gateway_name, host_descriptor_ID),
-       FOREIGN KEY (gateway_name) REFERENCES Gateway(gateway_name) ON DELETE CASCADE,
-       FOREIGN KEY (updated_user) REFERENCES Users(user_name) ON DELETE CASCADE
-);
-
-create table Service_Descriptor
-(
-         gateway_name varchar(255),
-         updated_user varchar(255),
-         service_descriptor_ID varchar(255),
-         service_descriptor_xml BLOB,
-         PRIMARY KEY(gateway_name,service_descriptor_ID),
-         FOREIGN KEY (gateway_name) REFERENCES Gateway(gateway_name) ON DELETE CASCADE,
-         FOREIGN KEY (updated_user) REFERENCES Users(user_name) ON DELETE CASCADE
-);
-
-create table Application_Descriptor
-(
-         gateway_name varchar(255),
-         updated_user varchar(255),
-         application_descriptor_ID varchar(255),
-         host_descriptor_ID varchar(255),
-         service_descriptor_ID varchar(255),
-         application_descriptor_xml BLOB,
-         PRIMARY KEY(gateway_name,application_descriptor_ID),
-         FOREIGN KEY (gateway_name) REFERENCES Gateway(gateway_name) ON DELETE CASCADE,
-         FOREIGN KEY (updated_user) REFERENCES Users(user_name) ON DELETE CASCADE
-);
-
-create table Experiment
-(
-          project_name varchar(255),
-	        gateway_name varchar(255),
-          user_name varchar(255),
-          experiment_ID varchar(255),
-          submitted_date TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-          PRIMARY KEY(experiment_ID),
-          FOREIGN KEY (gateway_name) REFERENCES Gateway(gateway_name) ON DELETE CASCADE,
-          FOREIGN KEY (project_name) REFERENCES Project(project_name) ON DELETE CASCADE,
-          FOREIGN KEY (user_name) REFERENCES Users(user_name) ON DELETE CASCADE
-);
-
-create table Experiment_Data
-(
-        experiment_ID varchar(255),
-        name varchar(255),
-        username varchar(255),
-        PRIMARY KEY (experiment_ID)
-);
-
-create table Experiment_Metadata
-(
-        experiment_ID varchar(255),
-        metadata BLOB,
-        PRIMARY KEY (experiment_ID)
-);
-
-
-create table Workflow_Data
-(
-       experiment_ID varchar(255),
-       workflow_instanceID varchar(255),
-       template_name varchar(255),
-       status varchar(255),
-       start_time TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-       last_update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
-       PRIMARY KEY(workflow_instanceID),
-       FOREIGN KEY (experiment_ID) REFERENCES Experiment_Data(experiment_ID) ON DELETE CASCADE
-);
-
-create table Node_Data
-(
-       workflow_instanceID varchar(255),
-       node_id varchar(255),
-       node_type varchar(255),
-       inputs BLOB,
-       outputs BLOB,
-       status varchar(255),
-       start_time TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-       last_update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
-       execution_index int NOT NULL,
-       PRIMARY KEY(workflow_instanceID, node_id, execution_index),
-       FOREIGN KEY (workflow_instanceID) REFERENCES Workflow_Data(workflow_instanceID) ON DELETE CASCADE
-);
-
--- need to remove this in future
-create table Gram_Data
-(
-       workflow_instanceID varchar(255),
-       node_id varchar(255),
-       rsl BLOB,
-       invoked_host varchar(255),
-       local_Job_ID varchar(255),
-       PRIMARY KEY(workflow_instanceID, node_id),
-       FOREIGN KEY (workflow_instanceID) REFERENCES Workflow_Data(workflow_instanceID) ON DELETE CASCADE
-);
-
-create table GFac_Job_Data
-(
-       experiment_ID varchar(255),
-       workflow_instanceID varchar(255),
-       node_id varchar(255),
-       application_descriptor_ID varchar(255),
-       host_descriptor_ID varchar(255),
-       service_descriptor_ID varchar(255),
-       job_data CLOB,
-       local_Job_ID varchar(255),
-       submitted_time TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-       status_update_time TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-       status varchar(255),
-       metadata CLOB,
-       PRIMARY KEY(local_Job_ID),
-       FOREIGN KEY (experiment_ID) REFERENCES Experiment_Data(experiment_ID),
-       FOREIGN KEY (workflow_instanceID) REFERENCES Workflow_Data(workflow_instanceID)
-);
-
-create table GFac_Job_Status
-(
-       local_Job_ID varchar(255),
-       status_update_time TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-       status varchar(255),
-       FOREIGN KEY (local_Job_ID) REFERENCES GFac_Job_Data(local_Job_ID)
-);
-
-
-CREATE TABLE community_user
-(
-        GATEWAY_NAME VARCHAR(256) NOT NULL,
-        COMMUNITY_USER_NAME VARCHAR(256) NOT NULL,
-        TOKEN_ID VARCHAR(256) NOT NULL,
-        COMMUNITY_USER_EMAIL VARCHAR(256) NOT NULL,
-        PRIMARY KEY (GATEWAY_NAME, COMMUNITY_USER_NAME, TOKEN_ID)
-);
-
-
-CREATE TABLE credentials
-(
-        GATEWAY_ID VARCHAR(256) NOT NULL,
-        TOKEN_ID VARCHAR(256) NOT NULL,
-        CREDENTIAL BLOB NOT NULL,
-        PORTAL_USER_ID VARCHAR(256) NOT NULL,
-        TIME_PERSISTED TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
-        PRIMARY KEY (GATEWAY_ID, TOKEN_ID)
-);
-
-CREATE TABLE Execution_Error
-(
-       error_id INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
-       experiment_ID varchar(255),
-       workflow_instanceID varchar(255),
-       node_id varchar(255),
-       gfacJobID varchar(255),
-       source_type varchar(255),
-       error_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
-       error_msg CLOB,
-       error_des CLOB,
-       error_code varchar(255),
-       error_reporter varchar(255),
-       error_location varchar(255),
-       action_taken varchar(255),
-       error_reference INTEGER,
-       PRIMARY KEY(error_id),
-       FOREIGN KEY (workflow_instanceID) REFERENCES Workflow_Data(workflow_instanceID) ON DELETE CASCADE,
-       FOREIGN KEY (experiment_ID) REFERENCES Experiment_Data(experiment_ID) ON DELETE CASCADE
-);
-
-create table Orchestrator
-(
-        experiment_ID varchar(255) NOT NULL,
-        username varchar(255),
-        status varchar(255),
-        state varchar(255),
-        gfacEPR varchar(255),
-        applicationName varchar(255),
-        jobRequest CLOB,
-        submitted_time TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-        status_update_time TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-        PRIMARY KEY (experiment_ID)
-);
-
-

http://git-wip-us.apache.org/repos/asf/airavata/blob/10b41d86/modules/registry/airavata-jpa-registry/src/main/resources/data-mysql.sql
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/resources/data-mysql.sql b/modules/registry/airavata-jpa-registry/src/main/resources/data-mysql.sql
deleted file mode 100644
index 26515ef..0000000
--- a/modules/registry/airavata-jpa-registry/src/main/resources/data-mysql.sql
+++ /dev/null
@@ -1,279 +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.
- *
- */
-create table Gateway
-(
-        gateway_name varchar(255),
-	      owner varchar(255),
-        PRIMARY KEY (gateway_name)
-);
-
-create table Configuration
-(
-        config_key varchar(255),
-        config_val varchar(255),
-        expire_date TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-        category_id varchar (255),
-        PRIMARY KEY(config_key, config_val, category_id)
-);
-
-INSERT INTO Configuration (config_key, config_val, expire_date, category_id) VALUES('registry.version', '0.11', CURRENT_TIMESTAMP ,'SYSTEM');
-
-create table Users
-(
-        user_name varchar(255),
-        password varchar(255),
-        PRIMARY KEY(user_name)
-);
-
-create table Gateway_Worker
-(
-      gateway_name varchar(255),
-      user_name varchar(255),
-      PRIMARY KEY (gateway_name, user_name),
-      FOREIGN KEY (gateway_name) REFERENCES Gateway(gateway_name) ON DELETE CASCADE,
-      FOREIGN KEY (user_name) REFERENCES Users(user_name) ON DELETE CASCADE
-
-);
-
-create table Project
-(
-       gateway_name varchar(255),
-       user_name varchar(255),
-       project_name varchar(255),
-       PRIMARY KEY(project_name),
-       FOREIGN KEY (gateway_name) REFERENCES Gateway(gateway_name) ON DELETE CASCADE,
-       FOREIGN KEY (user_name) REFERENCES Users(user_name) ON DELETE CASCADE
-);
-
-create table Published_Workflow
-(
-       gateway_name varchar(255),
-       created_user varchar(255),
-       publish_workflow_name varchar(255),
-       version varchar(255),
-       published_date TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-       path varchar (255),
-       workflow_content MEDIUMBLOB,
-       PRIMARY KEY(gateway_name, publish_workflow_name),
-       FOREIGN KEY (gateway_name) REFERENCES Gateway(gateway_name) ON DELETE CASCADE,
-       FOREIGN KEY (created_user) REFERENCES Users(user_name) ON DELETE CASCADE
-);
-
-create table User_Workflow
-(
-       gateway_name varchar(255),
-       owner varchar(255),
-       template_name varchar(255),
-       last_updated_date TIMESTAMP DEFAULT now() on update now(),
-       path varchar (255),
-       workflow_graph MEDIUMBLOB,
-       PRIMARY KEY(gateway_name, owner, template_name),
-       FOREIGN KEY (gateway_name) REFERENCES Gateway(gateway_name) ON DELETE CASCADE,
-       FOREIGN KEY (owner) REFERENCES Users(user_name) ON DELETE CASCADE
-);
-
-
-create table Host_Descriptor
-(
-       gateway_name varchar(255),
-       updated_user varchar(255),
-       host_descriptor_ID varchar(255),
-       host_descriptor_xml BLOB,
-       PRIMARY KEY(gateway_name, host_descriptor_ID),
-       FOREIGN KEY (gateway_name) REFERENCES Gateway(gateway_name) ON DELETE CASCADE,
-       FOREIGN KEY (updated_user) REFERENCES Users(user_name) ON DELETE CASCADE
-);
-
-create table Service_Descriptor
-(
-         gateway_name varchar(255),
-         updated_user varchar(255),
-         service_descriptor_ID varchar(255),
-         service_descriptor_xml BLOB,
-         PRIMARY KEY(gateway_name,service_descriptor_ID),
-         FOREIGN KEY (gateway_name) REFERENCES Gateway(gateway_name) ON DELETE CASCADE,
-         FOREIGN KEY (updated_user) REFERENCES Users(user_name) ON DELETE CASCADE
-);
-
-create table Application_Descriptor
-(
-         gateway_name varchar(255),
-         updated_user varchar(255),
-         application_descriptor_ID varchar(255),
-         host_descriptor_ID varchar(255),
-         service_descriptor_ID varchar(255),
-         application_descriptor_xml BLOB,
-         PRIMARY KEY(gateway_name,application_descriptor_ID),
-         FOREIGN KEY (gateway_name) REFERENCES Gateway(gateway_name) ON DELETE CASCADE,
-         FOREIGN KEY (updated_user) REFERENCES Users(user_name) ON DELETE CASCADE
-);
-
-create table Experiment
-(
-          project_name varchar(255),
-	        gateway_name varchar(255),
-          user_name varchar(255),
-          experiment_ID varchar(255),
-          submitted_date TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-          PRIMARY KEY(experiment_ID),
-          FOREIGN KEY (gateway_name) REFERENCES Gateway(gateway_name) ON DELETE CASCADE,
-          FOREIGN KEY (project_name) REFERENCES Project(project_name) ON DELETE CASCADE,
-          FOREIGN KEY (user_name) REFERENCES Users(user_name) ON DELETE CASCADE
-);
-
-create table Experiment_Data
-(
-          experiment_ID varchar(255),
-          name varchar(255),
-          username varchar(255),
-          PRIMARY KEY (experiment_ID)
-);
-
-create table Experiment_Metadata
-(
-          experiment_ID varchar(255),
-          metadata BLOB,
-          PRIMARY KEY (experiment_ID)
-);
-
-
-create table Workflow_Data
-(
-       experiment_ID varchar(255),
-       workflow_instanceID varchar(255),
-       template_name varchar(255),
-       status varchar(255),
-       start_time TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-       last_update_time TIMESTAMP DEFAULT now() on update now(),
-       PRIMARY KEY(workflow_instanceID),
-       FOREIGN KEY (experiment_ID) REFERENCES Experiment_Data(experiment_ID) ON DELETE CASCADE
-);
-
-create table Node_Data
-(
-       workflow_instanceID varchar(255),
-       node_id varchar(255),
-       node_type varchar(255),
-       inputs BLOB,
-       outputs BLOB,
-       status varchar(255),
-       start_time TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-       last_update_time TIMESTAMP DEFAULT now() on update now(),
-       execution_index int NOT NULL,
-       PRIMARY KEY(workflow_instanceID, node_id, execution_index),
-       FOREIGN KEY (workflow_instanceID) REFERENCES Workflow_Data(workflow_instanceID) ON DELETE CASCADE
-);
-
-create table Gram_Data
-(
-       workflow_instanceID varchar(255),
-       node_id varchar(255),
-       rsl BLOB,
-       invoked_host varchar(255),
-       local_Job_ID varchar(255),
-       PRIMARY KEY(workflow_instanceID, node_id),
-       FOREIGN KEY (workflow_instanceID) REFERENCES Workflow_Data(workflow_instanceID) ON DELETE CASCADE
-);
-
-create table GFac_Job_Data
-(
-       experiment_ID varchar(255),
-       workflow_instanceID varchar(255),
-       node_id varchar(255),
-       application_descriptor_ID varchar(255),
-       host_descriptor_ID varchar(255),
-       service_descriptor_ID varchar(255),
-       job_data LONGTEXT,
-       local_Job_ID varchar(255),
-       submitted_time TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-       status_update_time TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-       status varchar(255),
-       metadata LONGTEXT,
-       PRIMARY KEY(local_Job_ID),
-       FOREIGN KEY (experiment_ID) REFERENCES Experiment_Data(experiment_ID),
-       FOREIGN KEY (workflow_instanceID) REFERENCES Workflow_Data(workflow_instanceID)
-);
-
-create table GFac_Job_Status
-(
-       local_Job_ID varchar(255),
-       status_update_time TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-       status varchar(255),
-       FOREIGN KEY (local_Job_ID) REFERENCES GFac_Job_Data(local_Job_ID)
-);
-
-
-CREATE TABLE community_user
-(
-  GATEWAY_NAME VARCHAR(256) NOT NULL,
-  COMMUNITY_USER_NAME VARCHAR(256) NOT NULL,
-  TOKEN_ID VARCHAR(256) NOT NULL,
-  COMMUNITY_USER_EMAIL VARCHAR(256) NOT NULL,
-  PRIMARY KEY (GATEWAY_NAME, COMMUNITY_USER_NAME, TOKEN_ID)
-);
-
-
-CREATE TABLE credentials
-(
-  GATEWAY_ID VARCHAR(256) NOT NULL,
-  TOKEN_ID VARCHAR(256) NOT NULL,
-  CREDENTIAL TEXT NOT NULL,
-  PORTAL_USER_ID VARCHAR(256) NOT NULL,
-  TIME_PERSISTED TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-  PRIMARY KEY (GATEWAY_ID, TOKEN_ID)
-);
-
-CREATE TABLE Execution_Error
-(
-       error_id INT NOT NULL AUTO_INCREMENT,
-       experiment_ID varchar(255),
-       workflow_instanceID varchar(255),
-       node_id varchar(255),
-       gfacJobID varchar(255),
-       source_type varchar(255),
-       error_date TIMESTAMP DEFAULT now() on update now(),
-       error_msg LONGTEXT,
-       error_des LONGTEXT,
-       error_code varchar(255),
-       error_reporter varchar(255),
-       error_location varchar(255),
-       action_taken varchar(255),
-       error_reference INTEGER,
-       PRIMARY KEY(error_id),
-       FOREIGN KEY (workflow_instanceID) REFERENCES Workflow_Data(workflow_instanceID) ON DELETE CASCADE,
-       FOREIGN KEY (experiment_ID) REFERENCES Experiment_Data(experiment_ID) ON DELETE CASCADE
-);
-
-create table Orchestrator
-(
-        experiment_ID varchar(255) NOT NULL,
-        username varchar(255),
-        status varchar(255),
-        state varchar(255),
-        gfacEPR varchar(255),
-        applicationName varchar(255),
-        jobRequest LONGTEXT,
-        submitted_time TIMESTAMP DEFAULT now(),
-        status_update_time TIMESTAMP DEFAULT now() on update now(),
-		PRIMARY KEY (experiment_ID)
-);
-
-

http://git-wip-us.apache.org/repos/asf/airavata/blob/10b41d86/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/AbstractResourceTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/AbstractResourceTest.java b/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/AbstractResourceTest.java
index 93f0dc3..da36d85 100644
--- a/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/AbstractResourceTest.java
+++ b/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/AbstractResourceTest.java
@@ -27,6 +27,9 @@ import org.apache.airavata.persistance.registry.jpa.resources.UserResource;
 import org.apache.airavata.persistance.registry.jpa.resources.WorkerResource;
 import org.apache.airavata.persistance.registry.jpa.util.Initialize;
 
+import java.sql.Timestamp;
+import java.util.Calendar;
+
 public abstract class AbstractResourceTest extends TestCase {
 
     private GatewayResource gatewayResource;
@@ -36,7 +39,7 @@ public abstract class AbstractResourceTest extends TestCase {
     private Initialize initialize;
     @Override
     public void setUp() throws Exception {
-        initialize = new Initialize("data-derby.sql");
+        initialize = new Initialize("airavata-registry-derby.sql");
         initialize.initializeDB();
         gatewayResource = (GatewayResource)ResourceUtils.getGateway("default");
         workerResource = (WorkerResource)ResourceUtils.getWorker(gatewayResource.getGatewayName(), "admin");
@@ -45,6 +48,12 @@ public abstract class AbstractResourceTest extends TestCase {
         userResource.setPassword("admin");
     }
 
+    public Timestamp getCurrentTimestamp() {
+        Calendar calender = Calendar.getInstance();
+        java.util.Date d = calender.getTime();
+        return new Timestamp(d.getTime());
+    }
+
     @Override
     public void tearDown() throws Exception {
         initialize.stopDerbyServer();

http://git-wip-us.apache.org/repos/asf/airavata/blob/10b41d86/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ExecutionErrorResourceTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ExecutionErrorResourceTest.java b/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ExecutionErrorResourceTest.java
index f575642..bebe240 100644
--- a/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ExecutionErrorResourceTest.java
+++ b/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ExecutionErrorResourceTest.java
@@ -27,9 +27,9 @@ import java.sql.Timestamp;
 import java.util.Calendar;
 
 public class ExecutionErrorResourceTest extends AbstractResourceTest {
-    private ExperimentDataResource experimentDataResource;
     private WorkflowDataResource workflowDataResource;
     private NodeDataResource nodeDataResource;
+    private ExperimentMetadataResource experimentResource;
 
     @Override
     public void setUp() throws Exception {
@@ -37,24 +37,25 @@ public class ExecutionErrorResourceTest extends AbstractResourceTest {
         GatewayResource gatewayResource = super.getGatewayResource();
         WorkerResource workerResource = super.getWorkerResource();
 
-        ExperimentResource experimentResource = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
+        ProjectResource project = new ProjectResource(workerResource, gatewayResource, "testProject");
+        project.save();
+
+        experimentResource = (ExperimentMetadataResource) gatewayResource.create(ResourceType.EXPERIMENT_METADATA);
         experimentResource.setExpID("testExpID");
-        experimentResource.setWorker(workerResource);
-        experimentResource.setProject(new ProjectResource(workerResource, gatewayResource, "testProject"));
-        experimentResource.save();
+        experimentResource.setExecutionUser(workerResource.getUser());
 
-        experimentDataResource = (ExperimentDataResource) experimentResource.create(ResourceType.EXPERIMENT_DATA);
-        experimentDataResource.setExpName("testExpID");
-        experimentDataResource.setUserName(workerResource.getUser());
-        experimentDataResource.save();
+        experimentResource.setProject(project);
+        experimentResource.setDescription("testDescription");
+        experimentResource.setExperimentName("textExpID");
+        experimentResource.setSubmittedDate(getCurrentTimestamp());
+        experimentResource.setShareExp(true);
+        experimentResource.save();
 
-        workflowDataResource = (WorkflowDataResource) experimentDataResource.create(ResourceType.WORKFLOW_DATA);
+        workflowDataResource = (WorkflowDataResource) experimentResource.create(ResourceType.WORKFLOW_DATA);
         workflowDataResource.setWorkflowInstanceID("testWFInstance");
         workflowDataResource.setTemplateName("testTemplate");
         workflowDataResource.setExperimentID("testExpID");
-        Calendar calender = Calendar.getInstance();
-        java.util.Date d = calender.getTime();
-        Timestamp timestamp = new Timestamp(d.getTime());
+        Timestamp timestamp = getCurrentTimestamp();
         workflowDataResource.setLastUpdatedTime(timestamp);
         workflowDataResource.save();
 
@@ -66,6 +67,7 @@ public class ExecutionErrorResourceTest extends AbstractResourceTest {
         nodeDataResource.save();
     }
 
+
     public void testSave() throws Exception {
         ExecutionErrorResource executionErrorResource = (ExecutionErrorResource) workflowDataResource.create(ResourceType.EXECUTION_ERROR);
         executionErrorResource.setErrorCode("testErrorCode");
@@ -74,7 +76,7 @@ public class ExecutionErrorResourceTest extends AbstractResourceTest {
         executionErrorResource.setErrorReference(0);
         executionErrorResource.setWorkflowDataResource(workflowDataResource);
 
-        executionErrorResource.setExperimentDataResource(experimentDataResource);
+        executionErrorResource.setMetadataResource(experimentResource);
         executionErrorResource.setNodeID(nodeDataResource.getNodeID());
         executionErrorResource.setGfacJobID("testGfacJobID");
         executionErrorResource.setErrorDes("testDes");
@@ -82,7 +84,7 @@ public class ExecutionErrorResourceTest extends AbstractResourceTest {
         executionErrorResource.save();
         System.out.println(executionErrorResource.getErrorID());
 
-        assertTrue("application descriptor saved successfully", workflowDataResource.isExists(ResourceType.EXECUTION_ERROR, executionErrorResource.getErrorID()));
+        assertTrue("Execution Error saved successfully", workflowDataResource.isExists(ResourceType.EXECUTION_ERROR, executionErrorResource.getErrorID()));
 
     }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/10b41d86/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ExperimentDataResourceTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ExperimentDataResourceTest.java b/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ExperimentDataResourceTest.java
index 9ea82b4..487f977 100644
--- a/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ExperimentDataResourceTest.java
+++ b/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ExperimentDataResourceTest.java
@@ -1,107 +1,107 @@
-/*
-*
-* 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.*;
-
-import java.sql.Timestamp;
-import java.util.Calendar;
-
-public class ExperimentDataResourceTest extends AbstractResourceTest {
-    private ExperimentDataResource experimentDataResource;
-    private ExperimentResource experimentResource;
-    private WorkflowDataResource workflowDataResource;
-    private ExperimentMetadataResource experimentMetadataResource;
-
-    @Override
-    public void setUp() throws Exception {
-        super.setUp();
-        GatewayResource gatewayResource = super.getGatewayResource();
-        WorkerResource workerResource = super.getWorkerResource();
-
-        experimentResource = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
-        experimentResource.setExpID("testExpID");
-        experimentResource.setWorker(workerResource);
-        experimentResource.setProject(new ProjectResource(workerResource, gatewayResource, "testProject"));
-        experimentResource.save();
-
-        experimentDataResource = (ExperimentDataResource) experimentResource.create(ResourceType.EXPERIMENT_DATA);
-        experimentDataResource.setExpName("testExpID");
-        experimentDataResource.setUserName(workerResource.getUser());
-        experimentDataResource.save();
-
-        experimentMetadataResource = experimentDataResource.createExperimentMetadata();
-        workflowDataResource = experimentDataResource.createWorkflowInstanceResource("testWorkflowInstance");
-
-        experimentMetadataResource.setExpID("testExpID");
-        experimentMetadataResource.setMetadata("testMetadata");
-        experimentMetadataResource.save();
-
-        workflowDataResource.setExperimentID("testExpID");
-        workflowDataResource.setStatus("testStatus");
-        workflowDataResource.setTemplateName("testWorkflowInstance");
-
-        Calendar calender = Calendar.getInstance();
-        java.util.Date d = calender.getTime();
-        Timestamp currentTime = new Timestamp(d.getTime());
-
-        workflowDataResource.setLastUpdatedTime(currentTime);
-        workflowDataResource.setStartTime(currentTime);
-        workflowDataResource.save();
-    }
-
-    public void testCreate() throws Exception {
-        assertNotNull("workflowdata resource created", workflowDataResource);
-        assertNotNull("experimemt metadata resource created", experimentMetadataResource);
-    }
-
-    public void testGet() throws Exception {
-        assertNotNull("workflow data retrieved successfully", experimentDataResource.getWorkflowInstance("testWorkflowInstance"));
-        assertNotNull("experiment meta data retrieved successfully", experimentDataResource.getExperimentMetadata());
-    }
-
-    public void testGetList() throws Exception {
-        assertNotNull("workflow data retrieved successfully", experimentDataResource.get(ResourceType.WORKFLOW_DATA));
-        assertNotNull("experiment meta data retrieved successfully", experimentDataResource.get(ResourceType.EXPERIMENT_METADATA));
-    }
-
-    public void testSave() throws Exception {
-        experimentDataResource.save();
-        assertTrue("experiment data saved successfully", experimentResource.isExists(ResourceType.EXPERIMENT_DATA, "testExpID"));
-    }
-
-    public void testRemove() throws Exception {
-        experimentDataResource.remove(ResourceType.WORKFLOW_DATA, "testWFInstanceID");
-        assertTrue("workflow data resource removed successfully", !experimentResource.isExists(ResourceType.EXPERIMENT_DATA, "testWFInstanceID"));
-
-        experimentDataResource.remove(ResourceType.EXPERIMENT_METADATA, "testExpID");
-        assertTrue("experiment meta data resource removed successfully", !experimentDataResource.isExists(ResourceType.EXPERIMENT_METADATA, "testExpID"));
-
-    }
-
-    @Override
-    public void tearDown() throws Exception {
-        super.tearDown();
-    }
-
-
-}
+///*
+//*
+//* 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.*;
+//
+//import java.sql.Timestamp;
+//import java.util.Calendar;
+//
+//public class ExperimentDataResourceTest extends AbstractResourceTest {
+//    private ExperimentDataResource experimentDataResource;
+//    private ExperimentResource experimentResource;
+//    private WorkflowDataResource workflowDataResource;
+//    private ExperimentMetadataResource experimentMetadataResource;
+//
+//    @Override
+//    public void setUp() throws Exception {
+//        super.setUp();
+//        GatewayResource gatewayResource = super.getGatewayResource();
+//        WorkerResource workerResource = super.getWorkerResource();
+//
+//        experimentResource = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
+//        experimentResource.setExpID("testExpID");
+//        experimentResource.setWorker(workerResource);
+//        experimentResource.setProject(new ProjectResource(workerResource, gatewayResource, "testProject"));
+//        experimentResource.save();
+//
+//        experimentDataResource = (ExperimentDataResource) experimentResource.create(ResourceType.EXPERIMENT_DATA);
+//        experimentDataResource.setExpName("testExpID");
+//        experimentDataResource.setUserName(workerResource.getUser());
+//        experimentDataResource.save();
+//
+//        experimentMetadataResource = experimentDataResource.createExperimentMetadata();
+//        workflowDataResource = experimentDataResource.createWorkflowInstanceResource("testWorkflowInstance");
+//
+//        experimentMetadataResource.setExpID("testExpID");
+//        experimentMetadataResource.setMetadata("testMetadata");
+//        experimentMetadataResource.save();
+//
+//        workflowDataResource.setExperimentID("testExpID");
+//        workflowDataResource.setStatus("testStatus");
+//        workflowDataResource.setTemplateName("testWorkflowInstance");
+//
+//        Calendar calender = Calendar.getInstance();
+//        java.util.Date d = calender.getTime();
+//        Timestamp currentTime = new Timestamp(d.getTime());
+//
+//        workflowDataResource.setLastUpdatedTime(currentTime);
+//        workflowDataResource.setStartTime(currentTime);
+//        workflowDataResource.save();
+//    }
+//
+//    public void testCreate() throws Exception {
+//        assertNotNull("workflowdata resource created", workflowDataResource);
+//        assertNotNull("experimemt metadata resource created", experimentMetadataResource);
+//    }
+//
+//    public void testGet() throws Exception {
+//        assertNotNull("workflow data retrieved successfully", experimentDataResource.getWorkflowInstance("testWorkflowInstance"));
+//        assertNotNull("experiment meta data retrieved successfully", experimentDataResource.getExperimentMetadata());
+//    }
+//
+//    public void testGetList() throws Exception {
+//        assertNotNull("workflow data retrieved successfully", experimentDataResource.get(ResourceType.WORKFLOW_DATA));
+//        assertNotNull("experiment meta data retrieved successfully", experimentDataResource.get(ResourceType.EXPERIMENT_METADATA));
+//    }
+//
+//    public void testSave() throws Exception {
+//        experimentDataResource.save();
+//        assertTrue("experiment data saved successfully", experimentResource.isExists(ResourceType.EXPERIMENT_DATA, "testExpID"));
+//    }
+//
+//    public void testRemove() throws Exception {
+//        experimentDataResource.remove(ResourceType.WORKFLOW_DATA, "testWFInstanceID");
+//        assertTrue("workflow data resource removed successfully", !experimentResource.isExists(ResourceType.EXPERIMENT_DATA, "testWFInstanceID"));
+//
+//        experimentDataResource.remove(ResourceType.EXPERIMENT_METADATA, "testExpID");
+//        assertTrue("experiment meta data resource removed successfully", !experimentDataResource.isExists(ResourceType.EXPERIMENT_METADATA, "testExpID"));
+//
+//    }
+//
+//    @Override
+//    public void tearDown() throws Exception {
+//        super.tearDown();
+//    }
+//
+//
+//}

http://git-wip-us.apache.org/repos/asf/airavata/blob/10b41d86/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ExperimentMetadataResourceTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ExperimentMetadataResourceTest.java b/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ExperimentMetadataResourceTest.java
index 63fdf22..351cc04 100644
--- a/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ExperimentMetadataResourceTest.java
+++ b/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ExperimentMetadataResourceTest.java
@@ -29,39 +29,43 @@ import java.sql.Timestamp;
 import java.util.Calendar;
 
 public class ExperimentMetadataResourceTest extends AbstractResourceTest {
-    private ExperimentDataResource experimentDataResource;
+
+    private GatewayResource gatewayResource;
+    private WorkflowDataResource workflowDataResource;
+    private ExperimentMetadataResource experimentResource;
 
     @Override
     public void setUp() throws Exception {
         super.setUp();
-        GatewayResource gatewayResource = super.getGatewayResource();
+        gatewayResource = super.getGatewayResource();
         WorkerResource workerResource = super.getWorkerResource();
-
-        ExperimentResource experimentResource = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
+        experimentResource = (ExperimentMetadataResource) gatewayResource.create(ResourceType.EXPERIMENT_METADATA);
         experimentResource.setExpID("testExpID");
-        experimentResource.setWorker(workerResource);
+        experimentResource.setExecutionUser("admin");
         experimentResource.setProject(new ProjectResource(workerResource, gatewayResource, "testProject"));
-
-        Calendar calender = Calendar.getInstance();
-        java.util.Date d = calender.getTime();
-        Timestamp currentDate = new Timestamp(d.getTime());
-        experimentResource.setSubmittedDate(currentDate);
+        experimentResource.setDescription("testDescription");
+        experimentResource.setExperimentName("textExpID");
+        experimentResource.setSubmittedDate(getCurrentTimestamp());
+        experimentResource.setShareExp(true);
         experimentResource.save();
 
-        experimentDataResource = (ExperimentDataResource) experimentResource.create(ResourceType.EXPERIMENT_DATA);
-        experimentDataResource.setExpName("testExpID");
-        experimentDataResource.setUserName(workerResource.getUser());
-        experimentDataResource.save();
+        workflowDataResource = experimentResource.createWorkflowInstanceResource("testWFInstance");
+        workflowDataResource.setExperimentID("testExpID");
+        workflowDataResource.setStatus("testStatus");
+        workflowDataResource.setTemplateName("testWFInstance");
+        workflowDataResource.setLastUpdatedTime(getCurrentTimestamp());
+        workflowDataResource.setStartTime(getCurrentTimestamp());
+        workflowDataResource.save();
     }
 
     public void testSave() throws Exception {
-        ExperimentMetadataResource experimentMetadataResource = new ExperimentMetadataResource();
-        experimentMetadataResource.setExpID("testExpID");
-        experimentMetadataResource.setMetadata("testMetadata");
-        experimentMetadataResource.save();
+        assertTrue("experiment meta data saved successfully", gatewayResource.isExists(ResourceType.EXPERIMENT_METADATA, "testExpID"));
 
-        assertTrue("experiment meta data saved successfully", experimentDataResource.isExists(ResourceType.EXPERIMENT_METADATA, "testExpID"));
+    }
 
+    public void testRemove() throws Exception {
+        experimentResource.remove(ResourceType.WORKFLOW_DATA, "testWFInstance");
+        assertTrue("workflow data resource removed successfully", !experimentResource.isExists(ResourceType.WORKFLOW_DATA, "testWFInstance"));
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/airavata/blob/10b41d86/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ExperimentResourceTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ExperimentResourceTest.java b/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ExperimentResourceTest.java
index ce45b24..b36f044 100644
--- a/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ExperimentResourceTest.java
+++ b/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ExperimentResourceTest.java
@@ -1,81 +1,81 @@
-/*
-*
-* 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.*;
-
-import java.sql.Timestamp;
-import java.util.Calendar;
-
-public class ExperimentResourceTest extends AbstractResourceTest {
-    private GatewayResource gatewayResource;
-    private ExperimentResource experimentResource;
-    private WorkerResource workerResource;
-    private ExperimentDataResource experimentDataResource;
-
-    @Override
-    public void setUp() throws Exception {
-        super.setUp();
-        gatewayResource = super.getGatewayResource();
-        workerResource = super.getWorkerResource();
-
-        experimentResource = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
-        experimentResource.setExpID("testExpID");
-        experimentResource.setWorker(workerResource);
-        experimentResource.setProject(new ProjectResource(workerResource, gatewayResource, "testProject"));
-        Calendar calender = Calendar.getInstance();
-        java.util.Date d = calender.getTime();
-        Timestamp currentDate = new Timestamp(d.getTime());
-        experimentResource.setSubmittedDate(currentDate);
-        experimentResource.save();
-
-        experimentDataResource = (ExperimentDataResource) experimentResource.create(ResourceType.EXPERIMENT_DATA);
-        experimentDataResource.setExpName("testExpID");
-        experimentDataResource.setUserName(workerResource.getUser());
-        experimentDataResource.save();
-    }
-
-    public void testCreate() throws Exception {
-        assertNotNull("experiment data resource has being created ", experimentDataResource);
-    }
-
-    public void testGet() throws Exception {
-        assertNotNull("experiment data retrieved successfully", experimentResource.get(ResourceType.EXPERIMENT_DATA, "testExpID"));
-    }
-
-    public void testSave() throws Exception {
-        experimentResource.save();
-        assertTrue("experiment save successfully", gatewayResource.isExists(ResourceType.EXPERIMENT, "testExpID"));
-    }
-
-    public void testRemove() throws Exception {
-        if (!experimentDataResource.isWorkflowInstancePresent("testWFInstance")){
-            experimentResource.remove(ResourceType.EXPERIMENT_DATA, "testExpID");
-            assertTrue("experiment data removed successfully", !experimentResource.isExists(ResourceType.EXPERIMENT_DATA, "testExpID"));
-        }
-    }
-
-    @Override
-    public void tearDown() throws Exception {
-        super.tearDown();
-    }
-}
+///*
+//*
+//* 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.*;
+//
+//import java.sql.Timestamp;
+//import java.util.Calendar;
+//
+//public class ExperimentResourceTest extends AbstractResourceTest {
+//    private GatewayResource gatewayResource;
+//    private ExperimentResource experimentResource;
+//    private WorkerResource workerResource;
+//    private ExperimentDataResource experimentDataResource;
+//
+//    @Override
+//    public void setUp() throws Exception {
+//        super.setUp();
+//        gatewayResource = super.getGatewayResource();
+//        workerResource = super.getWorkerResource();
+//
+//        experimentResource = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
+//        experimentResource.setExpID("testExpID");
+//        experimentResource.setWorker(workerResource);
+//        experimentResource.setProject(new ProjectResource(workerResource, gatewayResource, "testProject"));
+//        Calendar calender = Calendar.getInstance();
+//        java.util.Date d = calender.getTime();
+//        Timestamp currentDate = new Timestamp(d.getTime());
+//        experimentResource.setSubmittedDate(currentDate);
+//        experimentResource.save();
+//
+//        experimentDataResource = (ExperimentDataResource) experimentResource.create(ResourceType.EXPERIMENT_DATA);
+//        experimentDataResource.setExpName("testExpID");
+//        experimentDataResource.setUserName(workerResource.getUser());
+//        experimentDataResource.save();
+//    }
+//
+//    public void testCreate() throws Exception {
+//        assertNotNull("experiment data resource has being created ", experimentDataResource);
+//    }
+//
+//    public void testGet() throws Exception {
+//        assertNotNull("experiment data retrieved successfully", experimentResource.get(ResourceType.EXPERIMENT_DATA, "testExpID"));
+//    }
+//
+//    public void testSave() throws Exception {
+//        experimentResource.save();
+//        assertTrue("experiment save successfully", gatewayResource.isExists(ResourceType.EXPERIMENT, "testExpID"));
+//    }
+//
+//    public void testRemove() throws Exception {
+//        if (!experimentDataResource.isWorkflowInstancePresent("testWFInstance")){
+//            experimentResource.remove(ResourceType.EXPERIMENT_DATA, "testExpID");
+//            assertTrue("experiment data removed successfully", !experimentResource.isExists(ResourceType.EXPERIMENT_DATA, "testExpID"));
+//        }
+//    }
+//
+//    @Override
+//    public void tearDown() throws Exception {
+//        super.tearDown();
+//    }
+//}

http://git-wip-us.apache.org/repos/asf/airavata/blob/10b41d86/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/GFacJobDataResourceTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/GFacJobDataResourceTest.java b/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/GFacJobDataResourceTest.java
index 6616d06..c25e4fd 100644
--- a/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/GFacJobDataResourceTest.java
+++ b/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/GFacJobDataResourceTest.java
@@ -28,8 +28,8 @@ import java.util.Calendar;
 
 public class GFacJobDataResourceTest extends AbstractResourceTest {
     private WorkerResource workerResource;
-    private ExperimentDataResource experimentDataResource;
     private WorkflowDataResource workflowDataResource;
+    private ExperimentMetadataResource  experimentResource;
 
     @Override
     public void setUp() throws Exception {
@@ -37,18 +37,14 @@ public class GFacJobDataResourceTest extends AbstractResourceTest {
         GatewayResource gatewayResource = super.getGatewayResource();
         workerResource = super.getWorkerResource();
 
-        ExperimentResource experimentResource = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
+        experimentResource = (ExperimentMetadataResource) gatewayResource.create(ResourceType.EXPERIMENT_METADATA);
         experimentResource.setExpID("testExpID");
-        experimentResource.setWorker(workerResource);
+        experimentResource.setExperimentName("testExpID");
+        experimentResource.setExecutionUser(workerResource.getUser());
         experimentResource.setProject(new ProjectResource(workerResource, gatewayResource, "testProject"));
         experimentResource.save();
 
-        experimentDataResource = (ExperimentDataResource) experimentResource.create(ResourceType.EXPERIMENT_DATA);
-        experimentDataResource.setExpName("testExpID");
-        experimentDataResource.setUserName(workerResource.getUser());
-        experimentDataResource.save();
-
-        workflowDataResource = (WorkflowDataResource) experimentDataResource.create(ResourceType.WORKFLOW_DATA);
+        workflowDataResource = (WorkflowDataResource) experimentResource.create(ResourceType.WORKFLOW_DATA);
         workflowDataResource.setWorkflowInstanceID("testWFInstance");
         workflowDataResource.setTemplateName("testTemplate");
         workflowDataResource.setExperimentID("testExpID");
@@ -68,7 +64,7 @@ public class GFacJobDataResourceTest extends AbstractResourceTest {
         GFacJobDataResource resource = (GFacJobDataResource)workflowDataResource.create(ResourceType.GFAC_JOB_DATA);
         resource.setLocalJobID("testJobID");
         resource.setApplicationDescID("testApplication");
-        resource.setExperimentDataResource(experimentDataResource);
+        resource.setMetadataResource(experimentResource);
         resource.setNodeID("testNode");
         resource.setHostDescID("testHost");
         resource.setServiceDescID("testService");

http://git-wip-us.apache.org/repos/asf/airavata/blob/10b41d86/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/GFacJobStatusResourceTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/GFacJobStatusResourceTest.java b/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/GFacJobStatusResourceTest.java
index f13d762..d690297 100644
--- a/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/GFacJobStatusResourceTest.java
+++ b/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/GFacJobStatusResourceTest.java
@@ -36,18 +36,15 @@ public class GFacJobStatusResourceTest extends AbstractResourceTest {
         GatewayResource gatewayResource = super.getGatewayResource();
         WorkerResource workerResource = super.getWorkerResource();
 
-        ExperimentResource experimentResource = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
+        ExperimentMetadataResource experimentResource = (ExperimentMetadataResource) gatewayResource.create(ResourceType.EXPERIMENT_METADATA);
         experimentResource.setExpID("testExpID");
-        experimentResource.setWorker(workerResource);
+        experimentResource.setExperimentName("testExpID");
+        experimentResource.setExecutionUser(workerResource.getUser());
         experimentResource.setProject(new ProjectResource(workerResource, gatewayResource, "testProject"));
         experimentResource.save();
 
-        ExperimentDataResource experimentDataResource = (ExperimentDataResource) experimentResource.create(ResourceType.EXPERIMENT_DATA);
-        experimentDataResource.setExpName("testExpID");
-        experimentDataResource.setUserName(workerResource.getUser());
-        experimentDataResource.save();
 
-        WorkflowDataResource workflowDataResource = (WorkflowDataResource) experimentDataResource.create(ResourceType.WORKFLOW_DATA);
+        WorkflowDataResource workflowDataResource = (WorkflowDataResource) experimentResource.create(ResourceType.WORKFLOW_DATA);
         workflowDataResource.setWorkflowInstanceID("testWFInstance");
         workflowDataResource.setTemplateName("testTemplate");
         workflowDataResource.setExperimentID("testExpID");
@@ -60,7 +57,7 @@ public class GFacJobStatusResourceTest extends AbstractResourceTest {
         gFacJobDataResource = (GFacJobDataResource) workflowDataResource.create(ResourceType.GFAC_JOB_DATA);
         gFacJobDataResource.setLocalJobID("testJobID");
         gFacJobDataResource.setApplicationDescID("testApplication");
-        gFacJobDataResource.setExperimentDataResource(experimentDataResource);
+        gFacJobDataResource.setMetadataResource(experimentResource);
         gFacJobDataResource.setNodeID("testNode");
         gFacJobDataResource.setHostDescID("testHost");
         gFacJobDataResource.setServiceDescID("testService");

http://git-wip-us.apache.org/repos/asf/airavata/blob/10b41d86/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/GatewayResourceTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/GatewayResourceTest.java b/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/GatewayResourceTest.java
index 5d40f9a..c1cb245 100644
--- a/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/GatewayResourceTest.java
+++ b/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/GatewayResourceTest.java
@@ -37,7 +37,7 @@ public class GatewayResourceTest extends AbstractResourceTest {
     private HostDescriptorResource hostDescriptorResource;
     private ServiceDescriptorResource serviceDescriptorResource;
     private ApplicationDescriptorResource applicationDescriptorResource;
-    private ExperimentResource experimentResource;
+    private ExperimentMetadataResource experimentResource;
 
 
     @Override
@@ -59,7 +59,7 @@ public class GatewayResourceTest extends AbstractResourceTest {
         hostDescriptorResource = (HostDescriptorResource) gatewayResource.create(ResourceType.HOST_DESCRIPTOR);
         serviceDescriptorResource = (ServiceDescriptorResource) gatewayResource.create(ResourceType.SERVICE_DESCRIPTOR);
         applicationDescriptorResource = (ApplicationDescriptorResource) gatewayResource.create(ResourceType.APPLICATION_DESCRIPTOR);
-        experimentResource = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
+        experimentResource = (ExperimentMetadataResource) gatewayResource.create(ResourceType.EXPERIMENT_METADATA);
 
         hostDescriptorResource.setUserName(workerResource.getUser());
         hostDescriptorResource.setHostDescName("testHostDesc");
@@ -97,8 +97,10 @@ public class GatewayResourceTest extends AbstractResourceTest {
         publishWorkflowResource.save();
 
         experimentResource.setExpID("testExpID");
+        experimentResource.setExperimentName("testExpID");
         experimentResource.setProject(projectResource);
-        experimentResource.setWorker(workerResource);
+        experimentResource.setExecutionUser(workerResource.getUser());
+        experimentResource.setGateway(gatewayResource);
         experimentResource.setSubmittedDate(currentTime);
         experimentResource.save();
     }
@@ -130,7 +132,7 @@ public class GatewayResourceTest extends AbstractResourceTest {
         assertTrue(gatewayResource.isExists(ResourceType.HOST_DESCRIPTOR, "testHostDesc"));
         assertTrue(gatewayResource.isExists(ResourceType.SERVICE_DESCRIPTOR, "testServiceDesc"));
         assertTrue(gatewayResource.isExists(ResourceType.APPLICATION_DESCRIPTOR, "testAppDesc"));
-        assertTrue(gatewayResource.isExists(ResourceType.EXPERIMENT, "testExpID"));
+        assertTrue(gatewayResource.isExists(ResourceType.EXPERIMENT_METADATA, "testExpID"));
     }
 
     public void testGet() throws Exception {
@@ -139,7 +141,7 @@ public class GatewayResourceTest extends AbstractResourceTest {
         assertNotNull(gatewayResource.get(ResourceType.HOST_DESCRIPTOR, "testHostDesc"));
         assertNotNull(gatewayResource.get(ResourceType.SERVICE_DESCRIPTOR, "testServiceDesc"));
         assertNotNull(gatewayResource.get(ResourceType.APPLICATION_DESCRIPTOR, "testAppDesc"));
-        assertNotNull(gatewayResource.get(ResourceType.EXPERIMENT, "testExpID"));
+        assertNotNull(gatewayResource.get(ResourceType.EXPERIMENT_METADATA, "testExpID"));
     }
 
     public void testGetList() throws Exception {
@@ -149,7 +151,7 @@ public class GatewayResourceTest extends AbstractResourceTest {
         assertNotNull(gatewayResource.get(ResourceType.HOST_DESCRIPTOR));
         assertNotNull(gatewayResource.get(ResourceType.SERVICE_DESCRIPTOR));
         assertNotNull(gatewayResource.get(ResourceType.APPLICATION_DESCRIPTOR));
-        assertNotNull(gatewayResource.get(ResourceType.EXPERIMENT));
+        assertNotNull(gatewayResource.get(ResourceType.EXPERIMENT_METADATA));
     }
 
     public void testRemove() throws Exception {
@@ -164,8 +166,8 @@ public class GatewayResourceTest extends AbstractResourceTest {
         gatewayResource.remove(ResourceType.SERVICE_DESCRIPTOR, "testServiceDesc");
         assertFalse(gatewayResource.isExists(ResourceType.SERVICE_DESCRIPTOR, "testServiceDesc"));
 
-        gatewayResource.remove(ResourceType.EXPERIMENT, "testExpID");
-        assertFalse(gatewayResource.isExists(ResourceType.EXPERIMENT, "testExpID"));
+        gatewayResource.remove(ResourceType.EXPERIMENT_METADATA, "testExpID");
+        assertFalse(gatewayResource.isExists(ResourceType.EXPERIMENT_METADATA, "testExpID"));
 
         gatewayResource.remove(ResourceType.APPLICATION_DESCRIPTOR, "testAppDesc");
         assertFalse(gatewayResource.isExists(ResourceType.APPLICATION_DESCRIPTOR, "testAppDesc"));

http://git-wip-us.apache.org/repos/asf/airavata/blob/10b41d86/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/GramDataResourceTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/GramDataResourceTest.java b/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/GramDataResourceTest.java
index c642261..2c41d93 100644
--- a/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/GramDataResourceTest.java
+++ b/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/GramDataResourceTest.java
@@ -35,18 +35,14 @@ public class GramDataResourceTest extends AbstractResourceTest {
         GatewayResource gatewayResource = super.getGatewayResource();
         WorkerResource workerResource = super.getWorkerResource();
 
-        ExperimentResource experimentResource = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
+        ExperimentMetadataResource experimentResource = (ExperimentMetadataResource) gatewayResource.create(ResourceType.EXPERIMENT_METADATA);
         experimentResource.setExpID("testExpID");
-        experimentResource.setWorker(workerResource);
+        experimentResource.setExperimentName("testExpID");
+        experimentResource.setExecutionUser(workerResource.getUser());
         experimentResource.setProject(new ProjectResource(workerResource, gatewayResource, "testProject"));
         experimentResource.save();
 
-        ExperimentDataResource experimentDataResource = (ExperimentDataResource) experimentResource.create(ResourceType.EXPERIMENT_DATA);
-        experimentDataResource.setExpName("testExpID");
-        experimentDataResource.setUserName(workerResource.getUser());
-        experimentDataResource.save();
-
-        workflowDataResource = (WorkflowDataResource) experimentDataResource.create(ResourceType.WORKFLOW_DATA);
+        workflowDataResource = (WorkflowDataResource) experimentResource.create(ResourceType.WORKFLOW_DATA);
         workflowDataResource.setWorkflowInstanceID("testWFInstance");
         workflowDataResource.setTemplateName("testTemplate");
         workflowDataResource.setExperimentID("testExpID");

http://git-wip-us.apache.org/repos/asf/airavata/blob/10b41d86/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/NodeDataResourceTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/NodeDataResourceTest.java b/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/NodeDataResourceTest.java
index ab608f4..bae6dff 100644
--- a/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/NodeDataResourceTest.java
+++ b/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/NodeDataResourceTest.java
@@ -35,18 +35,14 @@ public class NodeDataResourceTest extends AbstractResourceTest {
         GatewayResource gatewayResource = super.getGatewayResource();
         WorkerResource workerResource = super.getWorkerResource();
 
-        ExperimentResource experimentResource = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
+        ExperimentMetadataResource experimentResource = (ExperimentMetadataResource) gatewayResource.create(ResourceType.EXPERIMENT_METADATA);
         experimentResource.setExpID("testExpID");
-        experimentResource.setWorker(workerResource);
+        experimentResource.setExperimentName("testExpID");
+        experimentResource.setExecutionUser(workerResource.getUser());
         experimentResource.setProject(new ProjectResource(workerResource, gatewayResource, "testProject"));
         experimentResource.save();
 
-        ExperimentDataResource experimentDataResource = (ExperimentDataResource) experimentResource.create(ResourceType.EXPERIMENT_DATA);
-        experimentDataResource.setExpName("testExpID");
-        experimentDataResource.setUserName(workerResource.getUser());
-        experimentDataResource.save();
-
-        workflowDataResource = (WorkflowDataResource) experimentDataResource.create(ResourceType.WORKFLOW_DATA);
+        workflowDataResource = (WorkflowDataResource) experimentResource.create(ResourceType.WORKFLOW_DATA);
         workflowDataResource.setWorkflowInstanceID("testWFInstance");
         workflowDataResource.setTemplateName("testTemplate");
         workflowDataResource.setExperimentID("testExpID");

http://git-wip-us.apache.org/repos/asf/airavata/blob/10b41d86/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/OrchestratorDataResourceTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/OrchestratorDataResourceTest.java b/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/OrchestratorDataResourceTest.java
index 4c3d1cc..96dd427 100644
--- a/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/OrchestratorDataResourceTest.java
+++ b/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/OrchestratorDataResourceTest.java
@@ -3,31 +3,41 @@ package org.apache.airavata.persistance.registry.jpa;
 import java.util.UUID;
 
 import org.apache.airavata.common.utils.AiravataJobState;
-import org.apache.airavata.persistance.registry.jpa.resources.GatewayResource;
-import org.apache.airavata.persistance.registry.jpa.resources.OrchestratorDataResource;
+import org.apache.airavata.persistance.registry.jpa.resources.*;
 
 public class OrchestratorDataResourceTest extends AbstractResourceTest{
 	private OrchestratorDataResource dataResource;
-    private GatewayResource gatewayResource;
-	private String experimentID = UUID.randomUUID().toString();
+    private ExperimentMetadataResource experimentResource;
+    private WorkerResource workerResource;
+//	private String experimentID = UUID.randomUUID().toString();
 	private String applicationName = "echo_test";
+    private GatewayResource gatewayResource;
 	
 	 @Override
 	    public void setUp() throws Exception {
-	        super.setUp();
-	        gatewayResource = super.getGatewayResource();
-		    dataResource = (OrchestratorDataResource) gatewayResource.create(ResourceType.ORCHESTRATOR);
-	      
-	   }
+         super.setUp();
+         gatewayResource = super.getGatewayResource();
+         workerResource = super.getWorkerResource();
+
+         experimentResource = (ExperimentMetadataResource) gatewayResource.create(ResourceType.EXPERIMENT_METADATA);
+         experimentResource.setExpID("testExpID");
+         experimentResource.setExperimentName("testExpID");
+         experimentResource.setExecutionUser(workerResource.getUser());
+         experimentResource.setProject(new ProjectResource(workerResource, gatewayResource, "testProject"));
+         experimentResource.save();
+
+         dataResource = (OrchestratorDataResource) gatewayResource.create(ResourceType.ORCHESTRATOR);
+
+     }
 
 	    public void testSave() throws Exception {
-	        dataResource.setExperimentID(experimentID);
+	        dataResource.setExperimentID("testExpID");
 	        dataResource.setStatus(AiravataJobState.State.CREATED.toString());
 	        dataResource.setApplicationName(applicationName);
 	        dataResource.save();
 	        assertNotNull("Orchestrator data resource created successfully", dataResource);
 	        // Get saved data
-	        assertNotNull("Orchestrator data resource get successfully", gatewayResource.get(ResourceType.ORCHESTRATOR, experimentID));
+	        assertNotNull("Orchestrator data resource get successfully", gatewayResource.get(ResourceType.ORCHESTRATOR, "testExpID"));
 	    }
 
 	    @Override

http://git-wip-us.apache.org/repos/asf/airavata/blob/10b41d86/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/PersistentDataTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/PersistentDataTestSuite.java b/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/PersistentDataTestSuite.java
deleted file mode 100644
index 5072442..0000000
--- a/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/PersistentDataTestSuite.java
+++ /dev/null
@@ -1,49 +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.persistance.registry.jpa;
-
-import junit.framework.*;
-import junit.framework.Test;
-import org.junit.Before;
-
-import java.util.Enumeration;
-
-public class PersistentDataTestSuite extends TestSuite{
-
-    @Before
-    public void setUp() throws Exception {
-
-        Class[] testClasses = { ConfigurationResourceTest.class,
-                                GatewayResourceTest.class, UserResourceTest.class, WorkerResourceTest.class, ProjectResourceTest.class,
-                                HostDescriptorResourceTest.class, ServiceDescriptorResourceTest.class, ApplicationDescriptorResourceTest.class,
-                                UserWorkflowResourceTest.class, PublishWorkflowResourceTest.class,
-                                ExperimentResourceTest.class, ExperimentMetadataResourceTest.class, ExperimentDataResourceTest.class,
-                                WorkflowDataResourceTest.class, NodeDataResourceTest.class, GramDataResourceTest.class};
-        TestSuite testSuite = new TestSuite(testClasses);
-    }
-
-    @Override
-    public Enumeration<Test> tests() {
-
-        return super.tests();
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/10b41d86/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ProjectResourceTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ProjectResourceTest.java b/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ProjectResourceTest.java
index c8130ee..8c0ce32 100644
--- a/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ProjectResourceTest.java
+++ b/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ProjectResourceTest.java
@@ -21,10 +21,7 @@
 
 package org.apache.airavata.persistance.registry.jpa;
 
-import org.apache.airavata.persistance.registry.jpa.resources.ExperimentResource;
-import org.apache.airavata.persistance.registry.jpa.resources.GatewayResource;
-import org.apache.airavata.persistance.registry.jpa.resources.ProjectResource;
-import org.apache.airavata.persistance.registry.jpa.resources.WorkerResource;
+import org.apache.airavata.persistance.registry.jpa.resources.*;
 
 import java.sql.Timestamp;
 import java.util.Calendar;
@@ -33,7 +30,7 @@ public class ProjectResourceTest extends AbstractResourceTest {
     private GatewayResource gatewayResource;
     private WorkerResource workerResource;
     private ProjectResource projectResource;
-    private ExperimentResource experimentResource;
+    private ExperimentMetadataResource experimentResource;
 
     @Override
     public void setUp() throws Exception {
@@ -47,11 +44,9 @@ public class ProjectResourceTest extends AbstractResourceTest {
 
         experimentResource = projectResource.createExperiment("testExpID");
         experimentResource.setGateway(gatewayResource);
-        experimentResource.setWorker(workerResource);
-        Calendar calender = Calendar.getInstance();
-        java.util.Date d = calender.getTime();
-        Timestamp currentTime = new Timestamp(d.getTime());
-        experimentResource.setSubmittedDate(currentTime);
+        experimentResource.setExperimentName("testExpID");
+        experimentResource.setExecutionUser(workerResource.getUser());
+        experimentResource.setSubmittedDate(getCurrentTimestamp());
         experimentResource.setProject(projectResource);
         experimentResource.save();
     }
@@ -61,7 +56,7 @@ public class ProjectResourceTest extends AbstractResourceTest {
     }
 
     public void testGet() throws Exception {
-        ExperimentResource experiment = projectResource.getExperiment("testExpID");
+        ExperimentMetadataResource experiment = projectResource.getExperiment("testExpID");
         assertNotNull("experiment resource retrieved successfully", experiment);
     }
 
@@ -70,27 +65,14 @@ public class ProjectResourceTest extends AbstractResourceTest {
     }
 
     public void testSave() throws Exception {
-        projectResource.save();
         assertTrue("Project saved successfully", workerResource.isProjectExists("testProject"));
-        //remove project
-        workerResource.removeProject("testProject");
     }
 
 
-    public void testRemove() throws Exception {
-        projectResource.removeExperiment("testExpID");
-        assertFalse("experiment removed successfully", projectResource.isExperimentExists("testExpID"));
-
-        experimentResource = projectResource.createExperiment("testExpID");
-        experimentResource.setGateway(gatewayResource);
-        experimentResource.setWorker(workerResource);
-        Calendar calender = Calendar.getInstance();
-        java.util.Date d = calender.getTime();
-        Timestamp currentTime = new Timestamp(d.getTime());
-        experimentResource.setSubmittedDate(currentTime);
-        experimentResource.setProject(projectResource);
-        experimentResource.save();
-    }
+//    public void testRemove() throws Exception {
+//        projectResource.removeExperiment("testExpID");
+//        assertFalse("experiment removed successfully", projectResource.isExperimentExists("testExpID"));
+//    }
 
     @Override
     public void tearDown() throws Exception {


Mime
View raw message