airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From machris...@apache.org
Subject [airavata] branch group-based-auth updated: AIRAVATA-2812 Fix mapping of ComputationalResourceSchedulingModel
Date Thu, 07 Jun 2018 19:15:25 GMT
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch group-based-auth
in repository https://gitbox.apache.org/repos/asf/airavata.git


The following commit(s) were added to refs/heads/group-based-auth by this push:
     new 908471f  AIRAVATA-2812 Fix mapping of ComputationalResourceSchedulingModel
908471f is described below

commit 908471f24974b409f198f6adec1d4b6e4d3673d4
Author: Marcus Christie <machristie@apache.org>
AuthorDate: Thu Jun 7 15:13:43 2018 -0400

    AIRAVATA-2812 Fix mapping of ComputationalResourceSchedulingModel
---
 .../utils/DozerConverter/StorageDateConverter.java | 20 +++++++++++++++
 .../src/main/resources/dozer_mapping.xml           |  8 ++++++
 .../expcatalog/ExperimentRepositoryTest.java       | 30 +++++++++++++++++++++-
 3 files changed, 57 insertions(+), 1 deletion(-)

diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/DozerConverter/StorageDateConverter.java
b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/DozerConverter/StorageDateConverter.java
index 9d571cc..b63d7b8 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/DozerConverter/StorageDateConverter.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/DozerConverter/StorageDateConverter.java
@@ -1,3 +1,23 @@
+/*
+ * 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.utils.DozerConverter;
 
 import org.dozer.DozerConverter;
diff --git a/modules/registry-refactoring/src/main/resources/dozer_mapping.xml b/modules/registry-refactoring/src/main/resources/dozer_mapping.xml
index 0f3a728..bf7cb33 100644
--- a/modules/registry-refactoring/src/main/resources/dozer_mapping.xml
+++ b/modules/registry-refactoring/src/main/resources/dozer_mapping.xml
@@ -15,4 +15,12 @@
             <b>updateTime</b>
         </field>
     </mapping>
+    <mapping>
+        <class-a>org.apache.airavata.registry.core.entities.expcatalog.UserConfigurationDataEntity</class-a>
+        <class-b>org.apache.airavata.model.experiment.UserConfigurationDataModel</class-b>
+        <field>
+            <a>this</a>
+            <b>computationalResourceScheduling</b>
+        </field>
+    </mapping>
 </mappings>
\ No newline at end of file
diff --git a/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/expcatalog/ExperimentRepositoryTest.java
b/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/expcatalog/ExperimentRepositoryTest.java
index e59709a..e755919 100644
--- a/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/expcatalog/ExperimentRepositoryTest.java
+++ b/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/expcatalog/ExperimentRepositoryTest.java
@@ -23,6 +23,7 @@ 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.scheduling.ComputationalResourceSchedulingModel;
 import org.apache.airavata.model.workspace.Gateway;
 import org.apache.airavata.model.workspace.Project;
 import org.apache.airavata.registry.core.repositories.expcatalog.util.Initialize;
@@ -102,12 +103,39 @@ public class ExperimentRepositoryTest {
         UserConfigurationDataModel userConfigurationDataModel = new UserConfigurationDataModel();
         userConfigurationDataModel.setAiravataAutoSchedule(true);
         userConfigurationDataModel.setOverrideManualScheduledParams(false);
+        ComputationalResourceSchedulingModel computationalResourceSchedulingModel = new ComputationalResourceSchedulingModel();
+        computationalResourceSchedulingModel.setResourceHostId("resource-host-id");
+        computationalResourceSchedulingModel.setTotalCPUCount(12);
+        computationalResourceSchedulingModel.setNodeCount(13);
+        computationalResourceSchedulingModel.setNumberOfThreads(14);
+        computationalResourceSchedulingModel.setOverrideAllocationProjectNumber("override-project-num");
+        computationalResourceSchedulingModel.setOverrideLoginUserName("override-login-username");
+        computationalResourceSchedulingModel.setOverrideScratchLocation("override-scratch-location");
+        computationalResourceSchedulingModel.setQueueName("queue-name");
+        computationalResourceSchedulingModel.setStaticWorkingDir("static-working-dir");
+        computationalResourceSchedulingModel.setTotalPhysicalMemory(1333);
+        computationalResourceSchedulingModel.setWallTimeLimit(77);
+        userConfigurationDataModel.setComputationalResourceScheduling(computationalResourceSchedulingModel);
         assertEquals(experimentId, experimentRepository.addUserConfigurationData(userConfigurationDataModel,
experimentId));
 
         userConfigurationDataModel.setStorageId("storage2");
         experimentRepository.updateUserConfigurationData(userConfigurationDataModel, experimentId);
 
-        assertEquals("storage2", experimentRepository.getUserConfigurationData(experimentId).getStorageId());
+        final UserConfigurationDataModel retrievedUserConfigurationDataModel = experimentRepository.getUserConfigurationData(experimentId);
+        assertEquals("storage2", retrievedUserConfigurationDataModel.getStorageId());
+        final ComputationalResourceSchedulingModel retrievedComputationalResourceScheduling
= retrievedUserConfigurationDataModel.getComputationalResourceScheduling();
+        assertNotNull(retrievedComputationalResourceScheduling);
+        assertEquals("resource-host-id", retrievedComputationalResourceScheduling.getResourceHostId());
+        assertEquals( 12, retrievedComputationalResourceScheduling.getTotalCPUCount());
+        assertEquals(13, retrievedComputationalResourceScheduling.getNodeCount());
+        assertEquals(14, retrievedComputationalResourceScheduling.getNumberOfThreads());
+        assertEquals("override-project-num", retrievedComputationalResourceScheduling.getOverrideAllocationProjectNumber());
+        assertEquals("override-login-username", retrievedComputationalResourceScheduling.getOverrideLoginUserName());
+        assertEquals("override-scratch-location", retrievedComputationalResourceScheduling.getOverrideScratchLocation());
+        assertEquals("queue-name", retrievedComputationalResourceScheduling.getQueueName());
+        assertEquals("static-working-dir", retrievedComputationalResourceScheduling.getStaticWorkingDir());
+        assertEquals(1333, retrievedComputationalResourceScheduling.getTotalPhysicalMemory());
+        assertEquals(77, retrievedComputationalResourceScheduling.getWallTimeLimit());
 
         List<String> experimentIdList = experimentRepository.getExperimentIDs(DBConstants.Experiment.GATEWAY_ID,
gatewayId);
         assertTrue(experimentIdList.size() == 1);

-- 
To stop receiving notification emails like this one, please contact
machristie@apache.org.

Mime
View raw message