airavata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AIRAVATA-2728) Refactoring Experiment Catalog Implementation
Date Thu, 03 May 2018 21:17:00 GMT

    [ https://issues.apache.org/jira/browse/AIRAVATA-2728?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16463070#comment-16463070
] 

ASF GitHub Bot commented on AIRAVATA-2728:
------------------------------------------

machristie commented on a change in pull request #191: [AIRAVATA-2728] Refactoring Experiment
Catalog Implementation
URL: https://github.com/apache/airavata/pull/191#discussion_r185937109
 
 

 ##########
 File path: modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/expcatalog/ExperimentRepositoryTest.java
 ##########
 @@ -0,0 +1,121 @@
+/*
+ *
+ * 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.registry.core.repositories.expcatalog;
+
+import org.apache.airavata.model.experiment.ExperimentModel;
+import org.apache.airavata.model.experiment.ExperimentType;
+import org.apache.airavata.model.experiment.UserConfigurationDataModel;
+import org.apache.airavata.model.workspace.Gateway;
+import org.apache.airavata.model.workspace.Project;
+import org.apache.airavata.registry.core.repositories.expcatalog.util.Initialize;
+import org.apache.airavata.registry.core.utils.DBConstants;
+import org.apache.airavata.registry.cpi.RegistryException;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.List;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+
+public class ExperimentRepositoryTest {
+
+    private static Initialize initialize;
+    GatewayRepository gatewayRepository;
+    ProjectRepository projectRepository;
+    ExperimentRepository experimentRepository;
+    private static final Logger logger = LoggerFactory.getLogger(ExperimentRepositoryTest.class);
+
+    @Before
+    public void setUp() {
+        try {
+            initialize = new Initialize("expcatalog-derby.sql");
+            initialize.initializeDB();
+            gatewayRepository = new GatewayRepository();
+            projectRepository = new ProjectRepository();
+            experimentRepository = new ExperimentRepository();
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+        }
+    }
+
+    @After
+    public void tearDown() throws Exception {
+        System.out.println("********** TEAR DOWN ************");
+        initialize.stopDerbyServer();
+    }
+
+    @Test
+    public void ExperimentRepositoryTest() throws RegistryException {
+        Gateway gateway = new Gateway();
+        gateway.setGatewayId("gateway");
+        gateway.setDomain("SEAGRID");
+        gateway.setEmailAddress("abc@d.com");
+        String gatewayId = gatewayRepository.addGateway(gateway);
+
+        Project project = new Project();
+        project.setName("projectName");
+        project.setOwner("user");
+        project.setGatewayId(gatewayId);
+
+        String projectId = projectRepository.addProject(project, gatewayId);
+
+        ExperimentModel experimentModel = new ExperimentModel();
+        experimentModel.setProjectId(projectId);
+        experimentModel.setGatewayId(gatewayId);
+        experimentModel.setExperimentType(ExperimentType.SINGLE_APPLICATION);
+        experimentModel.setUserName("user");
+        experimentModel.setExperimentName("name");
+
+        String experimentId = experimentRepository.addExperiment(experimentModel);
+        assertTrue(experimentId != null);
+
+        experimentModel.setDescription("description");
+        experimentRepository.updateExperiment(experimentModel, experimentId);
+
+        ExperimentModel retrievedExperimentModel = experimentRepository.getExperiment(experimentId);
+        assertEquals(experimentModel.getDescription(), retrievedExperimentModel.getDescription());
+
+        UserConfigurationDataModel userConfigurationDataModel = new UserConfigurationDataModel();
 
 Review comment:
   Please test all of the fields of UserConfigurationDataModel.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Refactoring Experiment Catalog Implementation
> ---------------------------------------------
>
>                 Key: AIRAVATA-2728
>                 URL: https://issues.apache.org/jira/browse/AIRAVATA-2728
>             Project: Airavata
>          Issue Type: Improvement
>          Components: Registry API
>            Reporter: Sneha Tilak
>            Assignee: Sneha Tilak
>            Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message