airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject airavata git commit: passing options as arguments AIRAVATA-1652
Date Fri, 03 Apr 2015 20:36:27 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 4d478d80c -> d61d33ee4


passing options as arguments AIRAVATA-1652


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

Branch: refs/heads/master
Commit: d61d33ee47e6a687cc754101630828ccd899992e
Parents: 4d478d8
Author: Chathuri Wimalasena <kamalasini@gmail.com>
Authored: Fri Apr 3 16:36:21 2015 -0400
Committer: Chathuri Wimalasena <kamalasini@gmail.com>
Committed: Fri Apr 3 16:36:21 2015 -0400

----------------------------------------------------------------------
 .../ApplicationRegister.java                    |   8 +-
 .../ExperimentExecution.java                    | 108 +++++++++++--------
 .../FrameworkBootstrapping.java                 | 106 ++++++++++++++++--
 .../multitenantedairavata/FrameworkSetup.java   |  10 ++
 .../multitenantedairavata/GatewayRegister.java  |  12 ++-
 .../multitenantedairavata/LoadTester.java       |  50 ---------
 .../utils/TestFrameworkConstants.java           |   6 +-
 7 files changed, 192 insertions(+), 108 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/d61d33ee/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/ApplicationRegister.java
----------------------------------------------------------------------
diff --git a/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/ApplicationRegister.java
b/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/ApplicationRegister.java
index d73ccba..6681219 100644
--- a/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/ApplicationRegister.java
+++ b/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/ApplicationRegister.java
@@ -97,10 +97,10 @@ public class ApplicationRegister {
             // add amber deployment
             List<String> moduleLoadCMDs = new ArrayList<String>();
             moduleLoadCMDs.add("module load amber");
-            String amberStampedeAppDeployId = airavata.registerApplicationDeployment(gateway.getGatewayId(),
-                    createApplicationDeployment(amberModuleId, stampedeResourceId,
-                            "/opt/apps/intel13/mvapich2_1_9/amber/12.0/bin/sander.MPI -O",
ApplicationParallelismType.MPI,
-                            TestFrameworkConstants.AppcatalogConstants.AMBER_DESCRIPTION,
moduleLoadCMDs, null, null));
+            ApplicationDeploymentDescription amberStampedeDeployment = createApplicationDeployment(amberModuleId,
stampedeResourceId,
+                    "/opt/apps/intel13/mvapich2_1_9/amber/12.0/bin/sander.MPI -O", ApplicationParallelismType.MPI,
+                    TestFrameworkConstants.AppcatalogConstants.AMBER_DESCRIPTION, moduleLoadCMDs,
null, null);
+            String amberStampedeAppDeployId = airavata.registerApplicationDeployment(gateway.getGatewayId(),amberStampedeDeployment);
 
             String amberTrestlesAppDeployId = airavata.registerApplicationDeployment(gateway.getGatewayId(),
                     createApplicationDeployment(amberModuleId, trestlesResourceId,

http://git-wip-us.apache.org/repos/asf/airavata/blob/d61d33ee/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/ExperimentExecution.java
----------------------------------------------------------------------
diff --git a/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/ExperimentExecution.java
b/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/ExperimentExecution.java
index 7a79735..08ae052 100644
--- a/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/ExperimentExecution.java
+++ b/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/ExperimentExecution.java
@@ -27,13 +27,16 @@ import org.apache.airavata.messaging.core.MessageContext;
 import org.apache.airavata.messaging.core.MessageHandler;
 import org.apache.airavata.messaging.core.MessagingConstants;
 import org.apache.airavata.messaging.core.impl.RabbitMQStatusConsumer;
-import org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription;
 import org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType;
 import org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType;
+import org.apache.airavata.model.error.AiravataClientException;
+import org.apache.airavata.model.error.AiravataSystemException;
+import org.apache.airavata.model.error.InvalidRequestException;
 import org.apache.airavata.model.messaging.event.ExperimentStatusChangeEvent;
 import org.apache.airavata.model.messaging.event.JobStatusChangeEvent;
 import org.apache.airavata.model.messaging.event.MessageType;
 import org.apache.airavata.model.util.ExperimentModelUtil;
+import org.apache.airavata.model.workspace.Project;
 import org.apache.airavata.model.workspace.experiment.ComputationalResourceScheduling;
 import org.apache.airavata.model.workspace.experiment.Experiment;
 import org.apache.airavata.model.workspace.experiment.ExperimentState;
@@ -57,23 +60,64 @@ public class ExperimentExecution {
     private Map<String, String> experimentsWithTokens;
     private Map<String, String> experimentsWithGateway;
     private Map<String, String> csTokens;
-    private Map<String, String> appInterfaceMap;
-    private Map<String, String> projectsMap;
+    private Map<String, Map<String, String>> appInterfaceMap;
+    private Map<String, List<Project>> projectsMap;
     private PropertyReader propertyReader;
 
     public ExperimentExecution(Airavata.Client airavata,
-                               Map<String, String> tokenMap,
-                               Map<String, String> appInterfaces,
-                               Map<String, String> projectMap ) {
+                               Map<String, String> tokenMap ) {
         this.airavata = airavata;
         this.csTokens = tokenMap;
-        this.appInterfaceMap = appInterfaces;
+        this.appInterfaceMap = getApplicationMap(tokenMap);
         this.propertyReader = new PropertyReader();
-        this.projectsMap = projectMap;
+        this.projectsMap = getProjects(tokenMap);
         this.experimentsWithTokens = new HashMap<String, String>();
         this.experimentsWithGateway = new HashMap<String, String>();
     }
 
+    protected Map<String, Map<String, String>> getApplicationMap (Map<String,
String> tokenMap){
+        appInterfaceMap = new HashMap<String, Map<String, String>>();
+        try {
+            if (tokenMap != null && !tokenMap.isEmpty()){
+                for (String gatewayId : tokenMap.keySet()){
+                    Map<String, String> allApplicationInterfaceNames = airavata.getAllApplicationInterfaceNames(gatewayId);
+                    appInterfaceMap.put(gatewayId, allApplicationInterfaceNames);
+                }
+            }
+        } catch (AiravataSystemException e) {
+            e.printStackTrace();
+        } catch (InvalidRequestException e) {
+            e.printStackTrace();
+        } catch (AiravataClientException e) {
+            e.printStackTrace();
+        } catch (TException e) {
+            e.printStackTrace();
+        }
+        return appInterfaceMap;
+    }
+
+    protected Map<String, List<Project>> getProjects (Map<String, String>
tokenMap){
+        projectsMap = new HashMap<String, List<Project>>();
+        try {
+            if (tokenMap != null && !tokenMap.isEmpty()){
+                for (String gatewayId : tokenMap.keySet()){
+                    String userName = "testUser_" + gatewayId;
+                    List<Project> allUserProjects = airavata.getAllUserProjects(gatewayId,
userName);
+                    projectsMap.put(gatewayId, allUserProjects);
+                }
+            }
+        } catch (AiravataSystemException e) {
+            e.printStackTrace();
+        } catch (InvalidRequestException e) {
+            e.printStackTrace();
+        } catch (AiravataClientException e) {
+            e.printStackTrace();
+        } catch (TException e) {
+            e.printStackTrace();
+        }
+        return projectsMap;
+    }
+
     public void launchExperiments () throws Exception {
         try {
             for (String expId : experimentsWithTokens.keySet()){
@@ -155,7 +199,7 @@ public class ExperimentExecution {
         try {
             for (String gatewayId : csTokens.keySet()){
                 String token = csTokens.get(gatewayId);
-                Map<String, String> appsWithNames = generateAppsPerGateway(gatewayId);
+                Map<String, String> appsWithNames = appInterfaceMap.get(gatewayId);
                 for (String appId : appsWithNames.keySet()){
                     List<InputDataObjectType> applicationInputs = airavata.getApplicationInputs(appId);
                     List<OutputDataObjectType> appOutputs = airavata.getApplicationOutputs(appId);
@@ -175,9 +219,13 @@ public class ExperimentExecution {
                             }
                         }
 
-                        String projectId = getProjectIdForGateway(gatewayId);
+                        List<Project> projectsPerGateway = projectsMap.get(gatewayId);
+                        String projectID = null;
+                        if (projectsPerGateway != null && !projectsPerGateway.isEmpty()){
+                            projectID = projectsPerGateway.get(0).getProjectID();
+                        }
                         Experiment simpleExperiment =
-                                ExperimentModelUtil.createSimpleExperiment(projectId, "admin",
"Amber Experiment", "Amber Experiment run", appId, applicationInputs);
+                                ExperimentModelUtil.createSimpleExperiment(projectID, "admin",
"Amber Experiment", "Amber Experiment run", appId, applicationInputs);
                         simpleExperiment.setExperimentOutputs(appOutputs);
                         String experimentId;
                         Map<String, String> computeResources = airavata.getAvailableAppInterfaceComputeResources(appId);
@@ -226,39 +274,11 @@ public class ExperimentExecution {
         }
     }
 
-    public String getProjectIdForGateway (String gatewayId){
-        for (String projectId : projectsMap.keySet()){
-            String gateway = projectsMap.get(projectId);
-            if (gateway.equals(gatewayId)){
-                return projectId;
-            }
-        }
-        return null;
-    }
-
-    public Map<String, String> generateAppsPerGateway (String gatewayId) throws Exception
{
-        Map<String, String> appWithNames = new HashMap<String, String>();
-        try {
-            for (String appId : appInterfaceMap.keySet()){
-                String gateway = appInterfaceMap.get(appId);
-                ApplicationInterfaceDescription applicationInterface = airavata.getApplicationInterface(appId);
-                if (gateway.equals(gatewayId)){
-                    appWithNames.put(appId, applicationInterface.getApplicationName());
-                }
-            }
-        }catch (Exception e){
-            logger.error("Error while getting application interface", e);
-            throw new Exception("Error while getting application interface", e);
-        }
-
-        return appWithNames;
-    }
-
     public void createEchoExperiment () throws Exception{
         try {
             for (String gatewayId : csTokens.keySet()) {
                 String token = csTokens.get(gatewayId);
-                Map<String, String> appsWithNames = generateAppsPerGateway(gatewayId);
+                Map<String, String> appsWithNames = appInterfaceMap.get(gatewayId);
                 for (String appId : appsWithNames.keySet()) {
                     List<InputDataObjectType> applicationInputs = airavata.getApplicationInputs(appId);
                     List<OutputDataObjectType> appOutputs = airavata.getApplicationOutputs(appId);
@@ -270,9 +290,13 @@ public class ExperimentExecution {
                             }
                         }
 
-                        String projectId = getProjectIdForGateway(gatewayId);
+                        List<Project> projectsPerGateway = projectsMap.get(gatewayId);
+                        String projectID = null;
+                        if (projectsPerGateway != null && !projectsPerGateway.isEmpty()){
+                            projectID = projectsPerGateway.get(0).getProjectID();
+                        }
                         Experiment simpleExperiment =
-                                ExperimentModelUtil.createSimpleExperiment(projectId, "admin",
"Echo Experiment", "Echo Experiment run", appId, applicationInputs);
+                                ExperimentModelUtil.createSimpleExperiment(projectID, "admin",
"Echo Experiment", "Echo Experiment run", appId, applicationInputs);
                         simpleExperiment.setExperimentOutputs(appOutputs);
                         String experimentId;
                         Map<String, String> computeResources = airavata.getAvailableAppInterfaceComputeResources(appId);

http://git-wip-us.apache.org/repos/asf/airavata/blob/d61d33ee/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/FrameworkBootstrapping.java
----------------------------------------------------------------------
diff --git a/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/FrameworkBootstrapping.java
b/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/FrameworkBootstrapping.java
index 22a1608..61e0101 100644
--- a/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/FrameworkBootstrapping.java
+++ b/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/FrameworkBootstrapping.java
@@ -21,24 +21,118 @@
 
 package org.apache.airavata.testsuite.multitenantedairavata;
 
+import org.apache.airavata.testsuite.multitenantedairavata.utils.PropertyFileType;
+import org.apache.airavata.testsuite.multitenantedairavata.utils.PropertyReader;
+import org.apache.airavata.testsuite.multitenantedairavata.utils.TestFrameworkConstants;
+import org.apache.commons.cli.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStreamReader;
+import java.util.HashMap;
+import java.util.Map;
+
 public class FrameworkBootstrapping {
     private final static Logger logger = LoggerFactory.getLogger(FrameworkBootstrapping.class);
+    private static boolean runAll = false;
+    private static boolean regApps = false;
+    private static boolean expExec = false;
+    private static PropertyReader propertyReader;
+    private static Map<String, String> tokens;
+    private static ExperimentExecution experimentExecution;
 
     public static void main(String[] args) {
+        parseArguments(args);
         try {
             FrameworkSetup setup = FrameworkSetup.getInstance();
-            setup.getGatewayRegister().createGateways();
-            logger.info("Gateways created...");
-            setup.getGatewayRegister().registerSSHKeys();
-            logger.info("Registered SSH keys to each gateway...");
-            setup.getApplicationRegister().addApplications();
-            logger.info("Applications registered for each each gateway...");
+            propertyReader = new PropertyReader();
+
+            if (runAll){
+                setup.getGatewayRegister().createGateways();
+                logger.info("Gateways created...");
+                setup.getGatewayRegister().registerSSHKeys();
+                logger.info("Registered SSH keys to each gateway...");
+                tokens = readTokens();
+                setup.getApplicationRegister().addApplications();
+                logger.info("Applications registered for each each gateway...");
+                experimentExecution = new ExperimentExecution(setup.getAiravata(), tokens);
+                experimentExecution.createEchoExperiment();
+                experimentExecution.createAmberExperiment();
+                experimentExecution.launchExperiments();
+                experimentExecution.monitorExperiments();
+            }else if (regApps){
+                setup.getGatewayRegister().createGateways();
+                logger.info("Gateways created...");
+                setup.getGatewayRegister().registerSSHKeys();
+                logger.info("Registered SSH keys to each gateway...");
+                tokens = readTokens();
+                setup.getComputeResourceRegister().addComputeResources();
+                setup.getApplicationRegister().addApplications();
+                logger.info("Applications registered for each each gateway...");
+            }else if (expExec){
+                tokens = readTokens();
+                experimentExecution = new ExperimentExecution(setup.getAiravata(), tokens);
+                experimentExecution.createEchoExperiment();
+                experimentExecution.createAmberExperiment();
+                experimentExecution.launchExperiments();
+                experimentExecution.monitorExperiments();
+            }
         } catch (Exception e) {
             logger.error("Error occured while set up", e);
         }
+    }
+
+    public static Map<String, String> readTokens () throws Exception{
+        Map<String, String> tokens = new HashMap<String, String>();
+        String fileLocation = propertyReader.readProperty(TestFrameworkConstants.FrameworkPropertiesConstants.TOKEN_WRITE_LOCATION,
PropertyFileType.TEST_FRAMEWORK);
+        String fileName = TestFrameworkConstants.CredentialStoreConstants.TOKEN_FILE_NAME;
+        String path = fileLocation + File.separator + fileName;
+        File tokenFile = new File(path);
+        if (tokenFile.exists()){
+            FileInputStream fis = new FileInputStream(tokenFile);
+            //Construct BufferedReader from InputStreamReader
+            BufferedReader br = new BufferedReader(new InputStreamReader(fis));
+
+            String line;
+            while ((line = br.readLine()) != null) {
+                String[] strings = line.split(":");
+                tokens.put(strings[0], strings[1]);
+            }
+            br.close();
+        }else {
+            throw new Exception("Could not find token file.. Please run application registration
step if you haven't run it");
+        }
+        return tokens;
+    }
+
+    public static void parseArguments(String[] args) {
+        try{
+            Options options = new Options();
 
+            options.addOption("regApps", false , "Gateway ID");
+            options.addOption("expExec", false, "Experiment ID");
+            options.addOption("a", false, "Do application registration and experiment execution
together");
+
+            CommandLineParser parser = new PosixParser();
+            CommandLine cmd = parser.parse( options, args);
+            if (cmd.getOptions() == null || cmd.getOptions().length == 0){
+                logger.info("You have not specified any options. We assume you need to start
from the scratch...");
+                runAll= true;
+            }
+            if (cmd.hasOption("regApps")){
+                logger.info("Register Applications only...");
+                regApps = true;
+            }else if (cmd.hasOption("expExec")){
+                logger.info("Execute Experiments only...");
+                expExec = true;
+            }else {
+                runAll = true;
+            }
+        } catch (ParseException e) {
+            logger.error("Error while reading command line parameters" , e);
+        }
     }
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/d61d33ee/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/FrameworkSetup.java
----------------------------------------------------------------------
diff --git a/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/FrameworkSetup.java
b/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/FrameworkSetup.java
index d0666e4..306a601 100644
--- a/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/FrameworkSetup.java
+++ b/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/FrameworkSetup.java
@@ -28,6 +28,7 @@ import org.slf4j.LoggerFactory;
 public class FrameworkSetup {
     private static FrameworkSetup instance = new FrameworkSetup();
     private GatewayRegister gatewayRegister;
+    private ComputeResourceRegister computeResourceRegister;
     private ApplicationRegister applicationRegister;
     private Airavata.Client airavata;
     private final static Logger logger = LoggerFactory.getLogger(FrameworkSetup.class);
@@ -42,6 +43,7 @@ public class FrameworkSetup {
             this.airavata = airavataClient.getAiravataClient();
             gatewayRegister = new GatewayRegister(airavata);
             applicationRegister = new ApplicationRegister(airavata);
+            computeResourceRegister = new ComputeResourceRegister(airavata);
         } catch (Exception e) {
             logger.error("Error while creating airavata client instance", e);
         }
@@ -70,4 +72,12 @@ public class FrameworkSetup {
     public void setAiravata(Airavata.Client airavata) {
         this.airavata = airavata;
     }
+
+    public ComputeResourceRegister getComputeResourceRegister() {
+        return computeResourceRegister;
+    }
+
+    public void setComputeResourceRegister(ComputeResourceRegister computeResourceRegister)
{
+        this.computeResourceRegister = computeResourceRegister;
+    }
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/d61d33ee/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/GatewayRegister.java
----------------------------------------------------------------------
diff --git a/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/GatewayRegister.java
b/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/GatewayRegister.java
index f0fba59..ca5cce7 100644
--- a/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/GatewayRegister.java
+++ b/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/GatewayRegister.java
@@ -43,10 +43,7 @@ import org.apache.thrift.TException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
+import java.io.*;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -116,6 +113,11 @@ public class GatewayRegister {
 
     public void registerSSHKeys () throws Exception{
         try {
+            // write tokens to file
+            String tokenWriteLocation = propertyReader.readProperty(TestFrameworkConstants.FrameworkPropertiesConstants.TOKEN_WRITE_LOCATION,
PropertyFileType.TEST_FRAMEWORK);
+            String fileName = tokenWriteLocation + File.separator + TestFrameworkConstants.CredentialStoreConstants.TOKEN_FILE_NAME;
+
+            PrintWriter tokenWriter = new PrintWriter(fileName, "UTF-8");
             // credential store related functions are not in the current api, so need to
call credential store directly
             AiravataUtils.setExecutionAsClient();
             String jdbcURL = propertyReader.readProperty(TestFrameworkConstants.AiravataClientConstants.CS_JBDC_URL,
PropertyFileType.AIRAVATA_CLIENT);
@@ -149,7 +151,9 @@ public class GatewayRegister {
                 sshCredential.setPassphrase(keyPassword);
                 writer.writeCredentials(sshCredential);
                 tokenMap.put(gateway.getGatewayId(), token);
+                tokenWriter.println(gateway.getGatewayId() + ":" + token);
             }
+            tokenWriter.close();
         } catch (ClassNotFoundException e) {
             logger.error("Unable to find mysql driver", e);
             throw new Exception("Unable to find mysql driver",e);

http://git-wip-us.apache.org/repos/asf/airavata/blob/d61d33ee/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/LoadTester.java
----------------------------------------------------------------------
diff --git a/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/LoadTester.java
b/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/LoadTester.java
deleted file mode 100644
index b27b429..0000000
--- a/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/LoadTester.java
+++ /dev/null
@@ -1,50 +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.testsuite.multitenantedairavata;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.Map;
-
-public class LoadTester {
-    private final static Logger logger = LoggerFactory.getLogger(LoadTester.class);
-    public static void main(String[] args) {
-        try {
-            FrameworkSetup frameworkSetup = FrameworkSetup.getInstance();
-            Map<String, String> tokenMap = frameworkSetup.getGatewayRegister().getTokenMap();
-            Map<String, String> projectMap = frameworkSetup.getGatewayRegister().getProjectMap();
-            Map<String, String> appInterfaceMap = frameworkSetup.getApplicationRegister().getApplicationInterfaceListPerGateway();
-
-            ExperimentExecution experimentExecution = new ExperimentExecution(frameworkSetup.getAiravata(),tokenMap,
appInterfaceMap, projectMap);
-            experimentExecution.createAmberExperiment();
-            experimentExecution.createEchoExperiment();
-            experimentExecution.launchExperiments();
-            experimentExecution.monitorExperiments();
-        } catch (Exception e) {
-            logger.error("Error while submitting experiments", e);
-        }
-
-
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/d61d33ee/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/utils/TestFrameworkConstants.java
----------------------------------------------------------------------
diff --git a/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/utils/TestFrameworkConstants.java
b/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/utils/TestFrameworkConstants.java
index f64ce67..93991cd 100644
--- a/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/utils/TestFrameworkConstants.java
+++ b/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/utils/TestFrameworkConstants.java
@@ -46,11 +46,12 @@ public class TestFrameworkConstants {
         public static final String SSH_PRIKEY_LOCATION = "ssh.private.key.location";
         public static final String SSH_PWD = "ssh.password";
         public static final String SSH_USERNAME = "ssh.username";
+        public static final String TOKEN_WRITE_LOCATION = "token.file.location";
     }
 
     public static final class GatewayConstants {
-        public static final String GENERIC_GATEWAY_NAME = "testGateway";
-        public static final String GENERIC_GATEWAY_DOMAIN = ".airavata.org";
+        public static final String GENERIC_GATEWAY_NAME = "generic.gateway.name";
+        public static final String GENERIC_GATEWAY_DOMAIN = "generic.gateway.domain";
     }
 
     public static final class AppcatalogConstants {
@@ -94,6 +95,7 @@ public class TestFrameworkConstants {
     }
 
     public static final class CredentialStoreConstants {
+        public static final String TOKEN_FILE_NAME = "testFrameworkTokens";
 
     }
 


Mime
View raw message