You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by la...@apache.org on 2014/04/04 15:22:51 UTC
[1/4] Fixing the build to handle grid test cases
Repository: airavata
Updated Branches:
refs/heads/master a2dcc366b -> 9ab16b97e
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c555455/modules/security/pom.xml
----------------------------------------------------------------------
diff --git a/modules/security/pom.xml b/modules/security/pom.xml
index 2484ee8..bfe2a01 100644
--- a/modules/security/pom.xml
+++ b/modules/security/pom.xml
@@ -52,23 +52,4 @@
<scope>test</scope>
</dependency>
</dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>${surefire.version}</version>
- <configuration>
- <testSourceDirectory>${basedir}\src\test\java\</testSourceDirectory>
- </configuration>
- </plugin>
- </plugins>
- <testSourceDirectory>${project.basedir}/src/test/java</testSourceDirectory>
- <testOutputDirectory>${project.build.directory}/test-classes</testOutputDirectory>
- <testResources>
- <testResource>
- <directory>${project.basedir}/src/test/resources</directory>
- </testResource>
- </testResources>
- </build>
</project>
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c555455/modules/server/pom.xml
----------------------------------------------------------------------
diff --git a/modules/server/pom.xml b/modules/server/pom.xml
index a2cfdee..893ae79 100644
--- a/modules/server/pom.xml
+++ b/modules/server/pom.xml
@@ -51,24 +51,4 @@
<version>${project.version}</version>
</dependency>
</dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>${surefire.version}</version>
- <configuration>
- <testSourceDirectory>${basedir}\src\test\java\</testSourceDirectory>
- </configuration>
- </plugin>
- </plugins>
- <testSourceDirectory>${project.basedir}/src/test/java</testSourceDirectory>
- <testOutputDirectory>${project.build.directory}/test-classes</testOutputDirectory>
- <testResources>
- <testResource>
- <directory>${project.basedir}/src/test/resources</directory>
- </testResource>
- </testResources>
- </build>
</project>
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c555455/modules/workflow-model/workflow-model-component-node/pom.xml
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-model-component-node/pom.xml b/modules/workflow-model/workflow-model-component-node/pom.xml
index 378cda2..c901bd9 100644
--- a/modules/workflow-model/workflow-model-component-node/pom.xml
+++ b/modules/workflow-model/workflow-model-component-node/pom.xml
@@ -40,24 +40,6 @@
</properties>
</profile>
</profiles>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>${surefire.version}</version>
- <configuration>
- <includes>
- <include>**/*Suite.java</include>
- </includes>
- <excludes>
- <exclude>**/*Test.java</exclude>
- <exclude>**/*Tests.java</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </build>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c555455/modules/workflow-model/workflow-model-component/pom.xml
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-model-component/pom.xml b/modules/workflow-model/workflow-model-component/pom.xml
index a3069f8..0a08064 100644
--- a/modules/workflow-model/workflow-model-component/pom.xml
+++ b/modules/workflow-model/workflow-model-component/pom.xml
@@ -40,24 +40,7 @@
</properties>
</profile>
</profiles>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>${surefire.version}</version>
- <configuration>
- <includes>
- <include>**/*Suite.java</include>
- </includes>
- <excludes>
- <exclude>**/*Test.java</exclude>
- <exclude>**/*Tests.java</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </build>
+
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c555455/modules/workflow-model/workflow-model-core/pom.xml
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-model-core/pom.xml b/modules/workflow-model/workflow-model-core/pom.xml
index 905b4c5..a1334a6 100644
--- a/modules/workflow-model/workflow-model-core/pom.xml
+++ b/modules/workflow-model/workflow-model-core/pom.xml
@@ -40,24 +40,6 @@
</properties>
</profile>
</profiles>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>${surefire.version}</version>
- <configuration>
- <includes>
- <include>**/*Suite.java</include>
- </includes>
- <excludes>
- <exclude>**/*Test.java</exclude>
- <exclude>**/*Tests.java</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </build>
<dependencies>
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c555455/modules/xbaya-gui/pom.xml
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/pom.xml b/modules/xbaya-gui/pom.xml
index a3d11e2..0900523 100644
--- a/modules/xbaya-gui/pom.xml
+++ b/modules/xbaya-gui/pom.xml
@@ -79,23 +79,6 @@
</execution-->
</executions>
</plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.16</version>
- <configuration>
- <includes>
- <include>**/*Suite.java</include>
- </includes>
- <excludes>
- <exclude>**/*Test.java</exclude>
- <exclude>**/*Tests.java</exclude>
- </excludes>
- <additionalClasspathElements>
- <additionalClasspathElement>${project.build.directory}/samples/workflows</additionalClasspathElement>
- </additionalClasspathElements>
- </configuration>
- </plugin>
</plugins>
</build>
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c555455/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 91ae87a..f67c495 100644
--- a/pom.xml
+++ b/pom.xml
@@ -20,7 +20,6 @@
<groupId>org.apache</groupId>
<artifactId>apache</artifactId>
<version>13</version>
- <relativePath />
</parent>
<groupId>org.apache.airavata</groupId>
@@ -449,6 +448,9 @@
<!-- Integration tests are run using the fail-safe plugin in the module pom-->
<excludes>
<exclude>**/IT.java</exclude>
+ <exclude>**/*TestWithMyProxyAuth.java</exclude>
+ <exclude>**/*TestWithSSHAuth.java</exclude>
+ <exclude>**/*TestWithEC2Auth.java</exclude>
</excludes>
</configuration>
</plugin>
@@ -462,16 +464,102 @@
<module>modules/gfac</module>
<module>modules/ws-messenger</module>
<module>modules/workflow-model</module>
- <!--module>modules/xbaya-gui</module-->
<module>modules/commons</module>
<module>modules/registry</module>
<module>modules/airavata-client</module>
<module>modules/security</module>
<module>modules/credential-store</module>
- <!--module>modules/rest</module-->
<module>modules/orchestrator</module>
<module>tools</module>
+ <module>modules/server</module>
+ <module>modules/test-suite</module>
+ <module>modules/distribution</module>
+ <module>modules/integration-tests</module>
+ <!--module>modules/rest</module-->
<!--module>samples</module-->
+ <!--module>modules/xbaya-gui</module-->
+ </modules>
+ </profile>
+ <!--profile>
+ <id>gridTests</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-remote-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>process</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.5</version>
+ <executions>
+ <execution>
+ <id>copy-resources</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${basedir}/target/classes/META-INF</outputDirectory>
+ <resources>
+ <resource>
+ <directory>${basedir}/src/main/assembly/dist</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.3.2</version>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>${surefire.version}</version>
+ <configuration>
+ <failIfNoTests>false</failIfNoTests>
+ <skipTests>${skipTests}</skipTests>
+ <workingDirectory>${project.build.testOutputDirectory}</workingDirectory>
+ <excludes>
+ <exclude>**/IT.java</exclude>
+ </excludes>
+ <includes>
+ <include>**/*TestWithMyProxyAuth.java</include>
+ <include>**/*TestWithSSHAuth.java</include>
+ </includes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <module>airavata-api</module>
+ <module>modules/gfac</module>
+ <module>modules/ws-messenger</module>
+ <module>modules/workflow-model</module>
+ <module>modules/commons</module>
+ <module>modules/registry</module>
+ <module>modules/airavata-client</module>
+ <module>modules/security</module>
+ <module>modules/credential-store</module>
+ <module>modules/orchestrator</module>
+ <module>tools</module>
<module>modules/server</module>
<module>modules/test-suite</module>
<module>modules/distribution</module>
@@ -479,6 +567,178 @@
</modules>
</profile>
<profile>
+ <id>ec2Tests</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-remote-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>process</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.5</version>
+ <executions>
+ <execution>
+ <id>copy-resources</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${basedir}/target/classes/META-INF</outputDirectory>
+ <resources>
+ <resource>
+ <directory>${basedir}/src/main/assembly/dist</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.3.2</version>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>${surefire.version}</version>
+ <configuration>
+ <failIfNoTests>false</failIfNoTests>
+ <skipTests>${skipTests}</skipTests>
+ <workingDirectory>${project.build.testOutputDirectory}</workingDirectory>
+ <excludes>
+ <exclude>**/IT.java</exclude>
+ </excludes>
+ <includes>
+ <include>**/*TestEC2Auth.java</include>
+ </includes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <module>airavata-api</module>
+ <module>modules/gfac</module>
+ <module>modules/ws-messenger</module>
+ <module>modules/workflow-model</module>
+ <module>modules/commons</module>
+ <module>modules/registry</module>
+ <module>modules/airavata-client</module>
+ <module>modules/security</module>
+ <module>modules/credential-store</module>
+ <module>modules/orchestrator</module>
+ <module>tools</module>
+ <module>modules/server</module>
+ <module>modules/test-suite</module>
+ <module>modules/distribution</module>
+ <module>modules/integration-tests</module>
+ </modules>
+ </profile>
+ <profile>
+ <id>allHpcTests</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-remote-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>process</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.5</version>
+ <executions>
+ <execution>
+ <id>copy-resources</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${basedir}/target/classes/META-INF</outputDirectory>
+ <resources>
+ <resource>
+ <directory>${basedir}/src/main/assembly/dist</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.3.2</version>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>${surefire.version}</version>
+ <configuration>
+ <failIfNoTests>false</failIfNoTests>
+ <skipTests>${skipTests}</skipTests>
+ <workingDirectory>${project.build.testOutputDirectory}</workingDirectory>
+ <excludes>
+ <exclude>**/IT.java</exclude>
+ </excludes>
+ <includes>
+ <include>**/*TestWithMyProxyAuth.java</include>
+ <include>**/*TestWithSSHAuth.java</include>
+ <include>**/*TestWithEC2Auth.java</include>
+ </includes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <module>airavata-api</module>
+ <module>modules/gfac</module>
+ <module>modules/ws-messenger</module>
+ <module>modules/workflow-model</module>
+ <module>modules/commons</module>
+ <module>modules/registry</module>
+ <module>modules/airavata-client</module>
+ <module>modules/security</module>
+ <module>modules/credential-store</module>
+ <module>modules/orchestrator</module>
+ <module>tools</module>
+ <module>modules/server</module>
+ <module>modules/test-suite</module>
+ <module>modules/distribution</module>
+ <module>modules/integration-tests</module>
+ </modules>
+ </profile-->
+ <profile>
<id>pedantic</id>
<build>
<plugins>
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c555455/samples/provenance-registry-handler/pom.xml
----------------------------------------------------------------------
diff --git a/samples/provenance-registry-handler/pom.xml b/samples/provenance-registry-handler/pom.xml
index 418b068..273b5f7 100644
--- a/samples/provenance-registry-handler/pom.xml
+++ b/samples/provenance-registry-handler/pom.xml
@@ -23,28 +23,7 @@
<name>Provenance Registry Handler Sample</name>
<url>http://airavata.apache.org/</url>
- <!-- Edit the following properties. -->
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>${surefire.version}</version>
- <configuration>
- <includes>
- <include>**/*Suite.java</include>
- </includes>
- <excludes>
- <exclude>**/*Test.java</exclude>
- <exclude>**/*Tests.java</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
<dependencies>
-
<!-- AIRAVATA modules -->
<dependency>
<groupId>org.apache.airavata</groupId>
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c555455/tools/gsissh/pom.xml
----------------------------------------------------------------------
diff --git a/tools/gsissh/pom.xml b/tools/gsissh/pom.xml
index f420bbc..a62455b 100644
--- a/tools/gsissh/pom.xml
+++ b/tools/gsissh/pom.xml
@@ -107,17 +107,6 @@
</configuration>
</plugin>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <excludes>
- <exclude>**/ssh/**</exclude>
- </excludes>
- <forkMode>always</forkMode>
- <failIfNoTests>false</failIfNoTests>
- </configuration>
- </plugin>
- <plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xmlbeans-maven-plugin</artifactId>
<version>2.3.3</version>
@@ -148,7 +137,6 @@
</testResources>
</build>
-
<properties>
<jglobus.version>2.0.6</jglobus.version>
<surefire.version>2.12</surefire.version>
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c555455/tools/gsissh/src/test/java/org/apache/airavata/gsi/ssh/config/SCPFromTest.java
----------------------------------------------------------------------
diff --git a/tools/gsissh/src/test/java/org/apache/airavata/gsi/ssh/config/SCPFromTest.java b/tools/gsissh/src/test/java/org/apache/airavata/gsi/ssh/config/SCPFromTest.java
deleted file mode 100644
index ec41f93..0000000
--- a/tools/gsissh/src/test/java/org/apache/airavata/gsi/ssh/config/SCPFromTest.java
+++ /dev/null
@@ -1,74 +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.gsi.ssh.config;
-
-import java.io.File;
-
-import org.apache.airavata.gsi.ssh.api.ServerInfo;
-import org.apache.airavata.gsi.ssh.api.authentication.GSIAuthenticationInfo;
-import org.apache.airavata.gsi.ssh.impl.authentication.MyProxyAuthenticationInfo;
-import org.apache.airavata.gsi.ssh.util.SSHUtils;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Test;
-
-public class SCPFromTest {
- private String myProxyUserName;
- private String myProxyPassword;
- private String certificateLocation;
- private String lFilePath;
- private String rFilePath;
-
- @BeforeTest
- public void setUp() throws Exception {
-// System.setProperty("myproxy.user", "ogce");
-// System.setProperty("myproxy.password", "");
-// System.setProperty("basedir", "/Users/lahirugunathilake/work/airavata/sandbox/gsissh");
- myProxyUserName = System.getProperty("myproxy.user");
- myProxyPassword = System.getProperty("myproxy.password");
- String pomDirectory = System.getProperty("basedir");
-
- File pomFileDirectory = new File(pomDirectory);
-
- System.out.println("POM directory ----------------- " + pomFileDirectory.getAbsolutePath());
-
- certificateLocation = pomFileDirectory.getAbsolutePath() + "/certificates";
-
-
- lFilePath = pomDirectory + File.separator + "pom.xml";
- rFilePath = "/tmp/";
- }
-
-
- @Test
- public void testExecuteCommand() throws Exception {
- // Create authentication
- GSIAuthenticationInfo authenticationInfo
- = new MyProxyAuthenticationInfo(myProxyUserName, myProxyPassword, "myproxy.teragrid.org",
- 7512, 17280000,certificateLocation);
- ServerInfo serverInfo = new ServerInfo("ogce" ,"trestles.sdsc.edu");
- SSHUtils SSHUtils = new SSHUtils(serverInfo, authenticationInfo, this.certificateLocation, new ConfigReader());
- SSHUtils.scpTo(rFilePath, lFilePath);
- Thread.sleep(1000);
- SSHUtils.scpFrom(File.separator + "tmp" + File.separator + "pom.xml", System.getProperty("basedir"));
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c555455/tools/gsissh/src/test/java/org/apache/airavata/gsi/ssh/config/SCPToTest.java
----------------------------------------------------------------------
diff --git a/tools/gsissh/src/test/java/org/apache/airavata/gsi/ssh/config/SCPToTest.java b/tools/gsissh/src/test/java/org/apache/airavata/gsi/ssh/config/SCPToTest.java
deleted file mode 100644
index 8a4f94e..0000000
--- a/tools/gsissh/src/test/java/org/apache/airavata/gsi/ssh/config/SCPToTest.java
+++ /dev/null
@@ -1,75 +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.gsi.ssh.config;
-
-import org.apache.airavata.gsi.ssh.api.authentication.GSIAuthenticationInfo;
-import org.apache.airavata.gsi.ssh.util.SSHUtils;
-import org.apache.airavata.gsi.ssh.api.ServerInfo;
-import org.apache.airavata.gsi.ssh.impl.authentication.MyProxyAuthenticationInfo;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Test;
-
-import java.io.File;
-
-public class SCPToTest {
- private String myProxyUserName;
- private String myProxyPassword;
- private String certificateLocation;
- private String lFilePath;
- private String rFilePath;
-
- @BeforeTest
- public void setUp() throws Exception {
-// System.setProperty("myproxy.user", "ogce");
-// System.setProperty("myproxy.password", "");
-// System.setProperty("basedir", "/Users/lahirugunathilake/work/airavata/sandbox/gsissh");
- myProxyUserName = System.getProperty("myproxy.user");
- myProxyPassword = System.getProperty("myproxy.password");
-
- String pomDirectory = System.getProperty("basedir");
-
- File pomFileDirectory = new File(pomDirectory);
-
- System.out.println("POM directory ----------------- " + pomFileDirectory.getAbsolutePath());
-
- certificateLocation = pomFileDirectory.getAbsolutePath() + "/certificates";
-
- if (myProxyUserName == null || myProxyPassword == null) {
- System.out.println(">>>>>> Please run tests with my proxy user name and password. " +
- "E.g :- mvn clean install -Dmyproxy.user=xxx -Dmyproxy.password=xxx <<<<<<<");
- throw new Exception("Need my proxy user name password to run tests.");
- }
- lFilePath = pomDirectory + File.separator + "pom.xml";
- rFilePath = "/tmp";
- }
-
-
- @Test
- public void testExecuteCommand() throws Exception {
- // Create authentication
- GSIAuthenticationInfo authenticationInfo
- = new MyProxyAuthenticationInfo(myProxyUserName, myProxyPassword, "myproxy.teragrid.org",
- 7512, 17280000,certificateLocation);
- ServerInfo serverInfo = new ServerInfo("ogce" ,"trestles.sdsc.edu");
- SSHUtils scpTo = new SSHUtils(serverInfo,authenticationInfo,this.certificateLocation,new ConfigReader());
- scpTo.scpTo(rFilePath, lFilePath);
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c555455/tools/gsissh/src/test/java/org/apache/airavata/gsi/ssh/impl/DefaultSSHApiTest.java
----------------------------------------------------------------------
diff --git a/tools/gsissh/src/test/java/org/apache/airavata/gsi/ssh/impl/DefaultSSHApiTest.java b/tools/gsissh/src/test/java/org/apache/airavata/gsi/ssh/impl/DefaultSSHApiTest.java
deleted file mode 100644
index eb8d1f2..0000000
--- a/tools/gsissh/src/test/java/org/apache/airavata/gsi/ssh/impl/DefaultSSHApiTest.java
+++ /dev/null
@@ -1,433 +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.gsi.ssh.impl;
-
-import junit.framework.Assert;
-import org.apache.airavata.gsi.ssh.api.*;
-import org.apache.airavata.gsi.ssh.api.authentication.GSIAuthenticationInfo;
-import org.apache.airavata.gsi.ssh.api.job.JobDescriptor;
-import org.apache.airavata.gsi.ssh.config.ConfigReader;
-import org.apache.airavata.gsi.ssh.impl.authentication.MyProxyAuthenticationInfo;
-import org.apache.airavata.gsi.ssh.util.CommonUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.AssertJUnit;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Test;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-public class DefaultSSHApiTest {
- private static final Logger log = LoggerFactory.getLogger(PBSCluster.class);
- private String myProxyUserName;
- private String myProxyPassword;
- private String certificateLocation;
- private String pbsFilePath;
- private String workingDirectory;
- private String slurmWorkingDirectory;
- private String jobID;
-
- @BeforeTest
- public void setUp() throws Exception {
- System.setProperty("myproxy.user", "ogce");
- System.setProperty("myproxy.password", "");
- System.setProperty("basedir", "/Users/lahirugunathilake/Downloads");
- System.setProperty("gsi.working.directory", "/home/ogce");
- myProxyUserName = System.getProperty("myproxy.user");
- myProxyPassword = System.getProperty("myproxy.password");
- workingDirectory = System.getProperty("gsi.working.directory");
- slurmWorkingDirectory = "/home1/01437/ogce";
- String pomDirectory = System.getProperty("basedir");
-
- File pomFileDirectory = new File(pomDirectory);
-
- System.out.println("POM directory ----------------- " + pomFileDirectory.getAbsolutePath());
-
- certificateLocation = pomFileDirectory.getAbsolutePath() + "/certificates";
-
-
- if (myProxyUserName == null || myProxyPassword == null || workingDirectory == null) {
- System.out.println(">>>>>> Please run tests with my proxy user name and password. " +
- "E.g :- mvn clean install -Dmyproxy.user=xxx -Dmyproxy.password=xxx -Dgsi.working.directory=/path<<<<<<<");
- throw new Exception("Need my proxy user name password to run tests.");
- }
- }
-
- public void tearDown() throws Exception {
- }
-
- @Test
- public void testExecuteCommand() throws Exception {
- // Create authentication
- GSIAuthenticationInfo authenticationInfo
- = new MyProxyAuthenticationInfo(myProxyUserName, myProxyPassword, "myproxy.teragrid.org",
- 7512, 17280000, certificateLocation);
-
- // Create command
- CommandInfo commandInfo = new RawCommandInfo("/bin/ls");
-
- // Server info
- ServerInfo serverInfo = new ServerInfo("ogce", "trestles.sdsc.edu");
-
- // Output
- CommandOutput commandOutput = new SystemCommandOutput();
-
- // Execute command
- CommandExecutor.executeCommand(commandInfo, serverInfo, authenticationInfo, commandOutput, new ConfigReader());
- }
-
-
- @Test
- public void testPBSAsync() throws Exception {
- // Create authentication
- GSIAuthenticationInfo authenticationInfo
- = new MyProxyAuthenticationInfo(myProxyUserName, myProxyPassword, "myproxy.teragrid.org",
- 7512, 17280000, certificateLocation);
-
- // Server info
- ServerInfo serverInfo = new ServerInfo("ogce", "trestles.sdsc.edu");
-
-
- Cluster pbsCluster = new PBSCluster(serverInfo, authenticationInfo, CommonUtils.getPBSJobManager("/opt/torque/bin/"));
-
-
- // Execute command
- System.out.println("Target PBS file path: " + workingDirectory);
- // constructing the job object
- JobDescriptor jobDescriptor = new JobDescriptor();
- jobDescriptor.setWorkingDirectory(workingDirectory);
- jobDescriptor.setShellName("/bin/bash");
- jobDescriptor.setJobName("GSI_SSH_SLEEP_JOB");
- jobDescriptor.setExecutablePath("/bin/echo");
- jobDescriptor.setAllEnvExport(true);
- jobDescriptor.setMailOptions("n");
- jobDescriptor.setStandardOutFile(workingDirectory + File.separator + "application.out");
- jobDescriptor.setStandardErrorFile(workingDirectory + File.separator + "application.err");
- jobDescriptor.setNodes(1);
- jobDescriptor.setProcessesPerNode(1);
- jobDescriptor.setQueueName("normal");
- jobDescriptor.setMaxWallTime("60");
- jobDescriptor.setAcountString("sds128");
- List<String> inputs = new ArrayList<String>();
- inputs.add("Hello World");
- jobDescriptor.setInputValues(inputs);
- //finished construction of job object
- System.out.println(jobDescriptor.toXML());
- jobID = pbsCluster.submitBatchJob(jobDescriptor);
- System.out.println("JobID returned : " + jobID);
-
-// Cluster cluster = sshApi.getCluster(serverInfo, authenticationInfo);
- Thread.sleep(1000);
- JobDescriptor jobById = pbsCluster.getJobDescriptorById(jobID);
-
- //printing job data got from previous call
- AssertJUnit.assertEquals(jobById.getJobId(), jobID);
- System.out.println(jobById.getAcountString());
- System.out.println(jobById.getAllEnvExport());
- System.out.println(jobById.getCompTime());
- System.out.println(jobById.getExecutablePath());
- System.out.println(jobById.getEllapsedTime());
- System.out.println(jobById.getQueueName());
- System.out.println(jobById.getExecuteNode());
- System.out.println(jobById.getJobName());
- System.out.println(jobById.getCTime());
- System.out.println(jobById.getSTime());
- System.out.println(jobById.getMTime());
- System.out.println(jobById.getCompTime());
- System.out.println(jobById.getOwner());
- System.out.println(jobById.getQTime());
- System.out.println(jobById.getUsedCPUTime());
- System.out.println(jobById.getUsedMemory());
- System.out.println(jobById.getVariableList());
- }
-
- @Test
- public void testSLURMAsync() throws Exception {
- // Create authentication
- GSIAuthenticationInfo authenticationInfo
- = new MyProxyAuthenticationInfo(myProxyUserName, myProxyPassword, "myproxy.teragrid.org",
- 7512, 17280000, certificateLocation);
-
- // Server info
- ServerInfo serverInfo = new ServerInfo("ogce", "stampede.tacc.xsede.org");
- serverInfo.setPort(2222);
-
- Cluster pbsCluster = new PBSCluster(serverInfo, authenticationInfo, CommonUtils.getSLURMJobManager("/usr/bin/"));
-
-
- // Execute command
- System.out.println("Target SLURM file path: " + slurmWorkingDirectory);
- // constructing the job object
- JobDescriptor jobDescriptor = new JobDescriptor();
- jobDescriptor.setWorkingDirectory(slurmWorkingDirectory);
- jobDescriptor.setShellName("/bin/sh");
- jobDescriptor.setJobName("GSI_SSH_SLEEP_JOB");
- jobDescriptor.setExecutablePath("/bin/echo");
- jobDescriptor.setAllEnvExport(true);
- jobDescriptor.setMailOptions("n");
- jobDescriptor.setStandardOutFile("" + File.separator + "application.out");
- jobDescriptor.setStandardErrorFile("/home1/01437/ogce" + File.separator + "application.err");
- jobDescriptor.setNodes(1);
- jobDescriptor.setProcessesPerNode(1);
- jobDescriptor.setQueueName("normal");
- jobDescriptor.setMaxWallTime("60");
- jobDescriptor.setAcountString("TG-STA110014S");
- jobDescriptor.setJobSubmitter("sbatch");
- List<String> inputs = new ArrayList<String>();
- inputs.add("Hello World");
- jobDescriptor.setInputValues(inputs);
- //finished construction of job object
- System.out.println(jobDescriptor.toXML());
- jobID = pbsCluster.submitBatchJob(jobDescriptor);
- System.out.println("JobID returned : " + jobID);
-
-// Cluster cluster = sshApi.getCluster(serverInfo, authenticationInfo);
-// Thread.sleep(1000);
-
- JobDescriptor jobById = pbsCluster.getJobDescriptorById(jobID);
-
- //printing job data got from previous call
- AssertJUnit.assertEquals(jobById.getJobId(), jobID);
- System.out.println(jobById.getAcountString());
- System.out.println(jobById.getAllEnvExport());
- System.out.println(jobById.getCompTime());
- System.out.println(jobById.getExecutablePath());
- System.out.println(jobById.getEllapsedTime());
- System.out.println(jobById.getQueueName());
- System.out.println(jobById.getExecuteNode());
- System.out.println(jobById.getJobName());
- System.out.println(jobById.getCTime());
- System.out.println(jobById.getSTime());
- System.out.println(jobById.getMTime());
- System.out.println(jobById.getCompTime());
- System.out.println(jobById.getOwner());
- System.out.println(jobById.getQTime());
- System.out.println(jobById.getUsedCPUTime());
- System.out.println(jobById.getUsedMemory());
- System.out.println(jobById.getVariableList());
- }
-
-
- @Test
- public void testGetCluster() throws Exception {
-// GSIAuthenticationInfo authenticationInfo
-// = new MyProxyAuthenticationInfo(myProxyUserName, myProxyPassword, "myproxy.teragrid.org",
-// 7512, 17280000);
-// // Server info
-// ServerInfo serverInfo = new ServerInfo("ogce", "trestles.sdsc.edu");
-// // Get the API
-// SSHApi sshApi = SSHApiFactory.createSSHApi(this.certificateLocation);
-// Cluster cluster = sshApi.getCluster(serverInfo, authenticationInfo);
-// System.out.println(cluster.getNodes()[0].getName());
-// System.out.println(cluster.getNodes()[0].getNp());
-// System.out.println(cluster.getNodes()[0].getState());
-// System.out.println(cluster.getNodes()[0].getCores()[0].getId());
-// System.out.println(cluster.getNodes()[0].getName());
-
- }
-
-
- @Test
- public void testsubmitAsyncJobWithFailure() throws Exception {
- // Create authentication
- GSIAuthenticationInfo authenticationInfo
- = new MyProxyAuthenticationInfo(myProxyUserName, myProxyPassword, "myproxy.teragrid.org",
- 7512, 17280000, certificateLocation);
-
- // Server info
- ServerInfo serverInfo = new ServerInfo("ogce", "trestles.sdsc.edu");
-
- Cluster pbsCluster = new PBSCluster(serverInfo, authenticationInfo, CommonUtils.getPBSJobManager("/opt/torque/bin/"));
-
- // Execute command
- System.out.println("Target PBS file path: " + workingDirectory);
- System.out.println("Local PBS File path: " + pbsFilePath);
- String workingDirectory = File.separator + "home" + File.separator + "ogce" + File.separator + "gsissh";
- JobDescriptor jobDescriptor = new JobDescriptor();
- jobDescriptor.setWorkingDirectory(workingDirectory);
- jobDescriptor.setShellName("/bin/bash");
- jobDescriptor.setJobName("GSI_SSH_SLEEP_JOB");
- jobDescriptor.setExecutablePath("/bin/sleep");
- jobDescriptor.setAllEnvExport(true);
- jobDescriptor.setMailOptions("n");
- jobDescriptor.setStandardOutFile(workingDirectory + File.separator + "application.out");
- jobDescriptor.setStandardErrorFile(workingDirectory + File.separator + "application.err");
- jobDescriptor.setNodes(1);
- jobDescriptor.setProcessesPerNode(100);
- jobDescriptor.setQueueName("normal");
- jobDescriptor.setMaxWallTime("60");
- jobDescriptor.setAcountString("sds128");
- List<String> inputs = new ArrayList<String>();
- inputs.add("Hello World");
- jobDescriptor.setInputValues(inputs);
- System.out.println(jobDescriptor.toXML());
- try {
- String jobID = pbsCluster.submitBatchJob(jobDescriptor);
- System.out.println("JobID returned : " + jobID);
- } catch (SSHApiException e) {
- System.out.println(e.getMessage());
- }
- }
-
- @Test
- public void testSubmitAsyncJobWithListener() throws Exception {
- // Create authentication
- GSIAuthenticationInfo authenticationInfo
- = new MyProxyAuthenticationInfo(myProxyUserName, myProxyPassword, "myproxy.teragrid.org",
- 7512, 17280000, certificateLocation);
-
- // Server info
- ServerInfo serverInfo = new ServerInfo("ogce", "trestles.sdsc.edu");
-
-
- Cluster pbsCluster = new PBSCluster(serverInfo, authenticationInfo, CommonUtils.getPBSJobManager("/opt/torque/bin/"));
-
-
- // Execute command
- System.out.println("Target PBS file path: " + workingDirectory);
- System.out.println("Local PBS File path: " + pbsFilePath);
- String workingDirectory = File.separator + "home" + File.separator + "ogce" + File.separator + "gsissh";
- JobDescriptor jobDescriptor = new JobDescriptor();
- jobDescriptor.setWorkingDirectory(workingDirectory);
- jobDescriptor.setShellName("/bin/bash");
- jobDescriptor.setJobName("GSI_SSH_SLEEP_JOB");
- jobDescriptor.setExecutablePath("/bin/sleep");
- jobDescriptor.setAllEnvExport(true);
- jobDescriptor.setMailOptions("n");
- jobDescriptor.setStandardOutFile(workingDirectory + File.separator + "application.out");
- jobDescriptor.setStandardErrorFile(workingDirectory + File.separator + "application.err");
- jobDescriptor.setNodes(1);
- jobDescriptor.setProcessesPerNode(1);
-// jobDescriptor.setMaxWallTime("1:00:00");
- jobDescriptor.setQueueName("normal");
- jobDescriptor.setAcountString("sds128");
- List<String> inputs = new ArrayList<String>();
- inputs.add("1000");
- jobDescriptor.setInputValues(inputs);
- System.out.println(jobDescriptor.toXML());
- DefaultJobSubmissionListener listener = new DefaultJobSubmissionListener();
- String jobID = pbsCluster.submitBatchJob(jobDescriptor);
- try {
-// // Wait 5 seconds to start the first poll, this is hard coded, user doesn't have
-// // to configure this.
-// Thread.sleep(5000);
-// } catch (InterruptedException e) {
-// log.error("Error during job status monitoring");
-// throw new SSHApiException("Error during job status monitoring", e);
-// }
-// // Get the job status first
-// try {
-////
-//// Thread t = new Thread() {
-//// @Override
-//// public void run() {
-//// try {
- // p
- JobStatus jobStatus = pbsCluster.getJobStatus(jobID);
- while (true) {
- while (!jobStatus.equals(JobStatus.C.toString())) {
- if (!jobStatus.equals(listener.getJobStatus().toString())) {
- listener.setJobStatus(jobStatus);
- listener.statusChanged(jobStatus);
- }
- Thread.sleep(60000);
-
- jobStatus = pbsCluster.getJobStatus(jobID);
- }
- //Set the job status to Complete
- listener.setJobStatus(JobStatus.C);
- listener.statusChanged(jobStatus);
- break;
- }
-// } catch (InterruptedException e) {
-// log.error("Error listening to the submitted job", e);
-// } catch (SSHApiException e) {
-// log.error("Error listening to the submitted job", e);
-// }
-// }
-// };
- // This thread runs until the program termination, so that use can provide
-// // any action in onChange method of the listener, without worrying for waiting in the caller thread.
- //t.setDaemon(true);
-// t.start();
- } catch (Exception e) {
- log.error("Error during job status monitoring");
- throw new SSHApiException("Error during job status monitoring", e);
- }
- while (!listener.isJobDone()) {
- Thread.sleep(10000);
- }
- }
-
- @Test
- public void testJobCancel() throws Exception {
- // Create authentication
- GSIAuthenticationInfo authenticationInfo
- = new MyProxyAuthenticationInfo(myProxyUserName, myProxyPassword, "myproxy.teragrid.org",
- 7512, 17280000, certificateLocation);
-
- // Server info
- ServerInfo serverInfo = new ServerInfo("ogce", "trestles.sdsc.edu");
-
-
- Cluster pbsCluster = new PBSCluster(serverInfo, authenticationInfo, CommonUtils.getPBSJobManager("/opt/torque/bin/"));
-
-
- // Execute command
- System.out.println("Target PBS file path: " + workingDirectory);
- System.out.println("Local PBS File path: " + pbsFilePath);
- String workingDirectory = File.separator + "home" + File.separator + "ogce" + File.separator + "gsissh";
- JobDescriptor jobDescriptor = new JobDescriptor();
- jobDescriptor.setWorkingDirectory(workingDirectory);
- jobDescriptor.setShellName("/bin/bash");
- jobDescriptor.setJobName("GSI_SSH_SLEEP_JOB");
- jobDescriptor.setExecutablePath("/bin/sleep");
- jobDescriptor.setAllEnvExport(true);
- jobDescriptor.setMailOptions("n");
- jobDescriptor.setStandardOutFile(workingDirectory + File.separator + "application.out");
- jobDescriptor.setStandardErrorFile(workingDirectory + File.separator + "application.err");
- jobDescriptor.setNodes(1);
- jobDescriptor.setProcessesPerNode(1);
- jobDescriptor.setMaxWallTime("60");
- jobDescriptor.setQueueName("normal");
- jobDescriptor.setAcountString("sds128");
- List<String> inputs = new ArrayList<String>();
- inputs.add("1000");
- jobDescriptor.setInputValues(inputs);
- System.out.println(jobDescriptor.toXML());
- String jobID = pbsCluster.submitBatchJob(jobDescriptor);
- System.out.println("Job submitted to successfully : " + jobID);
- JobDescriptor jobById = pbsCluster.getJobDescriptorById(jobID);
- if (!CommonUtils.isJobFinished(jobById)) {
- JobDescriptor job = pbsCluster.cancelJob(jobID);
- if (CommonUtils.isJobFinished(job)) {
- Assert.assertTrue(true);
- } else {
- Assert.assertTrue(true);
- }
- }
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c555455/tools/gsissh/src/test/java/org/apache/airavata/gsi/ssh/impl/VanilaSSHTest.java
----------------------------------------------------------------------
diff --git a/tools/gsissh/src/test/java/org/apache/airavata/gsi/ssh/impl/VanilaSSHTest.java b/tools/gsissh/src/test/java/org/apache/airavata/gsi/ssh/impl/VanilaSSHTest.java
deleted file mode 100644
index 0f4a205..0000000
--- a/tools/gsissh/src/test/java/org/apache/airavata/gsi/ssh/impl/VanilaSSHTest.java
+++ /dev/null
@@ -1,220 +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.gsi.ssh.impl;
-
-import org.apache.airavata.gsi.ssh.api.*;
-import org.apache.airavata.gsi.ssh.api.authentication.AuthenticationInfo;
-import org.apache.airavata.gsi.ssh.api.job.JobDescriptor;
-import org.apache.airavata.gsi.ssh.config.ConfigReader;
-import org.apache.airavata.gsi.ssh.impl.authentication.DefaultPasswordAuthenticationInfo;
-import org.apache.airavata.gsi.ssh.impl.authentication.DefaultPublicKeyFileAuthentication;
-import org.apache.airavata.gsi.ssh.util.CommonUtils;
-import org.testng.AssertJUnit;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Test;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.UUID;
-
-public class VanilaSSHTest {
-
- private String userName;
- private String password;
- private String passPhrase;
- private String hostName;
- private String workingDirectory;
- private String privateKeyPath;
- private String publicKeyPath;
-
- @BeforeTest
- public void setUp() throws Exception {
- this.hostName = "bigred2.uits.iu.edu";
-
-// this.userName = System.setProperty("my.ssh.user", "lginnali");
-// this.password = System.setProperty("my.ssh.password", "");
-// this.workingDirectory = System.setProperty("working.directory", "/N/u/lginnali/BigRed2/myjob");
-// System.setProperty("basedir","/Users/lahirugunathilake/work/airavata/sandbox/gsissh");
- this.userName = System.getProperty("my.ssh.user");
- this.password = System.getProperty("my.ssh.password");
- this.privateKeyPath = System.getProperty("my.private.key.path");
- this.publicKeyPath = System.getProperty("my.public.key.path");
- this.passPhrase = System.getProperty("my.ssh.user.pass.phrase");
- this.workingDirectory = System.getProperty("ssh.working.directory");
-
- System.out.println();
-
-
- if (this.userName == null || (this.userName != null && this.password == null)
- || (this.password==null && (this.publicKeyPath == null || this.privateKeyPath == null)) || this.workingDirectory == null) {
- System.out.println("########### In order to test you have to either username password or private,public keys");
- System.out.println("Use -Dmy.ssh.user=xxx -Dmy.ssh.user.password=yyy -Dmy.ssh.user.pass.phrase=zzz " +
- "-Dmy.private.key.path -Dmy.public.key.path -Dssh.working.directory ");
- }
- }
-
-
- @Test
- public void testSimpleCommand1() throws Exception {
-
- System.out.println("Starting vanila SSH test ....");
- AuthenticationInfo authenticationInfo = null;
- if (password != null) {
- authenticationInfo = new DefaultPasswordAuthenticationInfo(this.password);
- } else {
- new DefaultPublicKeyFileAuthentication(this.publicKeyPath, this.privateKeyPath,
- this.passPhrase);
- }
-
- // Create command
- CommandInfo commandInfo = new RawCommandInfo("/opt/torque/torque-4.2.3.1/bin/qstat");
-
- // Server info
- ServerInfo serverInfo = new ServerInfo(this.userName, this.hostName);
-
- // Output
- CommandOutput commandOutput = new SystemCommandOutput();
-
- // Execute command
- CommandExecutor.executeCommand(commandInfo, serverInfo, authenticationInfo, commandOutput, new ConfigReader());
-
-
- }
-
-
- @Test
- public void testSimplePBSJob() throws Exception {
-
- AuthenticationInfo authenticationInfo = null;
- if (password != null) {
- authenticationInfo = new DefaultPasswordAuthenticationInfo(this.password);
- } else {
- new DefaultPublicKeyFileAuthentication(this.publicKeyPath, this.privateKeyPath,
- this.passPhrase);
- }
- // Server info
- ServerInfo serverInfo = new ServerInfo(this.userName, this.hostName);
- Cluster pbsCluster = new PBSCluster(serverInfo, authenticationInfo, CommonUtils.getPBSJobManager("/opt/torque/torque-4.2.3.1/bin/"));
-
- String date = new Date().toString();
- date = date.replaceAll(" ", "_");
- date = date.replaceAll(":", "_");
-
- String pomFile = System.getProperty("basedir") + File.separator + "pom.xml";
-
- workingDirectory = workingDirectory + File.separator
- + date + "_" + UUID.randomUUID();
- pbsCluster.makeDirectory(workingDirectory);
- Thread.sleep(1000);
- pbsCluster.makeDirectory(workingDirectory + File.separator + "inputs");
- Thread.sleep(1000);
- pbsCluster.makeDirectory(workingDirectory + File.separator + "outputs");
-
-
- // doing file transfer to the remote resource
- String remoteLocation = workingDirectory + File.separator + "inputs";
- pbsCluster.scpTo(remoteLocation, pomFile);
-
- int i = pomFile.lastIndexOf(File.separator);
- String fileName = pomFile.substring(i + 1);
- // constructing the job object
- JobDescriptor jobDescriptor = new JobDescriptor();
- jobDescriptor.setWorkingDirectory(workingDirectory);
- jobDescriptor.setShellName("/bin/bash");
- jobDescriptor.setJobName("GSI_SSH_SLEEP_JOB");
- jobDescriptor.setExecutablePath("/bin/echo");
- jobDescriptor.setAllEnvExport(true);
- jobDescriptor.setMailOptions("n");
- jobDescriptor.setStandardOutFile(workingDirectory + File.separator + "application.out");
- jobDescriptor.setStandardErrorFile(workingDirectory + File.separator + "application.err");
- jobDescriptor.setNodes(1);
- jobDescriptor.setProcessesPerNode(1);
- jobDescriptor.setQueueName("normal");
- jobDescriptor.setMaxWallTime("5");
- jobDescriptor.setJobSubmitter("aprun -n 1");
- List<String> inputs = new ArrayList<String>();
- inputs.add(remoteLocation + File.separator + fileName);
- jobDescriptor.setInputValues(inputs);
- //finished construction of job object
- System.out.println(jobDescriptor.toXML());
- String jobID = pbsCluster.submitBatchJob(jobDescriptor);
- System.out.println("JobID returned : " + jobID);
-
-// Cluster cluster = sshApi.getCluster(serverInfo, authenticationInfo);
- Thread.sleep(1000);
- JobDescriptor jobById = pbsCluster.getJobDescriptorById(jobID);
-
- //printing job data got from previous call
- AssertJUnit.assertEquals(jobById.getJobId(), jobID);
- System.out.println(jobById.getAcountString());
- System.out.println(jobById.getAllEnvExport());
- System.out.println(jobById.getCompTime());
- System.out.println(jobById.getExecutablePath());
- System.out.println(jobById.getEllapsedTime());
- System.out.println(jobById.getQueueName());
- System.out.println(jobById.getExecuteNode());
- System.out.println(jobById.getJobName());
- System.out.println(jobById.getCTime());
- System.out.println(jobById.getSTime());
- System.out.println(jobById.getMTime());
- System.out.println(jobById.getCompTime());
- System.out.println(jobById.getOwner());
- System.out.println(jobById.getQTime());
- System.out.println(jobById.getUsedCPUTime());
- System.out.println(jobById.getUsedMemory());
- System.out.println(jobById.getVariableList());
- }
-
- @Test
- public void testSCPFrom() throws Exception {
-
- AuthenticationInfo authenticationInfo = null;
- if (password != null) {
- authenticationInfo = new DefaultPasswordAuthenticationInfo(this.password);
- } else {
- new DefaultPublicKeyFileAuthentication(this.publicKeyPath, this.privateKeyPath,
- this.passPhrase);
- }
- // Server info
- ServerInfo serverInfo = new ServerInfo(this.userName, this.hostName);
- Cluster pbsCluster = new PBSCluster(serverInfo, authenticationInfo, CommonUtils.getPBSJobManager("/opt/torque/torque-4.2.3.1/bin/"));
-
- String date = new Date().toString();
- date = date.replaceAll(" ", "_");
- date = date.replaceAll(":", "_");
-
- String pomFile = System.getProperty("basedir") + File.separator + "pom.xml";
-
- // Constructing theworking directory for demonstration and creating directories in the remote
- // resource
- workingDirectory = workingDirectory + File.separator
- + date + "_" + UUID.randomUUID();
- pbsCluster.makeDirectory(workingDirectory);
- pbsCluster.scpTo(workingDirectory, pomFile);
- Thread.sleep(1000);
- pbsCluster.scpFrom(workingDirectory + File.separator + "pom.xml", System.getProperty("basedir"));
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c555455/tools/job-monitor/pom.xml
----------------------------------------------------------------------
diff --git a/tools/job-monitor/pom.xml b/tools/job-monitor/pom.xml
index f782dff..4fc6ced 100644
--- a/tools/job-monitor/pom.xml
+++ b/tools/job-monitor/pom.xml
@@ -141,15 +141,6 @@
<build>
<plugins>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skip>false</skip>
- <forkMode>always</forkMode>
- <failIfNoTests>false</failIfNoTests>
- </configuration>
- </plugin>
- <plugin>
<groupId>org.jsonschema2pojo</groupId>
<artifactId>jsonschema2pojo-maven-plugin</artifactId>
<version>0.4.0</version>
[2/4] Fixing the build to handle grid test cases
Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c555455/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/ParamChemTest.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/ParamChemTest.java b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/ParamChemTest.java
deleted file mode 100644
index 5e8d1fa..0000000
--- a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/ParamChemTest.java
+++ /dev/null
@@ -1,306 +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.core.gfac.services.impl;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
-import java.util.UUID;
-
-import org.apache.airavata.commons.gfac.type.ActualParameter;
-import org.apache.airavata.commons.gfac.type.ApplicationDescription;
-import org.apache.airavata.commons.gfac.type.HostDescription;
-import org.apache.airavata.commons.gfac.type.ServiceDescription;
-import org.apache.airavata.gfac.GFacConfiguration;
-import org.apache.airavata.gfac.GFacException;
-import org.apache.airavata.gfac.context.ApplicationContext;
-import org.apache.airavata.gfac.context.JobExecutionContext;
-import org.apache.airavata.gfac.context.MessageContext;
-import org.apache.airavata.gfac.context.security.GSISecurityContext;
-import org.apache.airavata.gfac.handler.GFacHandlerConfig;
-import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
-import org.apache.airavata.schemas.gfac.DataType;
-import org.apache.airavata.schemas.gfac.GlobusHostType;
-import org.apache.airavata.schemas.gfac.HpcApplicationDeploymentType;
-import org.apache.airavata.schemas.gfac.InputParameterType;
-import org.apache.airavata.schemas.gfac.JobTypeType;
-import org.apache.airavata.schemas.gfac.OutputParameterType;
-import org.apache.airavata.schemas.gfac.ParameterType;
-import org.apache.airavata.schemas.gfac.ProjectAccountType;
-import org.apache.airavata.schemas.gfac.QueueType;
-import org.apache.airavata.schemas.gfac.StringParameterType;
-import org.apache.airavata.schemas.gfac.URIParameterType;
-import org.junit.Before;
-import org.junit.Test;
-
-public class ParamChemTest extends GFacBaseTestCase {
- private JobExecutionContext jobExecutionContext;
-
- @Before
- public void setUp() throws Exception {
-
- GFacConfiguration gFacConfiguration = new GFacConfiguration(null);
- GSISecurityContext context = getSecurityContext();
-
- //have to set InFlwo Handlers and outFlowHandlers
- gFacConfiguration.setInHandlers(Arrays.asList(new GFacHandlerConfig[]{new GFacHandlerConfig(null,"org.apache.airavata.gfac.handler.GramDirectorySetupHandler"), new GFacHandlerConfig(null,"org.apache.airavata.gfac.handler.GridFTPInputHandler")}));
- gFacConfiguration.setOutHandlers(Arrays.asList(new GFacHandlerConfig[] {new GFacHandlerConfig(null,"org.apache.airavata.gfac.handler.GridFTPOutputHandler")}));
- /*
- * Host
- */
- String serviceName = "Prepare_Model_Reference_Data";
- HostDescription host = new HostDescription(GlobusHostType.type);
- host.getType().setHostName("trestles");
- host.getType().setHostAddress("trestles.sdsc.edu");
- ((GlobusHostType) host.getType()).addGridFTPEndPoint("gsiftp://trestles-dm.sdsc.edu:2811");
- ((GlobusHostType) host.getType()).addGlobusGateKeeperEndPoint("trestles-login2.sdsc.edu:2119/jobmanager-pbstest2");
-
- /*
- * App
- */
- ApplicationDescription appDesc =
- new ApplicationDescription(HpcApplicationDeploymentType.type);
- ApplicationDeploymentDescriptionType applicationDeploymentDescriptionType
- = appDesc.getType();
- applicationDeploymentDescriptionType.addNewApplicationName().setStringValue(serviceName);
- String tempDir = "/oasis/projects/nsf/uic151/gridchem/airavata-workdirs";
- String date = (new Date()).toString();
- date = date.replaceAll(" ", "_");
- date = date.replaceAll(":", "_");
-
- tempDir = tempDir + File.separator
- + serviceName + "_" + date + "_" + UUID.randomUUID();
- applicationDeploymentDescriptionType.setExecutableLocation("/home/gridchem/workflow_script/sys_exec/scripts/step1/step1_model_refdata_prep.sh");
- applicationDeploymentDescriptionType.setScratchWorkingDirectory(tempDir);
- applicationDeploymentDescriptionType.setStaticWorkingDirectory(tempDir);
- applicationDeploymentDescriptionType.setInputDataDirectory(tempDir + File.separator + "inputData");
- applicationDeploymentDescriptionType.setOutputDataDirectory(tempDir + File.separator + "outputData");
- applicationDeploymentDescriptionType.setStandardOutput(tempDir + File.separator + applicationDeploymentDescriptionType.getApplicationName().getStringValue() + ".stdout");
- applicationDeploymentDescriptionType.setStandardError(tempDir + File.separator + applicationDeploymentDescriptionType.getApplicationName().getStringValue() + ".stderr");
-
- ProjectAccountType projectAccountType = ((HpcApplicationDeploymentType) applicationDeploymentDescriptionType).addNewProjectAccount();
- projectAccountType.setProjectAccountNumber("uic151");
-
- QueueType queueType = ((HpcApplicationDeploymentType) applicationDeploymentDescriptionType).addNewQueue();
- queueType.setQueueName("shared");
-
- ((HpcApplicationDeploymentType) applicationDeploymentDescriptionType).setJobType(JobTypeType.SERIAL);
- ((HpcApplicationDeploymentType) applicationDeploymentDescriptionType).setMaxWallTime(30);
- ((HpcApplicationDeploymentType) applicationDeploymentDescriptionType).setMaxMemory(2000);
- ((HpcApplicationDeploymentType) applicationDeploymentDescriptionType).setCpuCount(1);
- ((HpcApplicationDeploymentType) applicationDeploymentDescriptionType).setNodeCount(1);
- ((HpcApplicationDeploymentType) applicationDeploymentDescriptionType).setProcessorsPerNode(1);
-
-
- /*
- * Service
- */
- ServiceDescription serv = new ServiceDescription();
- List<InputParameterType> inputParameters = new ArrayList<InputParameterType>();
- List<OutputParameterType> outputParameters = new ArrayList<OutputParameterType>();
-
- serv.getType().setName(serviceName);
- serv.getType().setDescription(serviceName);
-
- //Creating input parameters
- InputParameterType parameter = InputParameterType.Factory.newInstance();
- parameter.setParameterName("molecule_id");
- ParameterType parameterType = parameter.addNewParameterType();
- parameterType.setType(DataType.STRING);
- parameterType.setName("String");
- inputParameters.add(parameter);
-
- parameter = InputParameterType.Factory.newInstance();
- parameter.setParameterName("geom_mol2");
- parameterType = parameter.addNewParameterType();
- parameterType.setType(DataType.URI);
- parameterType.setName("URI");
- inputParameters.add(parameter);
-
- parameter = InputParameterType.Factory.newInstance();
- parameter.setParameterName("toppar_main_tgz");
- parameterType = parameter.addNewParameterType();
- parameterType.setType(DataType.URI);
- parameterType.setName("URI");
- inputParameters.add(parameter);
-
- parameter = InputParameterType.Factory.newInstance();
- parameter.setParameterName("toppar_usr_tgz");
- parameterType = parameter.addNewParameterType();
- parameterType.setType(DataType.URI);
- parameterType.setName("URI");
- inputParameters.add(parameter);
-
- parameter = InputParameterType.Factory.newInstance();
- parameter.setParameterName("toppar_mol_str");
- parameterType = parameter.addNewParameterType();
- parameterType.setType(DataType.URI);
- parameterType.setName("URI");
- inputParameters.add(parameter);
-
- parameter = InputParameterType.Factory.newInstance();
- parameter.setParameterName("molecule_dir_in_tgz");
- parameterType = parameter.addNewParameterType();
- parameterType.setType(DataType.URI);
- parameterType.setName("URI");
- inputParameters.add(parameter);
-
- parameter = InputParameterType.Factory.newInstance();
- parameter.setParameterName("GC_UserName");
- parameterType = parameter.addNewParameterType();
- parameterType.setType(DataType.STRING);
- parameterType.setName("String");
- inputParameters.add(parameter);
-
- parameter = InputParameterType.Factory.newInstance();
- parameter.setParameterName("GC_ProjectName");
- parameterType = parameter.addNewParameterType();
- parameterType.setType(DataType.STRING);
- parameterType.setName("String");
- inputParameters.add(parameter);
-
- parameter = InputParameterType.Factory.newInstance();
- parameter.setParameterName("GC_WorkflowName");
- parameterType = parameter.addNewParameterType();
- parameterType.setType(DataType.STRING);
- parameterType.setName("String");
- inputParameters.add(parameter);
-
- //Creating output parameters
- OutputParameterType outputParameter = OutputParameterType.Factory.newInstance();
- outputParameter.setParameterName("opt_freq_input_gjf");
- ParameterType outputParaType = outputParameter.addNewParameterType();
- outputParaType.setType(DataType.URI);
- outputParaType.setName("URI");
- outputParameters.add(outputParameter);
-
- outputParameter = OutputParameterType.Factory.newInstance();
- outputParameter.setParameterName("charmm_miminized_crd");
- outputParaType = outputParameter.addNewParameterType();
- outputParaType.setType(DataType.URI);
- outputParaType.setName("URI");
- outputParameters.add(outputParameter);
-
- outputParameter = OutputParameterType.Factory.newInstance();
- outputParameter.setParameterName("step1_log");
- outputParaType = outputParameter.addNewParameterType();
- outputParaType.setType(DataType.URI);
- outputParaType.setName("URI");
- outputParameters.add(outputParameter);
-
- outputParameter = OutputParameterType.Factory.newInstance();
- outputParameter.setParameterName("molecule_dir_out_tgz");
- outputParaType = outputParameter.addNewParameterType();
- outputParaType.setType(DataType.URI);
- outputParaType.setName("URI");
- outputParameters.add(outputParameter);
-
- outputParameter = OutputParameterType.Factory.newInstance();
- outputParameter.setParameterName("gcvars");
- outputParaType = outputParameter.addNewParameterType();
- outputParaType.setType(DataType.URI);
- outputParaType.setName("URI");
- outputParameters.add(outputParameter);
-
- //Setting input and output parameters to serviceDescriptor
- serv.getType().setInputParametersArray(inputParameters.toArray(new InputParameterType[]{}));
- serv.getType().setOutputParametersArray(outputParameters.toArray(new OutputParameterType[]{}));
-
- jobExecutionContext = new JobExecutionContext(gFacConfiguration,serv.getType().getName());
- jobExecutionContext.addSecurityContext(GSISecurityContext.GSI_SECURITY_CONTEXT, context);
- ApplicationContext applicationContext = new ApplicationContext();
- applicationContext.setHostDescription(host);
- applicationContext.setApplicationDeploymentDescription(appDesc);
- jobExecutionContext.setApplicationContext(applicationContext);
- applicationContext.setServiceDescription(serv);
-
- MessageContext inMessage = new MessageContext();
-
- ActualParameter echo_input = new ActualParameter();
- ((StringParameterType) echo_input.getType()).setValue("ai");
- inMessage.addParameter("molecule_id", echo_input);
-
- ActualParameter geom_mol2 = new ActualParameter(URIParameterType.type);
- ((URIParameterType) geom_mol2.getType()).setValue("http://ccg-mw1.ncsa.uiuc.edu/cgenff/leoshen/cgenff_project/ai/ai.mol2");
- inMessage.addParameter("geom_mol2", geom_mol2);
-
- ActualParameter toppar_main_tgz = new ActualParameter(URIParameterType.type);
- ((URIParameterType) toppar_main_tgz.getType()).setValue("/home/gridchem/workflow_script/toppar/cgenff/releases/2b7/main.tgz");
- inMessage.addParameter("toppar_main_tgz", toppar_main_tgz);
-
- ActualParameter toppar_usr_tgz = new ActualParameter(URIParameterType.type);
- ((URIParameterType) toppar_usr_tgz.getType()).setValue("gsiftp://trestles.sdsc.edu");
- inMessage.addParameter("toppar_usr_tgz", toppar_usr_tgz);
-
- ActualParameter toppar_mol_str = new ActualParameter(URIParameterType.type);
- ((URIParameterType) toppar_mol_str.getType()).setValue("http://ccg-mw1.ncsa.uiuc.edu/cgenff/leoshen/cgenff_project/ai/toppar/ai.str");
- inMessage.addParameter("toppar_mol_str", toppar_mol_str);
-
- ActualParameter molecule_dir_in_tgz = new ActualParameter(URIParameterType.type);
- ((URIParameterType) molecule_dir_in_tgz.getType()).setValue("");
- inMessage.addParameter("molecule_dir_in_tgz", molecule_dir_in_tgz);
-
- ActualParameter GC_UserName = new ActualParameter();
- ((StringParameterType) GC_UserName.getType()).setValue("leoshen");
- inMessage.addParameter("GC_UserName", GC_UserName);
-
- ActualParameter GC_ProjectName = new ActualParameter();
- ((StringParameterType) GC_ProjectName.getType()).setValue("leoshen");
- inMessage.addParameter("GC_ProjectName", GC_ProjectName);
-
- ActualParameter GC_WorkflowName = new ActualParameter();
- ((StringParameterType) GC_WorkflowName.getType()).setValue("ai__1339258840");
- inMessage.addParameter("GC_WorkflowName", GC_WorkflowName);
-
- jobExecutionContext.setInMessageContext(inMessage);
-
- MessageContext outMessage = new MessageContext();
-
- ActualParameter opt_freq_input_gjf = new ActualParameter(URIParameterType.type);
- outMessage.addParameter("opt_freq_input_gjf", opt_freq_input_gjf);
-
- ActualParameter charmm_miminized_crd = new ActualParameter(URIParameterType.type);
- outMessage.addParameter("charmm_miminized_crd", charmm_miminized_crd);
-
- ActualParameter step1_log = new ActualParameter(URIParameterType.type);
- outMessage.addParameter("step1_log", step1_log);
-
- ActualParameter molecule_dir_out_tgz = new ActualParameter(URIParameterType.type);
- outMessage.addParameter("molecule_dir_out_tgz", molecule_dir_out_tgz);
-
- ActualParameter gcvars = new ActualParameter(URIParameterType.type);
- outMessage.addParameter("gcvars", gcvars);
-
- jobExecutionContext.setOutMessageContext(outMessage);
-
- }
-
- @Test
- public void testGramProvider() throws GFacException {
-// GFacImpl gFacAPI = new GFacImpl();
-// gFacAPI.submitJob(jobExecutionContext);
-// MessageContext outMessageContext = jobExecutionContext.getOutMessageContext();
-// Assert.assertFalse(outMessageContext.getParameters().isEmpty());
-// Assert.assertEquals(MappingFactory.toString((ActualParameter) outMessageContext.getParameter("echo_output")), "hello");
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c555455/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/SSHProviderTest.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/SSHProviderTest.java b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/SSHProviderTest.java
deleted file mode 100644
index 5ac1b43..0000000
--- a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/SSHProviderTest.java
+++ /dev/null
@@ -1,172 +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.core.gfac.services.impl;
-
-import java.io.File;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.UUID;
-
-import org.apache.airavata.commons.gfac.type.ActualParameter;
-import org.apache.airavata.commons.gfac.type.ApplicationDescription;
-import org.apache.airavata.commons.gfac.type.HostDescription;
-import org.apache.airavata.commons.gfac.type.MappingFactory;
-import org.apache.airavata.commons.gfac.type.ServiceDescription;
-import org.apache.airavata.gfac.GFacConfiguration;
-import org.apache.airavata.gfac.GFacException;
-import org.apache.airavata.gfac.context.ApplicationContext;
-import org.apache.airavata.gfac.context.JobExecutionContext;
-import org.apache.airavata.gfac.context.MessageContext;
-import org.apache.airavata.gfac.context.security.SSHSecurityContext;
-import org.apache.airavata.gfac.cpi.GFacImpl;
-import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
-import org.apache.airavata.schemas.gfac.InputParameterType;
-import org.apache.airavata.schemas.gfac.OutputParameterType;
-import org.apache.airavata.schemas.gfac.SSHHostType;
-import org.apache.airavata.schemas.gfac.StringParameterType;
-import org.apache.commons.lang.SystemUtils;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-public class SSHProviderTest {
- private JobExecutionContext jobExecutionContext;
- @Before
- public void setUp() throws Exception {
-
- URL resource = GramProviderTest.class.getClassLoader().getResource(org.apache.airavata.common.utils.Constants.GFAC_CONFIG_XML);
- GFacConfiguration gFacConfiguration = GFacConfiguration.create(new File(resource.getPath()),null,null);
-// gFacConfiguration.s
- //have to set InFlwo Handlers and outFlowHandlers
- ApplicationContext applicationContext = new ApplicationContext();
- HostDescription host = new HostDescription(SSHHostType.type);
- host.getType().setHostName("bigred");
- host.getType().setHostAddress("bigred2.uits.iu.edu");
- applicationContext.setHostDescription(host);
- /*
- * App
- */
- ApplicationDescription appDesc = new ApplicationDescription();
- ApplicationDeploymentDescriptionType app = appDesc.getType();
- ApplicationDeploymentDescriptionType.ApplicationName name = ApplicationDeploymentDescriptionType.ApplicationName.Factory.newInstance();
- name.setStringValue("EchoSSH");
- app.setApplicationName(name);
-
- /*
- * Use bat file if it is compiled on Windows
- */
- if (SystemUtils.IS_OS_WINDOWS) {
- URL url = this.getClass().getClassLoader().getResource("echo.bat");
- app.setExecutableLocation(url.getFile());
- } else {
- //for unix and Mac
- app.setExecutableLocation("/bin/echo");
- }
-
- /*
- * Job location
- */
- String tempDir = "/tmp";
- String date = (new Date()).toString();
- date = date.replaceAll(" ", "_");
- date = date.replaceAll(":", "_");
-
- tempDir = tempDir + File.separator
- + "EchoSSH" + "_" + date + "_" + UUID.randomUUID();
-
- app.setScratchWorkingDirectory(tempDir);
- app.setStaticWorkingDirectory(tempDir);
- app.setInputDataDirectory(tempDir + File.separator + "input");
- app.setOutputDataDirectory(tempDir + File.separator + "output");
- app.setStandardOutput(tempDir + File.separator + "echo.stdout");
- app.setStandardError(tempDir + File.separator + "echo.stderr");
-
- applicationContext.setApplicationDeploymentDescription(appDesc);
-
- /*
- * Service
- */
- ServiceDescription serv = new ServiceDescription();
- serv.getType().setName("EchoSSH");
-
- List<InputParameterType> inputList = new ArrayList<InputParameterType>();
- InputParameterType input = InputParameterType.Factory.newInstance();
- input.setParameterName("echo_input");
- input.setParameterType(StringParameterType.Factory.newInstance());
- inputList.add(input);
- InputParameterType[] inputParamList = inputList.toArray(new InputParameterType[inputList
- .size()]);
-
- List<OutputParameterType> outputList = new ArrayList<OutputParameterType>();
- OutputParameterType output = OutputParameterType.Factory.newInstance();
- output.setParameterName("echo_output");
- output.setParameterType(StringParameterType.Factory.newInstance());
- outputList.add(output);
- OutputParameterType[] outputParamList = outputList
- .toArray(new OutputParameterType[outputList.size()]);
-
- serv.getType().setInputParametersArray(inputParamList);
- serv.getType().setOutputParametersArray(outputParamList);
-
- jobExecutionContext = new JobExecutionContext(gFacConfiguration,serv.getType().getName());
- jobExecutionContext.setApplicationContext(applicationContext);
-
- // Add security context
- jobExecutionContext.addSecurityContext(SSHSecurityContext.SSH_SECURITY_CONTEXT, getSecurityContext());
- /*
- * Host
- */
- applicationContext.setServiceDescription(serv);
-
- MessageContext inMessage = new MessageContext();
- ActualParameter echo_input = new ActualParameter();
- ((StringParameterType)echo_input.getType()).setValue("echo_output=hello");
- inMessage.addParameter("echo_input", echo_input);
-
- jobExecutionContext.setInMessageContext(inMessage);
-
- MessageContext outMessage = new MessageContext();
- ActualParameter echo_out = new ActualParameter();
-// ((StringParameterType)echo_input.getType()).setValue("echo_output=hello");
- outMessage.addParameter("echo_output", echo_out);
-
- jobExecutionContext.setOutMessageContext(outMessage);
-
- }
-
- private SSHSecurityContext getSecurityContext() {
- SSHSecurityContext context = new SSHSecurityContext();
- context.setUsername("lginnali");
- context.setPrivateKeyLoc("~/.ssh/id_dsa");
- context.setKeyPass("i want to be free");
- return context;
- }
-
- @Test
- public void testLocalProvider() throws GFacException {
- GFacImpl gFacAPI = new GFacImpl();
- gFacAPI.submitJob(jobExecutionContext);
- MessageContext outMessageContext = jobExecutionContext.getOutMessageContext();
- Assert.assertEquals(MappingFactory.toString((ActualParameter)outMessageContext.getParameter("echo_output")), "hello");
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c555455/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/US3Test.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/US3Test.java b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/US3Test.java
deleted file mode 100644
index bb28edb..0000000
--- a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/US3Test.java
+++ /dev/null
@@ -1,152 +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.core.gfac.services.impl;
-
-import java.io.File;
-import java.util.Date;
-import java.util.UUID;
-
-import org.apache.airavata.commons.gfac.type.ActualParameter;
-import org.apache.airavata.commons.gfac.type.ApplicationDescription;
-import org.apache.airavata.gfac.context.ApplicationContext;
-import org.apache.airavata.gfac.context.MessageContext;
-import org.apache.airavata.gfac.cpi.GFacImpl;
-import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
-import org.apache.airavata.schemas.gfac.ExtendedKeyValueType;
-import org.apache.airavata.schemas.gfac.HpcApplicationDeploymentType;
-import org.apache.airavata.schemas.gfac.JobTypeType;
-import org.apache.airavata.schemas.gfac.StringParameterType;
-import org.apache.airavata.schemas.gfac.URIParameterType;
-import org.junit.Before;
-import org.junit.Test;
-
-public class US3Test extends AbstractBESTest{
-
-
- @Before
- public void initJobContext() throws Exception {
- initTest();
- }
-
- @Test
- public void submitJob() throws Exception {
- JobTypeType jobType = JobTypeType.Factory.newInstance();
- jobType.set(JobTypeType.MPI);
- ApplicationContext appContext = getApplicationContext();
- appContext.setApplicationDeploymentDescription(getApplicationDesc(jobType));
- jobExecutionContext.setApplicationContext(appContext);
- GFacImpl gFacAPI = new GFacImpl();
- gFacAPI.submitJob(jobExecutionContext);
- }
-
-
- protected ApplicationDescription getApplicationDesc(JobTypeType jobType) {
- ApplicationDescription appDesc = new ApplicationDescription(
- HpcApplicationDeploymentType.type);
- HpcApplicationDeploymentType appDepType = (HpcApplicationDeploymentType) appDesc
- .getType();
- ApplicationDeploymentDescriptionType.ApplicationName name = ApplicationDeploymentDescriptionType.ApplicationName.Factory
- .newInstance();
- name.setStringValue("US3-Job");
- appDepType.setApplicationName(name);
-
-// ProjectAccountType projectAccountType = appDepType.addNewProjectAccount();
-// projectAccountType.setProjectAccountNumber("TG-AST110064");
-
-// QueueType queueType = appDepType.addNewQueue();
-// queueType.setQueueName("development");
-
- // TODO: also handle parallel jobs
- if((jobType.enumValue() == JobTypeType.SERIAL) || (jobType.enumValue() == JobTypeType.SINGLE)) {
- appDepType.setJobType(JobTypeType.SERIAL);
- }
- else if (jobType.enumValue() == JobTypeType.MPI) {
- appDepType.setJobType(JobTypeType.MPI);
- }
- else {
- appDepType.setJobType(JobTypeType.OPEN_MP);
- }
-
- appDepType.setNodeCount(4);
- appDepType.setProcessorsPerNode(8);
-
- appDepType.setMaxWallTime(15);
-
- appDepType.setExecutableLocation("us_mpi_analysis");
-
- ExtendedKeyValueType extKV = appDepType.addNewKeyValuePairs();
- // using jsdl spmd standard
- extKV.setName("NumberOfProcesses");
- // this will be transformed into mpiexec -n 4
- extKV.setStringValue("32");
-
- /*
- * Default tmp location
- */
- String date = (new Date()).toString();
- date = date.replaceAll(" ", "_");
- date = date.replaceAll(":", "_");
-
- String remoteTempDir = scratchDir + File.separator + "US3" + "_" + date + "_"
- + UUID.randomUUID();
-
- System.out.println(remoteTempDir);
-
- // no need of these parameters, as unicore manages by itself
- appDepType.setScratchWorkingDirectory(remoteTempDir);
- appDepType.setStaticWorkingDirectory(remoteTempDir);
- appDepType.setInputDataDirectory(remoteTempDir + File.separator + "inputData");
- appDepType.setOutputDataDirectory(remoteTempDir + File.separator + "outputData");
-
- appDepType.setStandardOutput(appDepType.getOutputDataDirectory()+"/stdout");
-
- appDepType.setStandardError(appDepType.getOutputDataDirectory()+"/stderr");
-
- return appDesc;
- }
- protected MessageContext getInMessageContext() {
- MessageContext inMessage = new MessageContext();
-
- ActualParameter a1 = new ActualParameter();
- a1.getType().changeType(StringParameterType.type);
- ((StringParameterType)a1.getType()).setValue("hpcinput-uslims3.uthscsa.edu-uslims3_cauma3-01594.tar");
- inMessage.addParameter("arg1", a1);
-
- ActualParameter i1 = new ActualParameter();
- i1.getType().changeType(URIParameterType.type);
- ((URIParameterType)i1.getType()).setValue("file:///"+System.getProperty("user.home")+"/juelich-us3/hpcinput-uslims3.uthscsa.edu-uslims3_cauma3-01594.tar");
- inMessage.addParameter("i1", i1);
-
- return inMessage;
- }
-
- protected MessageContext getOutMessageContext() {
- MessageContext outMessage = new MessageContext();
-
- ActualParameter a1 = new ActualParameter();
- a1.getType().changeType(StringParameterType.type);
- ((StringParameterType)a1.getType()).setValue("output/analysis-results.tar");
- outMessage.addParameter("o1", a1);
-
- return outMessage;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c555455/modules/gfac/gfac-core/src/test/java/org/apache/airavata/gfac/context/security/GSISecurityContextTest.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/gfac/context/security/GSISecurityContextTest.java b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/gfac/context/security/GSISecurityContextTest.java
deleted file mode 100644
index 54e7703..0000000
--- a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/gfac/context/security/GSISecurityContextTest.java
+++ /dev/null
@@ -1,174 +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.gfac.context.security;
-
-import junit.framework.Assert;
-import org.apache.airavata.common.utils.AiravataUtils;
-import org.apache.airavata.common.utils.DatabaseTestCases;
-import org.apache.airavata.common.utils.DerbyUtil;
-import org.apache.airavata.credential.store.store.CredentialReader;
-import org.apache.airavata.credential.store.store.CredentialReaderFactory;
-import org.apache.airavata.gfac.RequestData;
-import org.apache.log4j.Logger;
-import org.ietf.jgss.GSSCredential;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-import java.io.File;
-
-/**
- * User: AmilaJ (amilaj@apache.org)
- * Date: 7/12/13
- * Time: 12:58 PM
- */
-
-public class GSISecurityContextTest extends DatabaseTestCases {
-
- private static String userName;
- private static String password;
-
- private static final Logger log = Logger.getLogger(GSISecurityContextTest.class);
-
- @BeforeClass
- public static void setUpClass() throws Exception {
- AiravataUtils.setExecutionAsServer();
-
- userName = System.getProperty("myproxy.user");
- password = System.getProperty("myproxy.password");
-
- if (userName == null || password == null || userName.trim().equals("") || password.trim().equals("")) {
- log.error("===== Please set myproxy.user and myproxy.password system properties. =======");
- Assert.fail("Please set myproxy.user and myproxy.password system properties.");
- }
-
- log.info("Using my proxy user name - " + userName);
-
- setUpDatabase();
-
- }
-
- public static void setUpDatabase() throws Exception {
- DerbyUtil.startDerbyInServerMode(getHostAddress(), getPort(), getUserName(), getPassword());
-
- waitTillServerStarts();
-
- /*
- * String createTable = "CREATE TABLE CREDENTIALS\n" + "(\n" + " GATEWAY_NAME VARCHAR(256) NOT NULL,\n" +
- * " COMMUNITY_USER_NAME VARCHAR(256) NOT NULL,\n" + " CREDENTIAL BLOB NOT NULL,\n" +
- * " PRIVATE_KEY BLOB NOT NULL,\n" + " NOT_BEFORE VARCHAR(256) NOT NULL,\n" +
- * " NOT_AFTER VARCHAR(256) NOT NULL,\n" + " LIFETIME INTEGER NOT NULL,\n" +
- * " REQUESTING_PORTAL_USER_NAME VARCHAR(256) NOT NULL,\n" +
- * " REQUESTED_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',\n" +
- * " PRIMARY KEY (GATEWAY_NAME, COMMUNITY_USER_NAME)\n" + ")";
- */
-
- String createTable = "CREATE TABLE CREDENTIALS\n" + "(\n"
- + " GATEWAY_ID VARCHAR(256) NOT NULL,\n"
- + " TOKEN_ID VARCHAR(256) NOT NULL,\n"
- + // Actual token used to identify the credential
- " CREDENTIAL BLOB NOT NULL,\n" + " PORTAL_USER_ID VARCHAR(256) NOT NULL,\n"
- + " TIME_PERSISTED TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n"
- + " PRIMARY KEY (GATEWAY_ID, TOKEN_ID)\n" + ")";
-
- String dropTable = "drop table CREDENTIALS";
-
- try {
- executeSQL(dropTable);
- } catch (Exception e) {
- }
-
- executeSQL(createTable);
-
- }
-
- @AfterClass
- public static void shutDownDatabase() throws Exception {
- DerbyUtil.stopDerbyServer();
- }
-
- @Test
- public void testGetTrustedCertificatePath() throws Exception {
-
- File f = new File(GSISecurityContext.getTrustedCertificatePath());
- Assert.assertTrue(f.exists());
- }
-
- private GSSCredential getGSSCredentials() throws Exception {
-
- GSISecurityContext gsiSecurityContext = getGSISecurityContext();
-
- return gsiSecurityContext.getGssCredentials();
- }
-
- private GSISecurityContext getGSISecurityContext() throws Exception {
-
- RequestData requestData = new RequestData();
-
- requestData.setMyProxyUserName(userName);
- requestData.setMyProxyPassword(password);
-
- CredentialReader credentialReader = CredentialReaderFactory.createCredentialStoreReader(getDbUtil());
-
- return new GSISecurityContext(credentialReader, requestData);
- }
-
- @Test
- public void testGetGssCredentials() throws Exception {
-
- Assert.assertNotNull(getGSSCredentials());
- }
-
- @Test
- public void testRenewCredentials() throws Exception {
- GSISecurityContext gsiSecurityContext = getGSISecurityContext();
- Assert.assertNotNull(gsiSecurityContext.renewCredentials());
-
- }
-
- @Test
- public void testGetCredentialsFromStore() throws Exception {
- GSISecurityContext gsiSecurityContext = getGSISecurityContext();
- Assert.assertNotNull(gsiSecurityContext.getCredentialsFromStore());
-
- }
-
- @Test
- public void testGetDefaultCredentials() throws Exception {
- GSISecurityContext gsiSecurityContext = getGSISecurityContext();
- Assert.assertNotNull(gsiSecurityContext.getDefaultCredentials());
-
- }
-
- @Test
- public void testGetProxyCredentials() throws Exception {
- GSISecurityContext gsiSecurityContext = getGSISecurityContext();
- Assert.assertNotNull(gsiSecurityContext.getProxyCredentials());
-
- }
-
- @Test
- public void testRenewCredentialsAsATrustedHost() throws Exception {
- GSISecurityContext gsiSecurityContext = getGSISecurityContext();
- Assert.assertNotNull(gsiSecurityContext.renewCredentialsAsATrustedHost());
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c555455/modules/gfac/gfac-core/src/test/java/org/apache/airavata/gfac/provider/impl/GramProviderTest.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/gfac/provider/impl/GramProviderTest.java b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/gfac/provider/impl/GramProviderTest.java
deleted file mode 100644
index 0a0bd8e..0000000
--- a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/gfac/provider/impl/GramProviderTest.java
+++ /dev/null
@@ -1,61 +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.gfac.provider.impl;
-
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-/**
- * User: AmilaJ (amilaj@apache.org)
- * Date: 7/12/13
- * Time: 11:17 AM
- */
-
-public class GramProviderTest {
- @BeforeMethod
- public void setUp() throws Exception {
-
- }
-
- @AfterMethod
- public void tearDown() throws Exception {
-
- }
-
- @Test
- public void testExecute() throws Exception {
-
- GramProvider gramProvider = new GramProvider();
-
- System.out.println(gramProvider.getGramErrorString(1));
-
- System.out.println("======================================================================================");
- System.out.println("Executing test .......................................................................");
-
- }
-
- @Test
- public void testCancelJob() throws Exception {
-
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c555455/modules/gfac/gfac-ec2/pom.xml
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-ec2/pom.xml b/modules/gfac/gfac-ec2/pom.xml
index a5a69dc..11ce4ca 100644
--- a/modules/gfac/gfac-ec2/pom.xml
+++ b/modules/gfac/gfac-ec2/pom.xml
@@ -127,23 +127,4 @@
</dependency>
</dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <!--skip>true</skip -->
- <excludes>
- <exclude>**/services/**</exclude>
- <exclude>**/gfac/**</exclude>
- </excludes>
- <forkMode>always</forkMode>
- <failIfNoTests>false</failIfNoTests>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
</project>
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c555455/modules/gfac/gfac-monitor/pom.xml
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/pom.xml b/modules/gfac/gfac-monitor/pom.xml
index f09be35..3fe60fc 100644
--- a/modules/gfac/gfac-monitor/pom.xml
+++ b/modules/gfac/gfac-monitor/pom.xml
@@ -14,7 +14,7 @@
<groupId>org.apache.airavata</groupId>
<artifactId>airavata</artifactId>
<version>0.12-SNAPSHOT</version>
- <relativePath>../../pom.xml</relativePath>
+ <relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -77,19 +77,4 @@
<scope>test</scope>
</dependency>
</dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skip>false</skip>
- <forkMode>always</forkMode>
- <failIfNoTests>false</failIfNoTests>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
</project>
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c555455/modules/integration-tests/pom.xml
----------------------------------------------------------------------
diff --git a/modules/integration-tests/pom.xml b/modules/integration-tests/pom.xml
index 90e64a7..63680dd 100644
--- a/modules/integration-tests/pom.xml
+++ b/modules/integration-tests/pom.xml
@@ -203,61 +203,6 @@
</execution>
</executions>
</plugin>
-
-
-
- <!--plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.16</version>
- </plugin -->
- <!--plugin>
- <groupId>org.codehaus.cargo</groupId>
- <artifactId>cargo-maven2-plugin</artifactId>
- <version>1.3.1</version>
- <configuration>
-
- <container>
- <containerId>tomcat${major.tomcat.version}x</containerId>
- <type>installed</type>
- <home>${tomcat.work.dir}</home>
- </container>
-
- <configuration>
- <properties>
- <cargo.servlet.port>${test.running.port}</cargo.servlet.port>
- <cargo.tomcat.ajp.port>9009</cargo.tomcat.ajp.port>
- <cargo.rmi.port>9099</cargo.rmi.port>
- <cargo.jvmargs>
- -Xms512m
- -Xmx512m
- -XX:MaxPermSize=256m
- </cargo.jvmargs>
- <cargo.tomcat.context.reloadable>true</cargo.tomcat.context.reloadable>
- </properties>
- <type>existing</type>
- <home>${tomcat.work.dir}</home>
-
- </configuration>
-
- </configuration>
- <executions>
- <execution>
- <id>start-container</id>
- <phase>compile</phase>
- <goals>
- <goal>start</goal>
- </goals>
- </execution>
- <execution>
- <id>stop-container</id>
- <phase>post-integration-test</phase>
- <goals>
- <goal>stop</goal>
- </goals>
- </execution>
- </executions>
- </plugin-->
</plugins>
</build>
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c555455/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactoryTest.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactoryTest.java b/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactoryTest.java
index 36bb0f6..de5113a 100644
--- a/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactoryTest.java
+++ b/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactoryTest.java
@@ -33,7 +33,9 @@ import org.apache.airavata.model.workspace.experiment.ComputationalResourceSched
import org.apache.airavata.model.workspace.experiment.DataObjectType;
import org.apache.airavata.model.workspace.experiment.Experiment;
import org.apache.airavata.model.workspace.experiment.UserConfigurationData;
+import org.apache.airavata.orchestrator.client.util.Initialize;
import org.apache.airavata.orchestrator.cpi.OrchestratorService;
+import org.apache.airavata.orchestrator.server.OrchestratorServer;
import org.apache.airavata.persistance.registry.jpa.impl.RegistryFactory;
import org.apache.airavata.registry.cpi.ParentDataType;
import org.apache.airavata.registry.cpi.Registry;
@@ -50,16 +52,20 @@ public class OrchestratorClientFactoryTest {
private OrchestratorService.Client orchestratorClient;
private Registry registry;
private int NUM_CONCURRENT_REQUESTS = 1;
+ Initialize initialize;
@Before
public void setUp() {
- orchestratorClient = OrchestratorClientFactory.createOrchestratorClient("localhost", 8940);
+ initialize = new Initialize("registry-derby.sql");
+ initialize.initializeDB();
+ try {
+ new OrchestratorServer().start();
+ } catch (Exception e) {
+ e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
registry = RegistryFactory.getDefaultRegistry();
AiravataUtils.setExecutionAsServer();
documentCreator = new DocumentCreator(getAiravataAPI());
documentCreator.createLocalHostDocs();
- documentCreator.createGramDocs();
- documentCreator.createPBSDocsForOGCE();
- documentCreator.createSlurmDocs();
}
private AiravataAPI getAiravataAPI() {
@@ -82,6 +88,8 @@ public class OrchestratorClientFactoryTest {
@Test
public void storeExperimentDetail() {
+ orchestratorClient = OrchestratorClientFactory.createOrchestratorClient("localhost", 8940);
+
for (int i = 0; i < NUM_CONCURRENT_REQUESTS; i++) {
Thread thread = new Thread() {
public void run() {
@@ -101,11 +109,11 @@ public class OrchestratorClientFactoryTest {
exOut.add(output);
Experiment simpleExperiment = ExperimentModelUtil.createSimpleExperiment("project1",
- "admin", "echoExperiment", "SimpleEcho2", "SimpleEcho2", exInputs);
+ "admin", "echoExperiment", "SimpleEcho0", "SimpleEcho0", exInputs);
simpleExperiment.setExperimentOutputs(exOut);
- ComputationalResourceScheduling scheduling = ExperimentModelUtil.createComputationResourceScheduling("stampede.tacc.xsede.org", 1, 1, 1, "normal", 0, 0, 1, "TG-STA110014S");
- scheduling.setResourceHostId("stampede-host");
+ ComputationalResourceScheduling scheduling = ExperimentModelUtil.createComputationResourceScheduling("localhost", 1, 1, 1, "normal", 0, 0, 1, "TG-STA110014S");
+ scheduling.setResourceHostId("localhost");
UserConfigurationData userConfigurationData = new UserConfigurationData();
userConfigurationData.setComputationalResourceScheduling(scheduling);
simpleExperiment.setUserConfigurationData(userConfigurationData);
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c555455/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/util/Initialize.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/util/Initialize.java b/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/util/Initialize.java
new file mode 100644
index 0000000..2f1f368
--- /dev/null
+++ b/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/util/Initialize.java
@@ -0,0 +1,332 @@
+/*
+ *
+ * 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.orchestrator.client.util;
+
+import org.apache.airavata.persistance.registry.jpa.ResourceType;
+import org.apache.airavata.persistance.registry.jpa.ResourceUtils;
+import org.apache.airavata.persistance.registry.jpa.resources.*;
+import org.apache.airavata.registry.api.exception.RegistrySettingsException;
+import org.apache.airavata.registry.api.util.RegistrySettings;
+import org.apache.derby.drda.NetworkServerControl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.InetAddress;
+import java.sql.*;
+import java.util.StringTokenizer;
+
+public class Initialize {
+ private static final Logger logger = LoggerFactory.getLogger(Initialize.class);
+ public static final String DERBY_SERVER_MODE_SYS_PROPERTY = "derby.drda.startNetworkServer";
+ public String scriptName = "registry-derby.sql";
+ private NetworkServerControl server;
+ private static final String delimiter = ";";
+ public static final String PERSISTANT_DATA = "Configuration";
+
+ public Initialize(String scriptName) {
+ this.scriptName = scriptName;
+ }
+
+ public static boolean checkStringBufferEndsWith(StringBuffer buffer, String suffix) {
+ if (suffix.length() > buffer.length()) {
+ return false;
+ }
+ // this loop is done on purpose to avoid memory allocation performance
+ // problems on various JDKs
+ // StringBuffer.lastIndexOf() was introduced in jdk 1.4 and
+ // implementation is ok though does allocation/copying
+ // StringBuffer.toString().endsWith() does massive memory
+ // allocation/copying on JDK 1.5
+ // See http://issues.apache.org/bugzilla/show_bug.cgi?id=37169
+ int endIndex = suffix.length() - 1;
+ int bufferIndex = buffer.length() - 1;
+ while (endIndex >= 0) {
+ if (buffer.charAt(bufferIndex) != suffix.charAt(endIndex)) {
+ return false;
+ }
+ bufferIndex--;
+ endIndex--;
+ }
+ return true;
+ }
+
+ private static boolean isServerStarted(NetworkServerControl server, int ntries)
+ {
+ for (int i = 1; i <= ntries; i ++)
+ {
+ try {
+ Thread.sleep(500);
+ server.ping();
+ return true;
+ }
+ catch (Exception e) {
+ if (i == ntries)
+ return false;
+ }
+ }
+ return false;
+ }
+
+ public void initializeDB() {
+ String jdbcUrl = null;
+ String jdbcDriver = null;
+ String jdbcUser = null;
+ String jdbcPassword = null;
+ try{
+ jdbcDriver = RegistrySettings.getSetting("registry.jdbc.driver");
+ jdbcUrl = RegistrySettings.getSetting("registry.jdbc.url");
+ jdbcUser = RegistrySettings.getSetting("registry.jdbc.user");
+ jdbcPassword = RegistrySettings.getSetting("registry.jdbc.password");
+ jdbcUrl = jdbcUrl + "?" + "user=" + jdbcUser + "&" + "password=" + jdbcPassword;
+ } catch (RegistrySettingsException e) {
+ logger.error("Unable to read properties" , e);
+ }
+
+
+ startDerbyInServerMode();
+ if(!isServerStarted(server, 20)){
+ throw new RuntimeException("Derby server cound not started within five seconds...");
+ }
+// startDerbyInEmbeddedMode();
+
+ Connection conn = null;
+ try {
+ Class.forName(Utils.getJDBCDriver()).newInstance();
+ conn = DriverManager.getConnection(jdbcUrl, jdbcUser, jdbcPassword);
+ if (!isDatabaseStructureCreated(PERSISTANT_DATA, conn)) {
+ executeSQLScript(conn);
+ logger.info("New Database created for Registry");
+ } else {
+ logger.debug("Database already created for Registry!");
+ }
+ } catch (Exception e) {
+ logger.error(e.getMessage(), e);
+ throw new RuntimeException("Database failure", e);
+ } finally {
+ try {
+ if (conn != null){
+ if (!conn.getAutoCommit()) {
+ conn.commit();
+ }
+ conn.close();
+ }
+ } catch (SQLException e) {
+ logger.error(e.getMessage(), e);
+ e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
+ }
+
+ try{
+ GatewayResource gatewayResource = (GatewayResource)ResourceUtils.createGateway(RegistrySettings.getSetting("default.registry.gateway"));
+ gatewayResource.setOwner(RegistrySettings.getSetting("default.registry.gateway"));
+ gatewayResource.save();
+
+ UserResource userResource = ResourceUtils.createUser(RegistrySettings.getSetting("default.registry.user"),RegistrySettings.getSetting("default.registry.password"));
+ userResource.save();
+
+ WorkerResource workerResource = (WorkerResource) gatewayResource.create(ResourceType.GATEWAY_WORKER);
+ workerResource.setUser(userResource.getUserName());
+ workerResource.save();
+
+ ProjectResource resource = (ProjectResource)gatewayResource.create(ResourceType.PROJECT);
+ resource.setName("default");
+ resource.setWorker(workerResource);
+ resource.save();
+
+ } catch (RegistrySettingsException e) {
+ logger.error("Unable to read properties", e);
+ }
+ }
+
+ public static boolean isDatabaseStructureCreated(String tableName, Connection conn) {
+ try {
+ System.out.println("Running a query to test the database tables existence.");
+ // check whether the tables are already created with a query
+ Statement statement = null;
+ try {
+ statement = conn.createStatement();
+ ResultSet rs = statement.executeQuery("select * from " + tableName);
+ if (rs != null) {
+ rs.close();
+ }
+ } finally {
+ try {
+ if (statement != null) {
+ statement.close();
+ }
+ } catch (SQLException e) {
+ return false;
+ }
+ }
+ } catch (SQLException e) {
+ return false;
+ }
+
+ return true;
+ }
+
+ private void executeSQLScript(Connection conn) throws Exception {
+ StringBuffer sql = new StringBuffer();
+ BufferedReader reader = null;
+ try{
+
+ InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(scriptName);
+ reader = new BufferedReader(new InputStreamReader(inputStream));
+ String line;
+ while ((line = reader.readLine()) != null) {
+ line = line.trim();
+ if (line.startsWith("//")) {
+ continue;
+ }
+ if (line.startsWith("--")) {
+ continue;
+ }
+ StringTokenizer st = new StringTokenizer(line);
+ if (st.hasMoreTokens()) {
+ String token = st.nextToken();
+ if ("REM".equalsIgnoreCase(token)) {
+ continue;
+ }
+ }
+ sql.append(" ").append(line);
+
+ // SQL defines "--" as a comment to EOL
+ // and in Oracle it may contain a hint
+ // so we cannot just remove it, instead we must end it
+ if (line.indexOf("--") >= 0) {
+ sql.append("\n");
+ }
+ if ((checkStringBufferEndsWith(sql, delimiter))) {
+ executeSQL(sql.substring(0, sql.length() - delimiter.length()), conn);
+ sql.replace(0, sql.length(), "");
+ }
+ }
+ // Catch any statements not followed by ;
+ if (sql.length() > 0) {
+ executeSQL(sql.toString(), conn);
+ }
+ }catch (IOException e){
+ logger.error("Error occurred while executing SQL script for creating Airavata database", e);
+ throw new Exception("Error occurred while executing SQL script for creating Airavata database", e);
+ }finally {
+ if (reader != null) {
+ reader.close();
+ }
+
+ }
+
+ }
+
+ private static void executeSQL(String sql, Connection conn) throws Exception {
+ // Check and ignore empty statements
+ if ("".equals(sql.trim())) {
+ return;
+ }
+
+ Statement statement = null;
+ try {
+ logger.debug("SQL : " + sql);
+
+ boolean ret;
+ int updateCount = 0, updateCountTotal = 0;
+ statement = conn.createStatement();
+ ret = statement.execute(sql);
+ updateCount = statement.getUpdateCount();
+ do {
+ if (!ret) {
+ if (updateCount != -1) {
+ updateCountTotal += updateCount;
+ }
+ }
+ ret = statement.getMoreResults();
+ if (ret) {
+ updateCount = statement.getUpdateCount();
+ }
+ } while (ret);
+
+ logger.debug(sql + " : " + updateCountTotal + " rows affected");
+
+ SQLWarning warning = conn.getWarnings();
+ while (warning != null) {
+ logger.warn(warning + " sql warning");
+ warning = warning.getNextWarning();
+ }
+ conn.clearWarnings();
+ } catch (SQLException e) {
+ if (e.getSQLState().equals("X0Y32")) {
+ // eliminating the table already exception for the derby
+ // database
+ logger.info("Table Already Exists", e);
+ } else {
+ throw new Exception("Error occurred while executing : " + sql, e);
+ }
+ } finally {
+ if (statement != null) {
+ try {
+ statement.close();
+ } catch (SQLException e) {
+ logger.error("Error occurred while closing result set.", e);
+ }
+ }
+ }
+ }
+
+ private void startDerbyInServerMode() {
+ try {
+ System.setProperty(DERBY_SERVER_MODE_SYS_PROPERTY, "true");
+ server = new NetworkServerControl(InetAddress.getByName(Utils.getHost()),
+ 20000,
+ Utils.getJDBCUser(), Utils.getJDBCPassword());
+ java.io.PrintWriter consoleWriter = new java.io.PrintWriter(System.out, true);
+ server.start(consoleWriter);
+ } catch (IOException e) {
+ logger.error("Unable to start Apache derby in the server mode! Check whether " +
+ "specified port is available");
+ } catch (Exception e) {
+ logger.error("Unable to start Apache derby in the server mode! Check whether " +
+ "specified port is available");
+ }
+
+ }
+
+ private void startDerbyInEmbeddedMode(){
+ try {
+ Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
+ DriverManager.getConnection("jdbc:derby:memory:unit-testing-jpa;create=true").close();
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void stopDerbyServer() {
+ try {
+ server.shutdown();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c555455/modules/orchestrator/airavata-orchestrator-service/src/test/resources/airavata-server.properties
----------------------------------------------------------------------
diff --git a/modules/orchestrator/airavata-orchestrator-service/src/test/resources/airavata-server.properties b/modules/orchestrator/airavata-orchestrator-service/src/test/resources/airavata-server.properties
index 0526808..e395a76 100644
--- a/modules/orchestrator/airavata-orchestrator-service/src/test/resources/airavata-server.properties
+++ b/modules/orchestrator/airavata-orchestrator-service/src/test/resources/airavata-server.properties
@@ -103,8 +103,7 @@ myproxy.user=ogce
myproxy.pass=
myproxy.life=3600
# XSEDE Trusted certificates can be downloaded from https://software.xsede.org/security/xsede-certs.tar.gz
-trusted.cert.location=/Users/chathuri/dev/airavata/cert/certificates
-
+trusted.cert.location=/Users/lahirugunathilake/Downloads/certificates
# SSH PKI key pair or ssh password can be used SSH based authentication is used.
# if user specify both password authentication gets the higher preference
@@ -252,3 +251,33 @@ registry.service.wsdl=http://localhost:${port}/${server.context-root}/services/R
# If false, disables two phase commit when submitting jobs
TwoPhase=true
+
+
+###---------------------------Monitoring module Configurations---------------------------###
+#This will be the primary monitoring tool which runs in airavata, in future there will be multiple monitoring
+#mechanisms and one would be able to start a monitor
+monitors=org.apache.airavata.job.monitor.impl.pull.qstat.QstatMonitor,org.apache.airavata.job.monitor.impl.LocalJobMonitor
+#,org.apache.airavata.job.monitor.impl.push.amqp.AMQPMonitor
+#This is the amqp related configuration and this lists down the Rabbitmq host, this is an xsede specific configuration
+amqp.hosts=info1.dyn.teragrid.org,info2.dyn.teragrid.org
+proxy.file.path=/Users/lahirugunathilake/Downloads/x509up_u503876
+connection.name=xsede_private
+
+
+###---------------------------Orchestrator module Configurations---------------------------###
+job.submitter=org.apache.airavata.orchestrator.core.impl.EmbeddedGFACJobSubmitter
+job.validator=org.apache.airavata.orchestrator.core.validator.impl.SimpleAppDataValidator
+submitter.interval=10000
+threadpool.size=10
+start.submitter=true
+embedded.mode=true
+enable.validation=false
+orchestrator=org.apache.airavata.orchestrator.server.OrchestratorServer
+
+###---------------------------API Server module Configurations---------------------------###
+apiserver=org.apache.airavata.api.server.AiravataAPIServer
+
+###---------------------------Airavata Server Configurations---------------------------###
+servers=apiserver,orchestrator
+#shutdown.trategy=NONE
+shutdown.trategy=SELF_TERMINATE
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c555455/modules/orchestrator/airavata-orchestrator-service/src/test/resources/registry-derby.sql
----------------------------------------------------------------------
diff --git a/modules/orchestrator/airavata-orchestrator-service/src/test/resources/registry-derby.sql b/modules/orchestrator/airavata-orchestrator-service/src/test/resources/registry-derby.sql
new file mode 100644
index 0000000..e1bf9e6
--- /dev/null
+++ b/modules/orchestrator/airavata-orchestrator-service/src/test/resources/registry-derby.sql
@@ -0,0 +1,391 @@
+/*
+ *
+ * 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),
+ DESCRIPTION VARCHAR(255),
+ CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+ 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 PROJECT_USER
+(
+ PROJECT_NAME VARCHAR(255),
+ USER_NAME VARCHAR(255),
+ PRIMARY KEY (PROJECT_NAME,USER_NAME),
+ FOREIGN KEY (PROJECT_NAME) REFERENCES PROJECT(PROJECT_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 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
+(
+ EXPERIMENT_ID VARCHAR(255),
+ GATEWAY_NAME VARCHAR(255),
+ EXECUTION_USER VARCHAR(255),
+ PROJECT_NAME VARCHAR(255),
+ CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+ EXPERIMENT_NAME VARCHAR(255) NOT NULL,
+ EXPERIMENT_DESCRIPTION VARCHAR(255),
+ APPLICATION_ID VARCHAR(255),
+ APPLICATION_VERSION VARCHAR(255),
+ WORKFLOW_TEMPLATE_ID VARCHAR(255),
+ WORKFLOW_TEMPLATE_VERSION VARCHAR(255),
+ WORKFLOW_EXECUTION_ID VARCHAR(255),
+ 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
+);
+
+CREATE TABLE EXPERIMENT_INPUT
+(
+ EXPERIMENT_ID VARCHAR(255),
+ INPUT_KEY VARCHAR(255),
+ INPUT_TYPE VARCHAR(255),
+ METADATA VARCHAR(255),
+ VALUE VARCHAR(255),
+ PRIMARY KEY(EXPERIMENT_ID,INPUT_KEY),
+ FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE EXPERIMENT_OUTPUT
+(
+ EXPERIMENT_ID VARCHAR(255),
+ OUTPUT_KEY VARCHAR(255),
+ OUTPUT_KEY_TYPE VARCHAR(255),
+ METADATA VARCHAR(255),
+ VALUE VARCHAR(255),
+ PRIMARY KEY(EXPERIMENT_ID,OUTPUT_KEY),
+ FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
+);
+
+
+CREATE TABLE WORKFLOW_NODE_DETAIL
+(
+ EXPERIMENT_ID VARCHAR(255),
+ NODE_INSTANCE_ID VARCHAR(255),
+ CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+ NODE_NAME VARCHAR(255),
+ PRIMARY KEY(NODE_INSTANCE_ID),
+ FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE TASK_DETAIL
+(
+ TASK_ID VARCHAR(255),
+ NODE_INSTANCE_ID VARCHAR(255),
+ CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+ APPLICATION_ID VARCHAR(255),
+ APPLICATION_VERSION VARCHAR(255),
+ PRIMARY KEY(TASK_ID),
+ FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE ERROR_DETAIL
+(
+ ERROR_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
+ EXPERIMENT_ID VARCHAR(255),
+ TASK_ID VARCHAR(255),
+ NODE_INSTANCE_ID VARCHAR(255),
+ JOB_ID VARCHAR(255),
+ CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+ ACTUAL_ERROR_MESSAGE CLOB,
+ USER_FRIEDNLY_ERROR_MSG VARCHAR(255),
+ TRANSIENT_OR_PERSISTENT SMALLINT,
+ ERROR_CATEGORY VARCHAR(255),
+ CORRECTIVE_ACTION VARCHAR(255),
+ ACTIONABLE_GROUP VARCHAR(255),
+ PRIMARY KEY(ERROR_ID),
+ FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
+ FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE,
+ FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE APPLICATION_INPUT
+(
+ TASK_ID VARCHAR(255),
+ INPUT_KEY VARCHAR(255),
+ INPUT_KEY_TYPE VARCHAR(255),
+ METADATA VARCHAR(255),
+ VALUE VARCHAR(255),
+ PRIMARY KEY(TASK_ID,INPUT_KEY),
+ FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE APPLICATION_OUTPUT
+(
+ TASK_ID VARCHAR(255),
+ OUTPUT_KEY VARCHAR(255),
+ OUTPUT_KEY_TYPE VARCHAR(255),
+ METADATA VARCHAR(255),
+ VALUE VARCHAR(255),
+ PRIMARY KEY(TASK_ID,OUTPUT_KEY),
+ FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE NODE_INPUT
+(
+ NODE_INSTANCE_ID VARCHAR(255),
+ INPUT_KEY VARCHAR(255),
+ INPUT_KEY_TYPE VARCHAR(255),
+ METADATA VARCHAR(255),
+ VALUE VARCHAR(255),
+ PRIMARY KEY(NODE_INSTANCE_ID,INPUT_KEY),
+ FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE NODE_OUTPUT
+(
+ NODE_INSTANCE_ID VARCHAR(255),
+ OUTPUT_KEY VARCHAR(255),
+ OUTPUT_KEY_TYPE VARCHAR(255),
+ METADATA VARCHAR(255),
+ VALUE VARCHAR(255),
+ PRIMARY KEY(NODE_INSTANCE_ID,OUTPUT_KEY),
+ FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE JOB_DETAIL
+(
+ JOB_ID VARCHAR(255),
+ TASK_ID VARCHAR(255),
+ JOB_DESCRIPTION CLOB,
+ CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+ COMPUTE_RESOURCE_CONSUMED VARCHAR(255),
+ PRIMARY KEY (TASK_ID, JOB_ID),
+ FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE DATA_TRANSFER_DETAIL
+(
+ TRANSFER_ID VARCHAR(255),
+ TASK_ID VARCHAR(255),
+ CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+ TRANSFER_DESC CLOB,
+ PRIMARY KEY(TRANSFER_ID),
+ FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE STATUS
+(
+ STATUS_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
+ EXPERIMENT_ID VARCHAR(255),
+ NODE_INSTANCE_ID VARCHAR(255),
+ TRANSFER_ID VARCHAR(255),
+ TASK_ID VARCHAR(255),
+ JOB_ID VARCHAR(255),
+ STATE VARCHAR(255),
+ STATUS_UPDATE_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+ STATUS_TYPE VARCHAR(255),
+ PRIMARY KEY(STATUS_ID),
+ FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
+ FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE,
+ FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE,
+ FOREIGN KEY (TRANSFER_ID) REFERENCES DATA_TRANSFER_DETAIL(TRANSFER_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE CONFIG_DATA
+(
+ EXPERIMENT_ID VARCHAR(255),
+ AIRAVATA_AUTO_SCHEDULE SMALLINT,
+ OVERRIDE_MANUAL_SCHEDULE_PARAMS SMALLINT,
+ SHARE_EXPERIMENT SMALLINT,
+ PRIMARY KEY(EXPERIMENT_ID)
+);
+
+CREATE TABLE COMPUTATIONAL_RESOURCE_SCHEDULING
+(
+ RESOURCE_SCHEDULING_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
+ EXPERIMENT_ID VARCHAR(255),
+ TASK_ID VARCHAR(255),
+ RESOURCE_HOST_ID VARCHAR(255),
+ CPU_COUNT INTEGER,
+ NODE_COUNT INTEGER,
+ NO_OF_THREADS INTEGER,
+ QUEUE_NAME VARCHAR(255),
+ WALLTIME_LIMIT INTEGER,
+ JOB_START_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+ TOTAL_PHYSICAL_MEMORY INTEGER,
+ COMPUTATIONAL_PROJECT_ACCOUNT VARCHAR(255),
+ PRIMARY KEY(RESOURCE_SCHEDULING_ID),
+ FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
+ FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE ADVANCE_INPUT_DATA_HANDLING
+(
+ INPUT_DATA_HANDLING_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
+ EXPERIMENT_ID VARCHAR(255),
+ TASK_ID VARCHAR(255),
+ WORKING_DIR_PARENT VARCHAR(255),
+ UNIQUE_WORKING_DIR VARCHAR(255),
+ STAGE_INPUT_FILES_TO_WORKING_DIR SMALLINT,
+ CLEAN_AFTER_JOB SMALLINT,
+ PRIMARY KEY(INPUT_DATA_HANDLING_ID),
+ FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
+ FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE ADVANCE_OUTPUT_DATA_HANDLING
+(
+ OUTPUT_DATA_HANDLING_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
+ EXPERIMENT_ID VARCHAR(255),
+ TASK_ID VARCHAR(255),
+ OUTPUT_DATA_DIR VARCHAR(255),
+ DATA_REG_URL VARCHAR (255),
+ PERSIST_OUTPUT_DATA SMALLINT,
+ PRIMARY KEY(OUTPUT_DATA_HANDLING_ID),
+ FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
+ FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE QOS_PARAM
+(
+ QOS_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
+ EXPERIMENT_ID VARCHAR(255),
+ TASK_ID VARCHAR(255),
+ START_EXECUTION_AT VARCHAR(255),
+ EXECUTE_BEFORE VARCHAR(255),
+ NO_OF_RETRIES INTEGER,
+ PRIMARY KEY(QOS_ID),
+ FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
+ FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+);
+
+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)
+);
+
+
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c555455/modules/orchestrator/orchestrator-core/pom.xml
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/pom.xml b/modules/orchestrator/orchestrator-core/pom.xml
index cbe10b0..060d5a9 100644
--- a/modules/orchestrator/orchestrator-core/pom.xml
+++ b/modules/orchestrator/orchestrator-core/pom.xml
@@ -97,17 +97,6 @@ the License. -->
<target>1.6</target>
</configuration>
</plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <excludes>
- <exclude>**/ssh/**</exclude>
- </excludes>
- <forkMode>always</forkMode>
- <failIfNoTests>false</failIfNoTests>
- </configuration>
- </plugin>
</plugins>
<testSourceDirectory>${project.basedir}/src/test/java</testSourceDirectory>
<testOutputDirectory>${project.build.directory}/test-classes</testOutputDirectory>
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c555455/modules/registry/airavata-jpa-registry/pom.xml
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/pom.xml b/modules/registry/airavata-jpa-registry/pom.xml
index 751ba6d..e70db93 100644
--- a/modules/registry/airavata-jpa-registry/pom.xml
+++ b/modules/registry/airavata-jpa-registry/pom.xml
@@ -138,97 +138,23 @@
</execution>
</executions>
</plugin>
- <!--<plugin>-->
- <!--<groupId>org.apache.maven.plugins</groupId>-->
- <!--<artifactId>maven-antrun-plugin</artifactId>-->
- <!--<version>1.7</version>-->
- <!--<executions>-->
- <!--<execution>-->
- <!--<phase>compile</phase>-->
- <!--<configuration>-->
- <!--<tasks>-->
- <!--<path id="enhance.path.ref">-->
- <!--<fileset dir="${project.build.outputDirectory}">-->
- <!--<include name="Application_Descriptor.class" />-->
- <!--<include name="Application_Descriptor_PK.class" />-->
- <!--<include name="Configuration.class" />-->
- <!--<include name="Configuration_PK.class" />-->
- <!--<include name="Execution_Error.class" />-->
- <!--<include name="Experiment_Configuration_Data.class" />-->
- <!--<include name="Experiment_Input.class" />-->
- <!--<include name="Experiment_Input_PK.class" />-->
- <!--<include name="Experiment_Metadata.class" />-->
- <!--<include name="Experiment_Output.class" />-->
- <!--<include name="Experiment_Output_PK.class" />-->
- <!--<include name="Experiment_Output.class" />-->
- <!--<include name="Gateway.class" />-->
- <!--<include name="Gateway_Worker.class" />-->
- <!--<include name="Gateway_Worker_PK.class" />-->
- <!--<include name="GFac_Job_Data.class" />-->
- <!--<include name="GFac_Job_Status.class" />-->
- <!--<include name="Gram_Data.class" />-->
- <!--<include name="Gram_Data_PK.class" />-->
- <!--<include name="Host_Descriptor.class" />-->
- <!--<include name="Host_Descriptor_PK.class" />-->
- <!--<include name="Node_Data.class" />-->
- <!--<include name="Node_Data_PK.class" />-->
- <!--<include name="Orchestrator.class" />-->
- <!--<include name="Project.class" />-->
- <!--<include name="Published_Workflow.class" />-->
- <!--<include name="Published_Workflow_PK.class" />-->
- <!--<include name="Service_Descriptor.class" />-->
- <!--<include name="Service_Descriptor_PK.class" />-->
- <!--<include name="User_Workflow.class" />-->
- <!--<include name="User_Workflow_PK.class" />-->
- <!--<include name="Users.class" />-->
- <!--<include name="Workflow_Data.class" />-->
- <!--</fileset>-->
- <!--</path>-->
- <!--<pathconvert property="enhance.files" refid="enhance.path.ref" pathsep=" " />-->
- <!--<java classname="org.apache.openjpa.enhance.PCEnhancer">-->
- <!--<arg line="-p persistence.xml" />-->
- <!--<arg line="${enhance.files}" />-->
- <!--<classpath>-->
- <!--<path refid="maven.dependency.classpath" />-->
- <!--<path refid="maven.compile.classpath" />-->
- <!--</classpath>-->
- <!--</java>-->
- <!--</tasks>-->
- <!--</configuration>-->
- <!--<goals>-->
- <!--<goal>run</goal>-->
- <!--</goals>-->
- <!--</execution>-->
- <!--</executions>-->
- <!--</plugin>-->
- <!--<plugin>-->
- <!--<groupId>org.apache.openjpa</groupId>-->
- <!--<artifactId>openjpa-maven-plugin</artifactId>-->
- <!--<version>2.2.0</version>-->
- <!--<configuration>-->
- <!--<includes>**/model/*.class</includes>-->
- <!--<excludes>**/model/XML*.class</excludes>-->
- <!--<addDefaultConstructor>true</addDefaultConstructor>-->
- <!--<enforcePropertyRestrictions>true</enforcePropertyRestrictions>-->
- <!--</configuration>-->
- <!--<executions>-->
- <!--<execution>-->
- <!--<id>enhancer</id>-->
- <!--<phase>process-classes</phase>-->
- <!--<goals>-->
- <!--<goal>enhance</goal>-->
- <!--</goals>-->
- <!--</execution>-->
- <!--</executions>-->
- <!--<dependencies>-->
- <!--<dependency>-->
- <!--<groupId>org.apache.openjpa</groupId>-->
- <!--<artifactId>openjpa</artifactId>-->
- <!--<!– set the version to be the same as the level in your runtime –>-->
- <!--<version>1.2.2</version>-->
- <!--</dependency>-->
- <!--</dependencies>-->
- <!--</plugin>-->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>${surefire.version}</version>
+ <inherited>true</inherited>
+ <configuration>
+ <failIfNoTests>false</failIfNoTests>
+ <skipTests>${skipTests}</skipTests>
+ <workingDirectory>${project.build.testOutputDirectory}</workingDirectory>
+ <!-- making sure that the sure-fire plugin doesn't run the integration tests-->
+ <!-- Integration tests are run using the fail-safe plugin in the module pom-->
+ <excludes>
+ <exclude>**/TaskDetailResourceTest.java</exclude>
+ <exclude>**/WorkflowNodeDetailResourceTest.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
</plugins>
</build>
[4/4] git commit: fixing the merge
Posted by la...@apache.org.
fixing the merge
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/9ab16b97
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/9ab16b97
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/9ab16b97
Branch: refs/heads/master
Commit: 9ab16b97e47ca8dc5b981de7944f8a2a54bad745
Parents: 9c55545 a2dcc36
Author: lahiru <la...@apache.org>
Authored: Fri Apr 4 09:22:39 2014 -0400
Committer: lahiru <la...@apache.org>
Committed: Fri Apr 4 09:22:39 2014 -0400
----------------------------------------------------------------------
README | 3 +
.../java-client-samples/pom.xml | 5 +
.../main/resources/airavata-client.properties | 77 -
modules/airavata-client/pom.xml | 5 +
.../main/resources/airavata-client.properties | 76 -
.../common/utils/ApplicationSettingsTest.java | 6 +-
.../test/resources/airavata-server.properties | 118 +-
modules/configuration/client/pom.xml | 24 +
.../main/resources/airavata-client.properties | 77 +
.../client/src/main/resources/log4j.properties | 40 +
modules/configuration/pom.xml | 40 +
modules/configuration/server/pom.xml | 24 +
.../server/src/main/resources/PBSTemplate.xslt | 77 +
.../server/src/main/resources/SGETemplate.xslt | 79 +
.../src/main/resources/SLURMTemplate.xslt | 69 +
.../main/resources/airavata-server.properties | 283 +++
.../server/src/main/resources/airavata.jks | Bin 0 -> 501 bytes
.../server/src/main/resources/axis2.xml | 533 ++++
.../server/src/main/resources/gfac-config.xml | 101 +
.../server/src/main/resources/gsissh.properties | 26 +
.../server/src/main/resources/host.xml | 86 +
.../server/src/main/resources/log4j.properties | 41 +
modules/distribution/airavata-client/pom.xml | 30 +-
.../src/main/assembly/bin-assembly.xml | 8 +-
.../resources/conf/airavata-client.properties | 77 -
.../src/main/resources/conf/log4j.properties | 40 -
modules/distribution/airavata-server/pom.xml | 110 +-
.../src/main/assembly/bin-assembly.xml | 24 +-
.../src/main/resources/conf/PBSTemplate.xslt | 77 -
.../src/main/resources/conf/SGETemplate.xslt | 79 -
.../src/main/resources/conf/SLURMTemplate.xslt | 69 -
.../resources/conf/airavata-server.properties | 283 ---
.../src/main/resources/conf/airavata.jks | Bin 501 -> 0 bytes
.../src/main/resources/conf/axis2.xml | 533 ----
.../src/main/resources/conf/gfac-config.xml | 101 -
.../src/main/resources/conf/gsissh.properties | 26 -
.../src/main/resources/conf/host.xml | 86 -
.../src/main/resources/conf/log4j.properties | 41 -
.../src/main/resources/war/INSTALL | 55 -
.../src/main/resources/war/LICENSE | 2387 ------------------
.../src/main/resources/war/NOTICE | 163 --
.../src/main/resources/war/README | 121 -
modules/distribution/xbaya-gui/pom.xml | 30 +-
.../src/main/assembly/bin-assembly.xml | 8 +-
.../resources/conf/airavata-client.properties | 66 -
.../src/main/resources/conf/log4j.properties | 40 -
.../orchestrator-client-sdks/pom.xml | 5 +
.../main/resources/airavata-client.properties | 77 -
modules/server/pom.xml | 5 +
.../main/resources/airavata-server.properties | 277 --
modules/xbaya-gui/pom.xml | 5 +
.../main/resources/airavata-client.properties | 80 -
pom.xml | 1 +
53 files changed, 1694 insertions(+), 5000 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/9ab16b97/modules/server/pom.xml
----------------------------------------------------------------------
diff --cc modules/server/pom.xml
index 893ae79,784cec5..19b1340
--- a/modules/server/pom.xml
+++ b/modules/server/pom.xml
@@@ -50,5 -50,30 +50,10 @@@
<artifactId>airavata-api-server</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.airavata</groupId>
+ <artifactId>airavata-server-configuration</artifactId>
+ <version>${project.version}</version>
+ </dependency>
</dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>${surefire.version}</version>
- <configuration>
- <testSourceDirectory>${basedir}\src\test\java\</testSourceDirectory>
- </configuration>
- </plugin>
- </plugins>
- <testSourceDirectory>${project.basedir}/src/test/java</testSourceDirectory>
- <testOutputDirectory>${project.build.directory}/test-classes</testOutputDirectory>
- <testResources>
- <testResource>
- <directory>${project.basedir}/src/test/resources</directory>
- </testResource>
- </testResources>
- </build>
</project>
http://git-wip-us.apache.org/repos/asf/airavata/blob/9ab16b97/modules/xbaya-gui/pom.xml
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/9ab16b97/pom.xml
----------------------------------------------------------------------
diff --cc pom.xml
index f67c495,1890461..381a012
--- a/pom.xml
+++ b/pom.xml
@@@ -469,98 -468,12 +469,99 @@@
<module>modules/airavata-client</module>
<module>modules/security</module>
<module>modules/credential-store</module>
- <!--module>modules/rest</module-->
<module>modules/orchestrator</module>
<module>tools</module>
+ <module>modules/server</module>
+ <module>modules/test-suite</module>
+ <module>modules/distribution</module>
+ <module>modules/integration-tests</module>
+ <!--module>modules/rest</module-->
<!--module>samples</module-->
+ <!--module>modules/xbaya-gui</module-->
+ </modules>
+ </profile>
+ <!--profile>
+ <id>gridTests</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-remote-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>process</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.5</version>
+ <executions>
+ <execution>
+ <id>copy-resources</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${basedir}/target/classes/META-INF</outputDirectory>
+ <resources>
+ <resource>
+ <directory>${basedir}/src/main/assembly/dist</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.3.2</version>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>${surefire.version}</version>
+ <configuration>
+ <failIfNoTests>false</failIfNoTests>
+ <skipTests>${skipTests}</skipTests>
+ <workingDirectory>${project.build.testOutputDirectory}</workingDirectory>
+ <excludes>
+ <exclude>**/IT.java</exclude>
+ </excludes>
+ <includes>
+ <include>**/*TestWithMyProxyAuth.java</include>
+ <include>**/*TestWithSSHAuth.java</include>
+ </includes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <module>airavata-api</module>
+ <module>modules/gfac</module>
+ <module>modules/ws-messenger</module>
+ <module>modules/workflow-model</module>
+ <module>modules/commons</module>
+ <module>modules/registry</module>
+ <module>modules/airavata-client</module>
+ <module>modules/security</module>
+ <module>modules/credential-store</module>
+ <module>modules/orchestrator</module>
+ <module>tools</module>
<module>modules/server</module>
+ <module>modules/configuration</module>
<module>modules/test-suite</module>
<module>modules/distribution</module>
<module>modules/integration-tests</module>
[3/4] git commit: Fixing the build to handle grid test cases
Posted by la...@apache.org.
Fixing the build to handle grid test cases
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/9c555455
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/9c555455
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/9c555455
Branch: refs/heads/master
Commit: 9c555455162ed451bf3ec2b1e42df49a8a09a7a0
Parents: 42a4d2b
Author: lahiru <la...@apache.org>
Authored: Thu Apr 3 10:05:23 2014 -0400
Committer: lahiru <la...@apache.org>
Committed: Thu Apr 3 10:05:23 2014 -0400
----------------------------------------------------------------------
modules/gfac/gfac-core/pom.xml | 13 -
.../gfac/services/impl/AbstractBESTest.java | 173 --------
.../gfac/services/impl/BESParallelJobTest.java | 141 ------
.../gfac/services/impl/BESProviderTest.java | 211 ---------
.../core/gfac/services/impl/BigRed2Test.java | 214 ---------
.../gfac/services/impl/GFacBaseTestCase.java | 115 -----
.../gfac/services/impl/GSISSHProviderTest.java | 208 ---------
.../gfac/services/impl/GramProviderTest.java | 225 ----------
.../gfac/services/impl/JSDLGeneratorTest.java | 318 --------------
.../core/gfac/services/impl/ParamChemTest.java | 306 -------------
.../gfac/services/impl/SSHProviderTest.java | 172 --------
.../core/gfac/services/impl/US3Test.java | 152 -------
.../security/GSISecurityContextTest.java | 174 --------
.../gfac/provider/impl/GramProviderTest.java | 61 ---
modules/gfac/gfac-ec2/pom.xml | 19 -
modules/gfac/gfac-monitor/pom.xml | 17 +-
modules/integration-tests/pom.xml | 55 ---
.../client/OrchestratorClientFactoryTest.java | 22 +-
.../orchestrator/client/util/Initialize.java | 332 ++++++++++++++
.../test/resources/airavata-server.properties | 33 +-
.../src/test/resources/registry-derby.sql | 391 +++++++++++++++++
modules/orchestrator/orchestrator-core/pom.xml | 11 -
modules/registry/airavata-jpa-registry/pom.xml | 108 +----
modules/security/pom.xml | 19 -
modules/server/pom.xml | 20 -
.../workflow-model-component-node/pom.xml | 18 -
.../workflow-model-component/pom.xml | 19 +-
.../workflow-model/workflow-model-core/pom.xml | 18 -
modules/xbaya-gui/pom.xml | 17 -
pom.xml | 266 +++++++++++-
samples/provenance-registry-handler/pom.xml | 21 -
tools/gsissh/pom.xml | 12 -
.../airavata/gsi/ssh/config/SCPFromTest.java | 74 ----
.../airavata/gsi/ssh/config/SCPToTest.java | 75 ----
.../gsi/ssh/impl/DefaultSSHApiTest.java | 433 -------------------
.../airavata/gsi/ssh/impl/VanilaSSHTest.java | 220 ----------
tools/job-monitor/pom.xml | 9 -
37 files changed, 1051 insertions(+), 3641 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c555455/modules/gfac/gfac-core/pom.xml
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/pom.xml b/modules/gfac/gfac-core/pom.xml
index 070f16c..954fd22 100644
--- a/modules/gfac/gfac-core/pom.xml
+++ b/modules/gfac/gfac-core/pom.xml
@@ -253,19 +253,6 @@
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <!--skip>true</skip -->
- <excludes>
- <exclude>**/services/**</exclude>
- <exclude>**/gfac/**</exclude>
- </excludes>
- <forkMode>always</forkMode>
- <failIfNoTests>false</failIfNoTests>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c555455/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/AbstractBESTest.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/AbstractBESTest.java b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/AbstractBESTest.java
deleted file mode 100644
index efbd164..0000000
--- a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/AbstractBESTest.java
+++ /dev/null
@@ -1,173 +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.core.gfac.services.impl;
-
-import java.io.File;
-import java.net.URL;
-import java.util.Date;
-import java.util.Random;
-import java.util.UUID;
-
-import org.apache.airavata.commons.gfac.type.ApplicationDescription;
-import org.apache.airavata.commons.gfac.type.HostDescription;
-import org.apache.airavata.commons.gfac.type.ServiceDescription;
-import org.apache.airavata.credential.store.store.CredentialReader;
-import org.apache.airavata.credential.store.store.impl.CredentialReaderImpl;
-import org.apache.airavata.gfac.GFacConfiguration;
-import org.apache.airavata.gfac.RequestData;
-import org.apache.airavata.gfac.context.ApplicationContext;
-import org.apache.airavata.gfac.context.JobExecutionContext;
-import org.apache.airavata.gfac.context.MessageContext;
-import org.apache.airavata.gfac.context.security.GSISecurityContext;
-import org.apache.airavata.schemas.gfac.JobTypeType;
-import org.apache.airavata.schemas.gfac.UnicoreHostType;
-import org.apache.airavata.schemas.wec.ContextHeaderDocument;
-import org.apache.airavata.schemas.wec.ContextHeaderDocument.ContextHeader;
-import org.apache.log4j.PropertyConfigurator;
-
-public abstract class AbstractBESTest extends GFacBaseTestCase {
-
- protected static String tmpFilePath = "target"+File.separator+"data";
- protected JobExecutionContext jobExecutionContext;
- private String userName = "";
-
-// public static final String[] hostArray = new String[] { "https://zam1161v01.zam.kfa-juelich.de:8002/INTEROP1/services/BESFactory?res=default_bes_factory" };
-
- public static final String[] hostArray = new String[] {
- "https://deisa-unic.fz-juelich.de:9111/FZJ_JUROPA/services/BESFactory?res=default_bes_factory"
- };
-
-
-// public static final String[] hostArray = new String[] {
-// "https://daemon.alamo.futuregrid.org:8082/ALAMO/services/BESFactory?res=default_bes_factory"
-// };
-
-// public static final String[] hostArray = new String[] {
-// "https://daemon.india.futuregrid.org:8081/INDIA/services/BESFactory?res=default_bes_factory"
-// };
-
-
- // directory where data will be copy into and copied out to unicore
- // resources
-
- // public static final String gridftpAddress =
- // "gsiftp://gridftp1.ls4.tacc.utexas.edu:2811";
- // public static final String scratchDir = "/scratch/01129/tg804076/";
-
- // public static final String gridftpAddress =
- // "gsiftp://gridftp.psc.xsede.org:2811";
- // public static final String scratchDir = "/brashear/msmemon/airavata/";
-
- public static final String gridftpAddress = "gsiftp://osg-xsede.grid.iu.edu:2811/";
- public static final String scratchDir = "/home/ogce/airavata/";
-
- protected String remoteTempDir = null;
-
- protected void initTest() throws Exception {
- PropertyConfigurator.configure("src/test/resources/logging.properties");
- /*
- * Default tmp location
- */
- String date = (new Date()).toString();
- date = date.replaceAll(" ", "_");
- date = date.replaceAll(":", "_");
-
- remoteTempDir = scratchDir + File.separator + "BESJOB" + "_" + date
- + "_" + UUID.randomUUID();
- jobExecutionContext = new JobExecutionContext(getGFACConfig(),
- getServiceDesc("BES-APP-Service").getType().getName());
- jobExecutionContext.setApplicationContext(getApplicationContext());
- jobExecutionContext.setInMessageContext(getInMessageContext());
- jobExecutionContext.setOutMessageContext(getOutMessageContext());
- jobExecutionContext.addSecurityContext(
- GSISecurityContext.GSI_SECURITY_CONTEXT, getSecurityContext());
-
- }
-
- protected void submitJob() throws Exception {
-// ContextHeader contextHeader = ContextHeader.Factory.newInstance();
-// buildOutputLocation(contextHeader);
-//
-// buildUserName(contextHeader, userName);
-// jobExecutionContext.setContextHeader(contextHeader);
- }
-
- protected GFacConfiguration getGFACConfig() throws Exception {
- URL resource = this.getClass().getClassLoader()
- .getResource(org.apache.airavata.common.utils.Constants.GFAC_CONFIG_XML);
- System.out.println(resource.getFile());
- return GFacConfiguration.create(new File(resource.getPath()), null,
- null);
- }
-
- protected ApplicationContext getApplicationContext() {
- ApplicationContext applicationContext = new ApplicationContext();
- applicationContext.setHostDescription(getHostDesc());
- return applicationContext;
- }
-
- protected HostDescription getHostDesc() {
- HostDescription host = new HostDescription(UnicoreHostType.type);
- host.getType().setHostAddress("zam1161v01.zam.kfa-juelich.de");
- host.getType().setHostName("DEMO-INTEROP-SITE");
- ((UnicoreHostType) host.getType())
- .setUnicoreBESEndPointArray(hostArray);
- ((UnicoreHostType) host.getType())
- .setGridFTPEndPointArray(new String[] { gridftpAddress });
- return host;
- }
-
- protected abstract ApplicationDescription getApplicationDesc(
- JobTypeType jobType);
-
- protected ServiceDescription getServiceDesc(String serviceName) {
- ServiceDescription serv = new ServiceDescription();
- serv.getType().setName(serviceName);
- return serv;
- }
-
- protected abstract MessageContext getInMessageContext();
-
- protected abstract MessageContext getOutMessageContext();
-
-
- protected void buildOutputLocation(ContextHeader currentContextHeader) {
- File tmpDir = new File(tmpFilePath+File.separator+"output-"+new Random().nextInt(1000));
-
- if(!tmpDir.exists()) {
- tmpDir.mkdirs();
- }
- currentContextHeader.addNewWorkflowOutputDataHandling().addNewApplicationOutputDataHandling().setOutputDataDirectory(tmpDir.getAbsolutePath());
-
- }
-
-
- protected void buildUserName(ContextHeader currentContextHeader, String userName) {
- if("".equals(userName) || userName == null) return;
-
- currentContextHeader.setUserIdentifier(userName);
- }
-
- public void setUserName(String userName) {
- this.userName = userName;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c555455/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/BESParallelJobTest.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/BESParallelJobTest.java b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/BESParallelJobTest.java
deleted file mode 100644
index 86febf5..0000000
--- a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/BESParallelJobTest.java
+++ /dev/null
@@ -1,141 +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.core.gfac.services.impl;
-
-import java.io.File;
-import java.util.Date;
-import java.util.UUID;
-
-import org.apache.airavata.commons.gfac.type.ApplicationDescription;
-import org.apache.airavata.gfac.context.ApplicationContext;
-import org.apache.airavata.gfac.context.MessageContext;
-import org.apache.airavata.gfac.cpi.GFacImpl;
-import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
-import org.apache.airavata.schemas.gfac.ExtendedKeyValueType;
-import org.apache.airavata.schemas.gfac.HpcApplicationDeploymentType;
-import org.apache.airavata.schemas.gfac.JobTypeType;
-import org.junit.Before;
-import org.junit.Test;
-
-public class BESParallelJobTest extends AbstractBESTest{
-
-
- @Before
- public void initJobContext() throws Exception {
- initTest();
- }
-
-
- @Test
- public void submitJob() throws Exception {
- JobTypeType jobType = JobTypeType.Factory.newInstance();
- jobType.set(JobTypeType.MPI);
- ApplicationContext appContext = getApplicationContext();
- appContext.setApplicationDeploymentDescription(getApplicationDesc(jobType));
- jobExecutionContext.setApplicationContext(appContext);
- GFacImpl gFacAPI = new GFacImpl();
- gFacAPI.submitJob(jobExecutionContext);
- }
-
-
- protected ApplicationDescription getApplicationDesc(JobTypeType jobType) {
- ApplicationDescription appDesc = new ApplicationDescription(
- HpcApplicationDeploymentType.type);
- HpcApplicationDeploymentType appDepType = (HpcApplicationDeploymentType) appDesc
- .getType();
- ApplicationDeploymentDescriptionType.ApplicationName name = ApplicationDeploymentDescriptionType.ApplicationName.Factory
- .newInstance();
- name.setStringValue("MPIRemote");
- appDepType.setApplicationName(name);
-// ProjectAccountType projectAccountType = appDepType.addNewProjectAccount();
-// projectAccountType.setProjectAccountNumber("TG-AST110064");
-
-// QueueType queueType = appDepType.addNewQueue();
-// queueType.setQueueName("development");
-
- // TODO: also handle parallel jobs
- if((jobType.enumValue() == JobTypeType.SERIAL) || (jobType.enumValue() == JobTypeType.SINGLE)) {
- appDepType.setJobType(JobTypeType.SERIAL);
- }
- else if (jobType.enumValue() == JobTypeType.MPI) {
- appDepType.setJobType(JobTypeType.MPI);
- }
- else {
- appDepType.setJobType(JobTypeType.OPEN_MP);
- }
-
- appDepType.setNodeCount(1);
- appDepType.setProcessorsPerNode(1);
-
- /*
- * Use bat file if it is compiled on Windows
- */
- appDepType.setExecutableLocation("/home/bes/mpiexamples/a.out");
-
-// appDepType.setExecutableLocation("/lustre/jhome11/zam/m.memon/mpiexamples");
-
-
-
- ExtendedKeyValueType extKV = appDepType.addNewKeyValuePairs();
- // using jsdl spmd standard
- extKV.setName("NumberOfProcesses");
- // this will be transformed into mpiexec -n 4
- extKV.setStringValue("1");
-
- /*
- * Default tmp location
- */
- String date = (new Date()).toString();
- date = date.replaceAll(" ", "_");
- date = date.replaceAll(":", "_");
-
- String remoteTempDir = scratchDir + File.separator + "SimpleEcho" + "_" + date + "_"
- + UUID.randomUUID();
-
- System.out.println(remoteTempDir);
-
- // no need of these parameters, as unicore manages by itself
- appDepType.setScratchWorkingDirectory(remoteTempDir);
- appDepType.setStaticWorkingDirectory(remoteTempDir);
- appDepType.setInputDataDirectory(remoteTempDir + File.separator + "inputData");
- appDepType.setOutputDataDirectory(remoteTempDir + File.separator + "outputData");
-
- appDepType.setStandardOutput(appDepType.getOutputDataDirectory()+"/jsdl_stdout");
-
- appDepType.setStandardError(appDepType.getOutputDataDirectory()+"/jsdl_stderr");
-
- return appDesc;
- }
- protected MessageContext getInMessageContext() {
- MessageContext inMessage = new MessageContext();
- return inMessage;
- }
-
-
-
- protected MessageContext getOutMessageContext() {
- MessageContext outMessage = new MessageContext();
- return outMessage;
- }
-
-
-
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c555455/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/BESProviderTest.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/BESProviderTest.java b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/BESProviderTest.java
deleted file mode 100644
index 900449c..0000000
--- a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/BESProviderTest.java
+++ /dev/null
@@ -1,211 +0,0 @@
-package org.apache.airavata.core.gfac.services.impl;
-
-/*
-*
-* 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.
-*
-*/
-import static org.junit.Assert.assertTrue;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Random;
-import java.util.UUID;
-
-import org.apache.airavata.commons.gfac.type.ActualParameter;
-import org.apache.airavata.commons.gfac.type.ApplicationDescription;
-import org.apache.airavata.commons.gfac.type.ServiceDescription;
-import org.apache.airavata.gfac.GFacException;
-import org.apache.airavata.gfac.context.ApplicationContext;
-import org.apache.airavata.gfac.context.MessageContext;
-import org.apache.airavata.gfac.cpi.GFacImpl;
-import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
-import org.apache.airavata.schemas.gfac.HpcApplicationDeploymentType;
-import org.apache.airavata.schemas.gfac.InputParameterType;
-import org.apache.airavata.schemas.gfac.JobTypeType;
-import org.apache.airavata.schemas.gfac.OutputParameterType;
-import org.apache.airavata.schemas.gfac.ProjectAccountType;
-import org.apache.airavata.schemas.gfac.StringParameterType;
-import org.apache.airavata.schemas.gfac.URIParameterType;
-import org.apache.commons.io.FileUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class BESProviderTest extends AbstractBESTest{
-
- private String tmpFilePath;
-
- @Before
- public void initJobContext() throws Exception {
- initTest();
- }
-
- @Test
- public void submitJob() throws GFacException {
- JobTypeType jobType = JobTypeType.Factory.newInstance();
- jobType.set(JobTypeType.SERIAL);
- ApplicationContext appContext = getApplicationContext();
- appContext.setApplicationDeploymentDescription(getApplicationDesc(jobType));
- jobExecutionContext.setApplicationContext(appContext);
-
- GFacImpl gFacAPI = new GFacImpl();
- gFacAPI.submitJob(jobExecutionContext);
- }
-
-
- protected ApplicationDescription getApplicationDesc(JobTypeType jobType) {
- ApplicationDescription appDesc = new ApplicationDescription(
- HpcApplicationDeploymentType.type);
- HpcApplicationDeploymentType app = (HpcApplicationDeploymentType) appDesc
- .getType();
- ApplicationDeploymentDescriptionType.ApplicationName name = ApplicationDeploymentDescriptionType.ApplicationName.Factory
- .newInstance();
- name.setStringValue("CatRemote");
- app.setApplicationName(name);
- ProjectAccountType projectAccountType = app.addNewProjectAccount();
- projectAccountType.setProjectAccountNumber("TG-AST110064");
-
- app.setCpuCount(1);
- // TODO: also handle parallel jobs
- if((jobType.enumValue() == JobTypeType.SERIAL) || (jobType.enumValue() == JobTypeType.SINGLE)) {
- app.setJobType(JobTypeType.SERIAL);
- }
- else if (jobType.enumValue() == JobTypeType.MPI) {
- app.setJobType(JobTypeType.MPI);
- }
- else {
- app.setJobType(JobTypeType.OPEN_MP);
- }
-
- app.setNodeCount(1);
- app.setProcessorsPerNode(1);
-
- /*
- * Use bat file if it is compiled on Windows
- */
- app.setExecutableLocation("/bin/cat");
-
-
- /*
- * Default tmp location
- */
- String date = (new Date()).toString();
- date = date.replaceAll(" ", "_");
- date = date.replaceAll(":", "_");
-
- String remoteTempDir = scratchDir + File.separator + "SimpleCat" + "_" + date + "_"
- + UUID.randomUUID();
-
- System.out.println(remoteTempDir);
-
- // no need of these parameters, as unicore manages by itself
- app.setScratchWorkingDirectory(remoteTempDir);
- app.setStaticWorkingDirectory(remoteTempDir);
- app.setInputDataDirectory(remoteTempDir + File.separator + "inputData");
- app.setOutputDataDirectory(remoteTempDir + File.separator + "outputData");
-
- app.setStandardOutput(app.getOutputDataDirectory()+"/jsdl_stdout");
-
- app.setStandardError(app.getOutputDataDirectory()+"/jsdl_stderr");
-
- return appDesc;
- }
-
- protected ServiceDescription getServiceDesc() {
- ServiceDescription serv = new ServiceDescription();
- serv.getType().setName("SimpleCat");
-
- List<InputParameterType> inputList = new ArrayList<InputParameterType>();
- InputParameterType input = InputParameterType.Factory.newInstance();
- input.setParameterName("copy_input");
- input.setParameterType(URIParameterType.Factory.newInstance());
- inputList.add(input);
- InputParameterType[] inputParamList = inputList
- .toArray(new InputParameterType[inputList.size()]);
-
- List<OutputParameterType> outputList = new ArrayList<OutputParameterType>();
- OutputParameterType output = OutputParameterType.Factory.newInstance();
- output.setParameterName("echo_output");
- output.setParameterType(StringParameterType.Factory.newInstance());
- outputList.add(output);
- OutputParameterType[] outputParamList = outputList
- .toArray(new OutputParameterType[outputList.size()]);
-
- serv.getType().setInputParametersArray(inputParamList);
- serv.getType().setOutputParametersArray(outputParamList);
- return serv;
- }
-
- protected MessageContext getInMessageContext() {
-
- File tmpFile = new File("target"+File.separator+"tmp-"+new Random().nextInt(5));
- try {
- FileUtils.touch(tmpFile);
- FileUtils.writeStringToFile(tmpFile, "tmp contents", "UTF-8");
- tmpFilePath = tmpFile.getAbsolutePath();
- } catch (Exception e) {
- assertTrue(false);
- }
-
- MessageContext inMessage = new MessageContext();
-
- ActualParameter copy_input = new ActualParameter();
- copy_input.getType().changeType(URIParameterType.type);
- ((URIParameterType)copy_input.getType()).setValue("file:///"+tmpFile.getAbsolutePath());
- inMessage.addParameter("f1", copy_input);
-
- ActualParameter f2 = new ActualParameter();
- f2.getType().changeType(URIParameterType.type);
- ((URIParameterType)f2.getType()).setValue("http://unicore-dev.zam.kfa-juelich.de/maven/cog-globus/cog-jglobus/1.4/cog-jglobus-1.4.jar");
- inMessage.addParameter("f2", f2);
-
-
- ActualParameter a1 = new ActualParameter();
- a1.getType().changeType(StringParameterType.type);
- ((StringParameterType)a1.getType()).setValue(tmpFile.getName());
- inMessage.addParameter("arg1", a1);
-
- return inMessage;
- }
-
- protected MessageContext getOutMessageContext() {
-
- MessageContext outMessage = new MessageContext();
- ActualParameter a1 = new ActualParameter();
- a1.getType().changeType(StringParameterType.type);
- ((StringParameterType)a1.getType()).setValue(new File(tmpFilePath).getName());
- outMessage.addParameter("echo_output", a1);
-
- ActualParameter o1 = new ActualParameter();
- o1.getType().changeType(URIParameterType.type);
- // this may be any gridftp / ftp directory
- ((URIParameterType)o1.getType()).setValue(gridftpAddress+"/"+remoteTempDir + "/" + "outputData"+"/"+"cog-jglobus-1.4.jar");
- outMessage.addParameter("o1", o1);
-
- return outMessage;
- }
-
- @After
- public void cleanData(){
- FileUtils.deleteQuietly(new File(tmpFilePath));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c555455/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/BigRed2Test.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/BigRed2Test.java b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/BigRed2Test.java
deleted file mode 100644
index feeefe2..0000000
--- a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/BigRed2Test.java
+++ /dev/null
@@ -1,214 +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.core.gfac.services.impl;
-
-import org.apache.airavata.commons.gfac.type.ActualParameter;
-import org.apache.airavata.commons.gfac.type.ApplicationDescription;
-import org.apache.airavata.commons.gfac.type.HostDescription;
-import org.apache.airavata.commons.gfac.type.ServiceDescription;
-import org.apache.airavata.gfac.GFacConfiguration;
-import org.apache.airavata.gfac.GFacException;
-import org.apache.airavata.gfac.SecurityContext;
-import org.apache.airavata.gfac.context.ApplicationContext;
-import org.apache.airavata.gfac.context.JobExecutionContext;
-import org.apache.airavata.gfac.context.MessageContext;
-import org.apache.airavata.gfac.context.security.SSHSecurityContext;
-import org.apache.airavata.gfac.cpi.GFacImpl;
-import org.apache.airavata.gsi.ssh.api.Cluster;
-import org.apache.airavata.gsi.ssh.api.SSHApiException;
-import org.apache.airavata.gsi.ssh.api.ServerInfo;
-import org.apache.airavata.gsi.ssh.api.authentication.AuthenticationInfo;
-import org.apache.airavata.gsi.ssh.api.job.JobManagerConfiguration;
-import org.apache.airavata.gsi.ssh.api.job.PBSJobConfiguration;
-import org.apache.airavata.gsi.ssh.impl.PBSCluster;
-import org.apache.airavata.gsi.ssh.impl.authentication.DefaultPasswordAuthenticationInfo;
-import org.apache.airavata.gsi.ssh.util.CommonUtils;
-import org.apache.airavata.schemas.gfac.*;
-import org.junit.Before;
-import org.junit.Test;
-
-import java.io.File;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.UUID;
-
-public class BigRed2Test {
- private JobExecutionContext jobExecutionContext;
-
- private static final String hostAddress = "bigred2";
- private static final String hostName = "bigred2.uits.iu.edu";
- private static String userName = "lginnali";
- private static String password = "";
-
- @Before
- public void setUp() throws Exception {
-
- if(System.getProperty("bigred2.password") == null || System.getProperty("bigred2.username") == null){
- System.out.println("set the bigred2 password/username in maven command : mvn clean install -Dbigred2.username=xxx -Dbigred2.password=yyy");
- throw new Exception("Wrong inputs given");
- }
- userName = System.getProperty("bigred2.username");
- password = System.getProperty("bigred2.password");
- URL resource = GramProviderTest.class.getClassLoader().getResource(org.apache.airavata.common.utils.Constants.GFAC_CONFIG_XML);
- assert resource != null;
- System.out.println(resource.getFile());
- GFacConfiguration gFacConfiguration = GFacConfiguration.create(new File(resource.getPath()), null, null);
-
-// gFacConfiguration.setMyProxyLifeCycle(3600);
-// gFacConfiguration.setMyProxyServer("myproxy.teragrid.org");
-// gFacConfiguration.setMyProxyUser("*****");
-// gFacConfiguration.setMyProxyPassphrase("*****");
-// gFacConfiguration.setTrustedCertLocation("./certificates");
-// //have to set InFlwo Handlers and outFlowHandlers
-// gFacConfiguration.setInHandlers(Arrays.asList(new String[] {"org.apache.airavata.gfac.handler.GramDirectorySetupHandler","org.apache.airavata.gfac.handler.GridFTPInputHandler"}));
-// gFacConfiguration.setOutHandlers(Arrays.asList(new String[] {"org.apache.airavata.gfac.handler.GridFTPOutputHandler"}));
-
- /*
- * Host
- */
- HostDescription host = new HostDescription(SSHHostType.type);
- host.getType().setHostAddress(hostAddress);
- host.getType().setHostName(hostName);
- ((SSHHostType)host.getType()).setHpcResource(true);
- /*
- * App
- */
- ApplicationDescription appDesc = new ApplicationDescription(HpcApplicationDeploymentType.type);
- HpcApplicationDeploymentType app = (HpcApplicationDeploymentType) appDesc.getType();
- ApplicationDeploymentDescriptionType.ApplicationName name = ApplicationDeploymentDescriptionType.ApplicationName.Factory.newInstance();
- name.setStringValue("EchoLocal");
- app.setApplicationName(name);
-
- app.setCpuCount(1);
- app.setJobType(JobTypeType.SERIAL);
- app.setNodeCount(1);
- app.setProcessorsPerNode(1);
-
- /*
- * Use bat file if it is compiled on Windows
- */
- app.setExecutableLocation("/bin/echo");
-
- /*
- * Default tmp location
- */
- String tempDir = "~/";
- String date = (new Date()).toString();
- date = date.replaceAll(" ", "_");
- date = date.replaceAll(":", "_");
-
- tempDir = tempDir + File.separator
- + "SimpleEcho" + "_" + date + "_" + UUID.randomUUID();
-
- System.out.println(tempDir);
- app.setScratchWorkingDirectory(tempDir);
- app.setStaticWorkingDirectory(tempDir);
- app.setInputDataDirectory(tempDir + File.separator + "inputData");
- app.setOutputDataDirectory(tempDir + File.separator + "outputData");
- app.setStandardOutput(tempDir + File.separator + app.getApplicationName().getStringValue() + ".stdout");
- app.setStandardError(tempDir + File.separator + app.getApplicationName().getStringValue() + ".stderr");
- app.setMaxWallTime(5);
- app.setJobSubmitterCommand("aprun -n 1");
- app.setInstalledParentPath("/opt/torque/torque-4.2.3.1/bin/");
-
- /*
- * Service
- */
- ServiceDescription serv = new ServiceDescription();
- serv.getType().setName("SimpleEcho");
-
- List<InputParameterType> inputList = new ArrayList<InputParameterType>();
-
- InputParameterType input = InputParameterType.Factory.newInstance();
- input.setParameterName("echo_input");
- input.setParameterType(StringParameterType.Factory.newInstance());
- inputList.add(input);
-
- InputParameterType[] inputParamList = inputList.toArray(new InputParameterType[inputList
-
- .size()]);
- List<OutputParameterType> outputList = new ArrayList<OutputParameterType>();
- OutputParameterType output = OutputParameterType.Factory.newInstance();
- output.setParameterName("echo_output");
- output.setParameterType(StringParameterType.Factory.newInstance());
- outputList.add(output);
-
- OutputParameterType[] outputParamList = outputList
- .toArray(new OutputParameterType[outputList.size()]);
-
- serv.getType().setInputParametersArray(inputParamList);
- serv.getType().setOutputParametersArray(outputParamList);
-
- jobExecutionContext = new JobExecutionContext(gFacConfiguration, serv.getType().getName());
- // Adding security context
- jobExecutionContext.addSecurityContext(SSHSecurityContext.SSH_SECURITY_CONTEXT, getSecurityContext(app));
- ApplicationContext applicationContext = new ApplicationContext();
- jobExecutionContext.setApplicationContext(applicationContext);
- applicationContext.setServiceDescription(serv);
- applicationContext.setApplicationDeploymentDescription(appDesc);
- applicationContext.setHostDescription(host);
-
- MessageContext inMessage = new MessageContext();
- ActualParameter echo_input = new ActualParameter();
- ((StringParameterType) echo_input.getType()).setValue("echo_output=hello");
- inMessage.addParameter("echo_input", echo_input);
-
-
- jobExecutionContext.setInMessageContext(inMessage);
-
- MessageContext outMessage = new MessageContext();
- ActualParameter echo_out = new ActualParameter();
-// ((StringParameterType)echo_input.getType()).setValue("echo_output=hello");
- outMessage.addParameter("echo_output", echo_out);
-
- jobExecutionContext.setOutMessageContext( outMessage);
-
- }
-
- private SecurityContext getSecurityContext(HpcApplicationDeploymentType app) {
- AuthenticationInfo authenticationInfo = new DefaultPasswordAuthenticationInfo(this.password);
- // Server info
- ServerInfo serverInfo = new ServerInfo(this.userName, this.hostName);
-
- Cluster pbsCluster = null;
- try {
- JobManagerConfiguration pbsJobManager = CommonUtils.getPBSJobManager(app.getInstalledParentPath());
- pbsCluster = new PBSCluster(serverInfo, authenticationInfo,pbsJobManager);
- } catch (SSHApiException e) {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- }
-
-
- SSHSecurityContext sshSecurityContext = new SSHSecurityContext();
- sshSecurityContext.setPbsCluster(pbsCluster);
- sshSecurityContext.setUsername(userName);
- return sshSecurityContext;
- }
-
- @Test
- public void testGramProvider() throws GFacException {
- GFacImpl gFacAPI = new GFacImpl();
- gFacAPI.submitJob(jobExecutionContext);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c555455/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/GFacBaseTestCase.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/GFacBaseTestCase.java b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/GFacBaseTestCase.java
deleted file mode 100644
index ed9f920..0000000
--- a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/GFacBaseTestCase.java
+++ /dev/null
@@ -1,115 +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.core.gfac.services.impl;
-
-import junit.framework.Assert;
-import org.apache.airavata.common.utils.AiravataUtils;
-import org.apache.airavata.common.utils.DatabaseTestCases;
-import org.apache.airavata.common.utils.DerbyUtil;
-import org.apache.airavata.credential.store.store.CredentialReader;
-import org.apache.airavata.credential.store.store.impl.CredentialReaderImpl;
-import org.apache.airavata.gfac.RequestData;
-import org.apache.airavata.gfac.context.security.GSISecurityContext;
-import org.apache.log4j.Logger;
-import org.junit.BeforeClass;
-
-/**
- * User: AmilaJ (amilaj@apache.org)
- * Date: 7/11/13
- * Time: 1:31 AM
- */
-
-public class GFacBaseTestCase extends DatabaseTestCases {
-
- private static String myProxyUserName;
- private static String myProxyPassword;
-
- private static final Logger log = Logger.getLogger(GFacBaseTestCase.class);
-
-
- @BeforeClass
- public static void setUpClass() throws Exception {
- AiravataUtils.setExecutionAsServer();
-
- myProxyUserName = System.getProperty("myproxy.user");
- myProxyPassword = System.getProperty("myproxy.password");
-
- if (userName == null || password == null || userName.trim().equals("") || password.trim().equals("")) {
- log.error("===== Please set myproxy.user and myproxy.password system properties. =======");
- Assert.fail("Please set myproxy.user and myproxy.password system properties.");
- }
-
- log.info("Using my proxy user name - " + userName);
-
- setUpDatabase();
-
- }
-
-
-
-
- public static void setUpDatabase() throws Exception {
- DerbyUtil.startDerbyInServerMode(getHostAddress(), getPort(), getUserName(), getPassword());
-
- waitTillServerStarts();
-
- /*
- * String createTable = "CREATE TABLE CREDENTIALS\n" + "(\n" + " GATEWAY_NAME VARCHAR(256) NOT NULL,\n" +
- * " COMMUNITY_USER_NAME VARCHAR(256) NOT NULL,\n" + " CREDENTIAL BLOB NOT NULL,\n" +
- * " PRIVATE_KEY BLOB NOT NULL,\n" + " NOT_BEFORE VARCHAR(256) NOT NULL,\n" +
- * " NOT_AFTER VARCHAR(256) NOT NULL,\n" + " LIFETIME INTEGER NOT NULL,\n" +
- * " REQUESTING_PORTAL_USER_NAME VARCHAR(256) NOT NULL,\n" +
- * " REQUESTED_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',\n" +
- * " PRIMARY KEY (GATEWAY_NAME, COMMUNITY_USER_NAME)\n" + ")";
- */
-
- String createTable = "CREATE TABLE CREDENTIALS\n" + "(\n"
- + " GATEWAY_ID VARCHAR(256) NOT NULL,\n"
- + " TOKEN_ID VARCHAR(256) NOT NULL,\n"
- + // Actual token used to identify the credential
- " CREDENTIAL BLOB NOT NULL,\n" + " PORTAL_USER_ID VARCHAR(256) NOT NULL,\n"
- + " TIME_PERSISTED TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n"
- + " PRIMARY KEY (GATEWAY_ID, TOKEN_ID)\n" + ")";
-
- String dropTable = "drop table CREDENTIALS";
-
- try {
- executeSQL(dropTable);
- } catch (Exception e) {
- }
-
- executeSQL(createTable);
-
- }
-
- public GSISecurityContext getSecurityContext() throws Exception {
- GSISecurityContext.setUpTrustedCertificatePath("/Users/raminder/.globus/certificates");
- RequestData requestData = new RequestData();
- requestData.setMyProxyServerUrl("myproxy.teragrid.org");
- requestData.setMyProxyUserName("******");
- requestData.setMyProxyPassword("*******");
- requestData.setMyProxyLifeTime(3600);
- CredentialReader credentialReader = new CredentialReaderImpl(getDbUtil());
- return new GSISecurityContext(credentialReader, requestData);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c555455/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/GSISSHProviderTest.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/GSISSHProviderTest.java b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/GSISSHProviderTest.java
deleted file mode 100644
index 1041540..0000000
--- a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/GSISSHProviderTest.java
+++ /dev/null
@@ -1,208 +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.core.gfac.services.impl;
-
-import org.apache.airavata.commons.gfac.type.ActualParameter;
-import org.apache.airavata.commons.gfac.type.ApplicationDescription;
-import org.apache.airavata.commons.gfac.type.HostDescription;
-import org.apache.airavata.commons.gfac.type.ServiceDescription;
-import org.apache.airavata.gfac.GFacConfiguration;
-import org.apache.airavata.gfac.GFacException;
-import org.apache.airavata.gfac.SecurityContext;
-import org.apache.airavata.gfac.context.ApplicationContext;
-import org.apache.airavata.gfac.context.JobExecutionContext;
-import org.apache.airavata.gfac.context.MessageContext;
-import org.apache.airavata.gfac.context.security.GSISecurityContext;
-import org.apache.airavata.gfac.context.security.SSHSecurityContext;
-import org.apache.airavata.gfac.cpi.GFacImpl;
-import org.apache.airavata.gsi.ssh.api.Cluster;
-import org.apache.airavata.gsi.ssh.api.SSHApiException;
-import org.apache.airavata.gsi.ssh.api.ServerInfo;
-import org.apache.airavata.gsi.ssh.api.authentication.GSIAuthenticationInfo;
-import org.apache.airavata.gsi.ssh.impl.PBSCluster;
-import org.apache.airavata.gsi.ssh.impl.authentication.MyProxyAuthenticationInfo;
-import org.apache.airavata.gsi.ssh.util.CommonUtils;
-import org.apache.airavata.schemas.gfac.*;
-import org.junit.Before;
-import org.junit.Test;
-
-import java.io.File;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.UUID;
-
-public class GSISSHProviderTest {
- private JobExecutionContext jobExecutionContext;
-
- //FIXME: move job properties to configuration file
- private static final String hostAddress = "trestles.sdsc.edu";
- private static final String hostName = "trestles";
- private static final String myProxyUserName = "ogce";
- private static final String myProxyPassword = "";
- private static final String certificateLocation = "/Users/raminder/.globus/certificates/";
-
- @Before
- public void setUp() throws Exception {
- URL resource = GSISSHProviderTest.class.getClassLoader().getResource(org.apache.airavata.common.utils.Constants.GFAC_CONFIG_XML);
- assert resource != null;
- System.out.println(resource.getFile());
- GFacConfiguration gFacConfiguration = GFacConfiguration.create(new File(resource.getPath()), null, null);
-
-// gFacConfiguration.setMyProxyLifeCycle(3600);
-// gFacConfiguration.setMyProxyServer("myproxy.teragrid.org");
-// gFacConfiguration.setMyProxyUser("*****");
-// gFacConfiguration.setMyProxyPassphrase("*****");
-// gFacConfiguration.setTrustedCertLocation("./certificates");
-// //have to set InFlwo Handlers and outFlowHandlers
-// gFacConfiguration.setInHandlers(Arrays.asList(new String[] {"org.apache.airavata.gfac.handler.GramDirectorySetupHandler","org.apache.airavata.gfac.handler.GridFTPInputHandler"}));
-// gFacConfiguration.setOutHandlers(Arrays.asList(new String[] {"org.apache.airavata.gfac.handler.GridFTPOutputHandler"}));
-
- /*
- * Host
- */
- HostDescription host = new HostDescription(GsisshHostType.type);
- host.getType().setHostAddress(hostAddress);
- host.getType().setHostName(hostName);
-
- /*
- * App
- */
- ApplicationDescription appDesc = new ApplicationDescription(HpcApplicationDeploymentType.type);
- HpcApplicationDeploymentType app = (HpcApplicationDeploymentType) appDesc.getType();
- ApplicationDeploymentDescriptionType.ApplicationName name = ApplicationDeploymentDescriptionType.ApplicationName.Factory.newInstance();
- name.setStringValue("EchoLocal");
- app.setApplicationName(name);
- ProjectAccountType projectAccountType = app.addNewProjectAccount();
- projectAccountType.setProjectAccountNumber("sds128");
-
- QueueType queueType = app.addNewQueue();
- queueType.setQueueName("normal");
-
- app.setCpuCount(1);
- app.setJobType(JobTypeType.SERIAL);
- app.setNodeCount(1);
- app.setProcessorsPerNode(1);
-
- /*
- * Use bat file if it is compiled on Windows
- */
- app.setExecutableLocation("/bin/echo");
-
- /*
- * Default tmp location
- */
- String tempDir = "/home/ogce/scratch/";
- String date = (new Date()).toString();
- date = date.replaceAll(" ", "_");
- date = date.replaceAll(":", "_");
-
- tempDir = tempDir + File.separator
- + "SimpleEcho" + "_" + date + "_" + UUID.randomUUID();
-
- System.out.println(tempDir);
- app.setScratchWorkingDirectory(tempDir);
- app.setStaticWorkingDirectory(tempDir);
- app.setInputDataDirectory(tempDir + File.separator + "inputData");
- app.setOutputDataDirectory(tempDir + File.separator + "outputData");
- app.setStandardOutput(tempDir + File.separator + app.getApplicationName().getStringValue() + ".stdout");
- app.setStandardError(tempDir + File.separator + app.getApplicationName().getStringValue() + ".stderr");
- app.setMaxWallTime(5);
- app.setInstalledParentPath("/opt/torque/bin/");
-
- /*
- * Service
- */
- ServiceDescription serv = new ServiceDescription();
- serv.getType().setName("SimpleEcho");
-
- List<InputParameterType> inputList = new ArrayList<InputParameterType>();
-
- InputParameterType input = InputParameterType.Factory.newInstance();
- input.setParameterName("echo_input");
- input.setParameterType(StringParameterType.Factory.newInstance());
- inputList.add(input);
-
- InputParameterType[] inputParamList = inputList.toArray(new InputParameterType[inputList
-
- .size()]);
- List<OutputParameterType> outputList = new ArrayList<OutputParameterType>();
- OutputParameterType output = OutputParameterType.Factory.newInstance();
- output.setParameterName("echo_output");
- output.setParameterType(StringParameterType.Factory.newInstance());
- outputList.add(output);
-
- OutputParameterType[] outputParamList = outputList
- .toArray(new OutputParameterType[outputList.size()]);
-
- serv.getType().setInputParametersArray(inputParamList);
- serv.getType().setOutputParametersArray(outputParamList);
-
- jobExecutionContext = new JobExecutionContext(gFacConfiguration, serv.getType().getName());
- // Adding security context
- jobExecutionContext.addSecurityContext(SSHSecurityContext.SSH_SECURITY_CONTEXT, getSecurityContext(app));
- ApplicationContext applicationContext = new ApplicationContext();
- jobExecutionContext.setApplicationContext(applicationContext);
- applicationContext.setServiceDescription(serv);
- applicationContext.setApplicationDeploymentDescription(appDesc);
- applicationContext.setHostDescription(host);
-
- MessageContext inMessage = new MessageContext();
- ActualParameter echo_input = new ActualParameter();
- ((StringParameterType) echo_input.getType()).setValue("echo_output=hello");
- inMessage.addParameter("echo_input", echo_input);
-
-
- jobExecutionContext.setInMessageContext(inMessage);
-
- MessageContext outMessage = new MessageContext();
- ActualParameter echo_out = new ActualParameter();
-// ((StringParameterType)echo_input.getType()).setValue("echo_output=hello");
- outMessage.addParameter("echo_output", echo_out);
-
- jobExecutionContext.setOutMessageContext(outMessage);
-
- }
-
- private SecurityContext getSecurityContext(HpcApplicationDeploymentType app) {
- GSIAuthenticationInfo authenticationInfo
- = new MyProxyAuthenticationInfo(myProxyUserName, myProxyPassword, "myproxy.teragrid.org",
- 7512, 17280000, certificateLocation);
-
- // Server info
- ServerInfo serverInfo = new ServerInfo("ogce", "trestles.sdsc.edu");
- Cluster pbsCluster = null;
- try {
- pbsCluster = new PBSCluster(serverInfo, authenticationInfo, CommonUtils.getPBSJobManager(app.getInstalledParentPath()));
- } catch (SSHApiException e) {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- }
- GSISecurityContext sshSecurityContext = new GSISecurityContext(pbsCluster);
- return sshSecurityContext;
- }
- @Test
- public void testGramProvider() throws GFacException {
- GFacImpl gFacAPI = new GFacImpl();
- gFacAPI.submitJob(jobExecutionContext);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c555455/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/GramProviderTest.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/GramProviderTest.java b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/GramProviderTest.java
deleted file mode 100644
index 2852e05..0000000
--- a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/GramProviderTest.java
+++ /dev/null
@@ -1,225 +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.core.gfac.services.impl;
-
-import java.io.File;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.UUID;
-
-import org.apache.airavata.commons.gfac.type.ActualParameter;
-import org.apache.airavata.commons.gfac.type.ApplicationDescription;
-import org.apache.airavata.commons.gfac.type.HostDescription;
-import org.apache.airavata.commons.gfac.type.MappingFactory;
-import org.apache.airavata.commons.gfac.type.ServiceDescription;
-import org.apache.airavata.gfac.GFacConfiguration;
-import org.apache.airavata.gfac.GFacException;
-import org.apache.airavata.gfac.context.ApplicationContext;
-import org.apache.airavata.gfac.context.JobExecutionContext;
-import org.apache.airavata.gfac.context.MessageContext;
-import org.apache.airavata.gfac.context.security.GSISecurityContext;
-import org.apache.airavata.gfac.cpi.GFacImpl;
-import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
-import org.apache.airavata.schemas.gfac.GlobusHostType;
-import org.apache.airavata.schemas.gfac.HpcApplicationDeploymentType;
-import org.apache.airavata.schemas.gfac.InputParameterType;
-import org.apache.airavata.schemas.gfac.JobTypeType;
-import org.apache.airavata.schemas.gfac.OutputParameterType;
-import org.apache.airavata.schemas.gfac.ProjectAccountType;
-import org.apache.airavata.schemas.gfac.QueueType;
-import org.apache.airavata.schemas.gfac.StringParameterType;
-import org.apache.airavata.schemas.gfac.URIParameterType;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-public class GramProviderTest extends GFacBaseTestCase {
- private JobExecutionContext jobExecutionContext;
-
-
-// private static final String hostAddress = "blacklight.psc.teragrid.org";
-// private static final String hostName = "Blacklight";
-// private static final String gridftpAddress = "gsiftp://gridftp.blacklight.psc.teragrid.org:2812";
-// private static final String gramAddress = "";
-
- //FIXME: move job properties to configuration file
- private static final String hostAddress = "trestles.sdsc.edu";
- private static final String hostName = "trestles";
- private static final String gridftpAddress = "gsiftp://trestles.sdsc.edu:2811/";
- private static final String gramAddress = "trestles-login2.sdsc.edu:2119/jobmanager-pbstest2";
-
- @Before
- public void setUp() throws Exception {
- URL resource = GramProviderTest.class.getClassLoader().getResource(org.apache.airavata.common.utils.Constants.GFAC_CONFIG_XML);
- assert resource != null;
- System.out.println(resource.getFile());
- GFacConfiguration gFacConfiguration = GFacConfiguration.create(new File(resource.getPath()),null,null);
-// gFacConfiguration.setMyProxyLifeCycle(3600);
-// gFacConfiguration.setMyProxyServer("myproxy.teragrid.org");
-// gFacConfiguration.setMyProxyUser("*****");
-// gFacConfiguration.setMyProxyPassphrase("*****");
-// gFacConfiguration.setTrustedCertLocation("./certificates");
-// //have to set InFlwo Handlers and outFlowHandlers
-// gFacConfiguration.setInHandlers(Arrays.asList(new String[] {"org.apache.airavata.gfac.handler.GramDirectorySetupHandler","org.apache.airavata.gfac.handler.GridFTPInputHandler"}));
-// gFacConfiguration.setOutHandlers(Arrays.asList(new String[] {"org.apache.airavata.gfac.handler.GridFTPOutputHandler"}));
-
- /*
- * Host
- */
- HostDescription host = new HostDescription(GlobusHostType.type);
- host.getType().setHostAddress(hostAddress);
- host.getType().setHostName(hostName);
- ((GlobusHostType)host.getType()).setGlobusGateKeeperEndPointArray(new String[]{gramAddress});
- ((GlobusHostType)host.getType()).setGridFTPEndPointArray(new String[]{gridftpAddress});
- /*
- * App
- */
- ApplicationDescription appDesc = new ApplicationDescription(HpcApplicationDeploymentType.type);
- HpcApplicationDeploymentType app = (HpcApplicationDeploymentType)appDesc.getType();
- ApplicationDeploymentDescriptionType.ApplicationName name = ApplicationDeploymentDescriptionType.ApplicationName.Factory.newInstance();
- name.setStringValue("EchoLocal");
- app.setApplicationName(name);
- ProjectAccountType projectAccountType = app.addNewProjectAccount();
- projectAccountType.setProjectAccountNumber("sds128");
-
- QueueType queueType = app.addNewQueue();
- queueType.setQueueName("development");
-
- app.setCpuCount(1);
- app.setJobType(JobTypeType.SERIAL);
- app.setNodeCount(1);
- app.setProcessorsPerNode(1);
-
- /*
- * Use bat file if it is compiled on Windows
- */
- app.setExecutableLocation("/bin/echo");
-
- /*
- * Default tmp location
- */
- String tempDir = "/scratch/01437/ogce/test/";
- String date = (new Date()).toString();
- date = date.replaceAll(" ", "_");
- date = date.replaceAll(":", "_");
-
- tempDir = tempDir + File.separator
- + "SimpleEcho" + "_" + date + "_" + UUID.randomUUID();
-
- System.out.println(tempDir);
- app.setScratchWorkingDirectory(tempDir);
- app.setStaticWorkingDirectory(tempDir);
- app.setInputDataDirectory(tempDir + File.separator + "inputData");
- app.setOutputDataDirectory(tempDir + File.separator + "outputData");
- app.setStandardOutput(tempDir + File.separator + app.getApplicationName().getStringValue() + ".stdout");
- app.setStandardError(tempDir + File.separator + app.getApplicationName().getStringValue() + ".stderr");
-
-
- /*
- * Service
- */
- ServiceDescription serv = new ServiceDescription();
- serv.getType().setName("SimpleEcho");
-
- List<InputParameterType> inputList = new ArrayList<InputParameterType>();
-
- InputParameterType input = InputParameterType.Factory.newInstance();
- input.setParameterName("echo_input");
- input.setParameterType(StringParameterType.Factory.newInstance());
- inputList.add(input);
-
- InputParameterType input1 = InputParameterType.Factory.newInstance();
- input.setParameterName("myinput");
- URIParameterType uriType = URIParameterType.Factory.newInstance();
- uriType.setValue("gsiftp://gridftp1.ls4.tacc.utexas.edu:2811//home1/01437/ogce/gram_20130215.log");
- input.setParameterType(uriType);
- inputList.add(input1);
-
-
- InputParameterType[] inputParamList = inputList.toArray(new InputParameterType[inputList
-
- .size()]);
- List<OutputParameterType> outputList = new ArrayList<OutputParameterType>();
- OutputParameterType output = OutputParameterType.Factory.newInstance();
- output.setParameterName("echo_output");
- output.setParameterType(StringParameterType.Factory.newInstance());
- outputList.add(output);
-
- OutputParameterType[] outputParamList = outputList
- .toArray(new OutputParameterType[outputList.size()]);
-
- serv.getType().setInputParametersArray(inputParamList);
- serv.getType().setOutputParametersArray(outputParamList);
-
- jobExecutionContext = new JobExecutionContext(gFacConfiguration,serv.getType().getName());
- // Adding security context
- jobExecutionContext.addSecurityContext(GSISecurityContext.GSI_SECURITY_CONTEXT, getSecurityContext());
- ApplicationContext applicationContext = new ApplicationContext();
- jobExecutionContext.setApplicationContext(applicationContext);
- applicationContext.setServiceDescription(serv);
- applicationContext.setApplicationDeploymentDescription(appDesc);
- applicationContext.setHostDescription(host);
-
- MessageContext inMessage = new MessageContext();
- ActualParameter echo_input = new ActualParameter();
- ((StringParameterType)echo_input.getType()).setValue("echo_output=hello");
- inMessage.addParameter("echo_input", echo_input);
-
- // added extra
- ActualParameter copy_input = new ActualParameter();
- copy_input.getType().changeType(URIParameterType.type);
- ((URIParameterType)copy_input.getType()).setValue("file:///tmp/tmpstrace");
-
- ActualParameter outlocation = new ActualParameter();
- ((StringParameterType)outlocation.getType()).setValue("./outputData/.");
- inMessage.addParameter("copy_input", copy_input);
- inMessage.addParameter("outputlocation", outlocation);
-
- // added extra
-
-
-
- jobExecutionContext.setInMessageContext(inMessage);
-
- MessageContext outMessage = new MessageContext();
- ActualParameter echo_out = new ActualParameter();
-// ((StringParameterType)echo_input.getType()).setValue("echo_output=hello");
- outMessage.addParameter("echo_output", echo_out);
-
- jobExecutionContext.setOutMessageContext(outMessage);
-
- }
-
- @Test
- public void testGramProvider() throws GFacException {
- GFacImpl gFacAPI = new GFacImpl();
- gFacAPI.submitJob(jobExecutionContext);
- MessageContext outMessageContext = jobExecutionContext.getOutMessageContext();
- Assert.assertEquals(MappingFactory.toString((ActualParameter)outMessageContext.getParameter("echo_output")), "hello");
- }
-
- @Test
- public void testGetJdbcUrl() {
- System.out.println(getJDBCUrl());
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c555455/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/JSDLGeneratorTest.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/JSDLGeneratorTest.java b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/JSDLGeneratorTest.java
deleted file mode 100644
index 5e2cf32..0000000
--- a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/JSDLGeneratorTest.java
+++ /dev/null
@@ -1,318 +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.core.gfac.services.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import java.io.File;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.UUID;
-
-import org.apache.airavata.commons.gfac.type.ActualParameter;
-import org.apache.airavata.commons.gfac.type.ApplicationDescription;
-import org.apache.airavata.commons.gfac.type.HostDescription;
-import org.apache.airavata.commons.gfac.type.ServiceDescription;
-import org.apache.airavata.gfac.GFacConfiguration;
-import org.apache.airavata.gfac.context.ApplicationContext;
-import org.apache.airavata.gfac.context.JobExecutionContext;
-import org.apache.airavata.gfac.context.MessageContext;
-import org.apache.airavata.gfac.provider.utils.JSDLGenerator;
-import org.apache.airavata.gfac.provider.utils.JSDLUtils;
-import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
-import org.apache.airavata.schemas.gfac.HpcApplicationDeploymentType;
-import org.apache.airavata.schemas.gfac.InputParameterType;
-import org.apache.airavata.schemas.gfac.JobTypeType;
-import org.apache.airavata.schemas.gfac.OutputParameterType;
-import org.apache.airavata.schemas.gfac.ProjectAccountType;
-import org.apache.airavata.schemas.gfac.QueueType;
-import org.apache.airavata.schemas.gfac.StringParameterType;
-import org.apache.airavata.schemas.gfac.URIParameterType;
-import org.apache.airavata.schemas.gfac.UnicoreHostType;
-import org.apache.log4j.PropertyConfigurator;
-import org.ggf.schemas.jsdl.x2005.x11.jsdl.JobDefinitionDocument;
-import org.junit.Before;
-import org.junit.Test;
-
-public class JSDLGeneratorTest {
-
- public static final String[] hostArray = new String[] { "https://zam1161v01.zam.kfa-juelich.de:8002/INTEROP1/services/BESFactory?res=default_bes_factory" };
- public static final String gridftpAddress = "gsiftp://gridftp.blacklight.psc.teragrid.org:2811";
- public static final String hostAddress = "zam1161v01.zam.kfa-juelich.de";
- public static final String hostName = "DEMO-INTEROP-SITE";
- public static final String scratchDir = "/scratch/msmemon/airavata";
-
- protected JobExecutionContext jobExecutionContext;
-
-
- @Test
- public void testSerialJSDLWithStdout() throws Exception{
-
- JobTypeType jobType = JobTypeType.Factory.newInstance();
- jobType.set(JobTypeType.SERIAL);
- ApplicationContext appContext = getApplicationContext();
- appContext.setApplicationDeploymentDescription(getApplicationDesc(jobType, true));
- jobExecutionContext.setApplicationContext(appContext);
-
- JobDefinitionDocument jobDefDoc = JSDLGenerator.buildJSDLInstance(jobExecutionContext);
-
- assertTrue (jobDefDoc.getJobDefinition().getJobDescription().getApplication().toString().contains("/bin/cat"));
- assertTrue(jobDefDoc.getJobDefinition().getJobDescription().getDataStagingArray().length > 2);
-
- assertTrue(jobDefDoc.getJobDefinition().getJobDescription().getJobIdentification().getJobProjectArray().length > 0);
-
- assertFalse(JSDLUtils.getPOSIXApplication(jobDefDoc.getJobDefinition())==null);
-
- assertEquals("jsdl_stdout", JSDLUtils.getOrCreatePOSIXApplication(jobDefDoc.getJobDefinition()).getOutput().getStringValue().toString());
-
- }
-
- @Test
- public void testSerialJSDLWithoutStdout() throws Exception{
-
- JobTypeType jobType = JobTypeType.Factory.newInstance();
- jobType.set(JobTypeType.SERIAL);
- ApplicationContext appContext = getApplicationContext();
- appContext.setApplicationDeploymentDescription(getApplicationDesc(jobType, false));
- jobExecutionContext.setApplicationContext(appContext);
-
- JobDefinitionDocument jobDefDoc = JSDLGenerator.buildJSDLInstance(jobExecutionContext);
-
- assertTrue (jobDefDoc.getJobDefinition().getJobDescription().getApplication().toString().contains("/bin/cat"));
- assertTrue(jobDefDoc.getJobDefinition().getJobDescription().getDataStagingArray().length > 2);
-
- assertTrue(jobDefDoc.getJobDefinition().getJobDescription().getJobIdentification().getJobProjectArray().length > 0);
-
- assertFalse(JSDLUtils.getPOSIXApplication(jobDefDoc.getJobDefinition())==null);
-
- assertEquals("stdout", JSDLUtils.getOrCreatePOSIXApplication(jobDefDoc.getJobDefinition()).getOutput().getStringValue().toString());
- assertEquals("stderr", JSDLUtils.getOrCreatePOSIXApplication(jobDefDoc.getJobDefinition()).getError().getStringValue().toString());
-
- }
-
-
- @Test
- public void testMPIJSDL() throws Exception{
-
- JobTypeType jobType = JobTypeType.Factory.newInstance();
- jobType.set(JobTypeType.MPI);
- ApplicationContext appContext = getApplicationContext();
- appContext.setApplicationDeploymentDescription(getApplicationDesc(jobType, true));
- jobExecutionContext.setApplicationContext(appContext);
-
- JobDefinitionDocument jobDefDoc = JSDLGenerator.buildJSDLInstance(jobExecutionContext);
-
- assertTrue (jobDefDoc.getJobDefinition().getJobDescription().getApplication().toString().contains("/bin/cat"));
- assertTrue(jobDefDoc.getJobDefinition().getJobDescription().getDataStagingArray().length > 2);
-
- assertTrue(jobDefDoc.getJobDefinition().getJobDescription().getJobIdentification().getJobProjectArray().length > 0);
-
- assertEquals("jsdl_stdout", JSDLUtils.getOrCreateSPMDApplication(jobDefDoc.getJobDefinition()).getOutput().getStringValue().toString());
-
- assertFalse(JSDLUtils.getSPMDApplication(jobDefDoc.getJobDefinition())==null);
-
-
- }
-
- protected GFacConfiguration getGFACConfig() throws Exception{
- URL resource = BESProviderTest.class.getClassLoader().getResource(org.apache.airavata.common.utils.Constants.GFAC_CONFIG_XML);
- System.out.println(resource.getFile());
- GFacConfiguration gFacConfiguration = GFacConfiguration.create(new File(resource.getPath()),null,null);
- return gFacConfiguration;
- }
-
-
- protected ApplicationContext getApplicationContext() {
- ApplicationContext applicationContext = new ApplicationContext();
- applicationContext.setHostDescription(getHostDesc());
-
- applicationContext.setServiceDescription(getServiceDesc());
- return applicationContext;
- }
-
- protected ApplicationDescription getApplicationDesc(JobTypeType jobType, boolean setOuput) {
- ApplicationDescription appDesc = new ApplicationDescription(
- HpcApplicationDeploymentType.type);
- HpcApplicationDeploymentType app = (HpcApplicationDeploymentType) appDesc
- .getType();
- ApplicationDeploymentDescriptionType.ApplicationName name = ApplicationDeploymentDescriptionType.ApplicationName.Factory
- .newInstance();
- name.setStringValue("EchoLocal");
- app.setApplicationName(name);
- ProjectAccountType projectAccountType = app.addNewProjectAccount();
- projectAccountType.setProjectAccountNumber("TG-AST110064");
-
- QueueType queueType = app.addNewQueue();
- queueType.setQueueName("development");
-
- app.setCpuCount(1);
- // TODO: also handle parallel jobs
- if((jobType.enumValue() == JobTypeType.SERIAL) || (jobType.enumValue() == JobTypeType.SINGLE)) {
- app.setJobType(JobTypeType.SERIAL);
- }
- else if (jobType.enumValue() == JobTypeType.MPI) {
- app.setJobType(JobTypeType.MPI);
- }
- else {
- app.setJobType(JobTypeType.OPEN_MP);
- }
-
- app.setNodeCount(1);
- app.setProcessorsPerNode(1);
-
- /*
- * Use bat file if it is compiled on Windows
- */
- app.setExecutableLocation("/bin/cat");
-
- /*
- * Default tmp location
- */
- String date = (new Date()).toString();
- date = date.replaceAll(" ", "_");
- date = date.replaceAll(":", "_");
-
- String remoteTempDir = scratchDir + File.separator + "SimpleEcho" + "_" + date + "_"
- + UUID.randomUUID();
-
- System.out.println(remoteTempDir);
-
- // no need of these parameters, as unicore manages by itself
- app.setScratchWorkingDirectory(remoteTempDir);
- app.setStaticWorkingDirectory(remoteTempDir);
- app.setInputDataDirectory(remoteTempDir + File.separator + "inputData");
- app.setOutputDataDirectory(remoteTempDir + File.separator + "outputData");
-
- if(setOuput) {
- app.setStandardOutput(app.getOutputDataDirectory()+"/jsdl_stdout");
- app.setStandardError(app.getOutputDataDirectory()+"/jsdl_stderr");
- }
- return appDesc;
- }
-
- protected HostDescription getHostDesc() {
- HostDescription host = new HostDescription(UnicoreHostType.type);
- host.getType().setHostAddress(hostAddress);
- host.getType().setHostName(hostName);
- ((UnicoreHostType) host.getType()).setUnicoreBESEndPointArray(hostArray);
- ((UnicoreHostType) host.getType()).setGridFTPEndPointArray(new String[]{gridftpAddress});
- return host;
- }
-
- protected ServiceDescription getServiceDesc() {
- ServiceDescription serv = new ServiceDescription();
- serv.getType().setName("SimpleCat");
-
- List<InputParameterType> inputList = new ArrayList<InputParameterType>();
- InputParameterType input = InputParameterType.Factory.newInstance();
- input.setParameterName("echo_input");
- input.setParameterType(StringParameterType.Factory.newInstance());
- inputList.add(input);
- InputParameterType[] inputParamList = inputList
- .toArray(new InputParameterType[inputList.size()]);
-
- List<OutputParameterType> outputList = new ArrayList<OutputParameterType>();
- OutputParameterType output = OutputParameterType.Factory.newInstance();
- output.setParameterName("echo_output");
- output.setParameterType(StringParameterType.Factory.newInstance());
- outputList.add(output);
- OutputParameterType[] outputParamList = outputList
- .toArray(new OutputParameterType[outputList.size()]);
-
- serv.getType().setInputParametersArray(inputParamList);
- serv.getType().setOutputParametersArray(outputParamList);
-
-
- return serv;
- }
-
- protected MessageContext getInMessageContext() {
- MessageContext inMessage = new MessageContext();
-
- ActualParameter i1 = new ActualParameter();
- i1.getType().changeType(URIParameterType.type);
- ((URIParameterType)i1.getType()).setValue("file:///tmp/ifile1");
- inMessage.addParameter("i1", i1);
-
- ActualParameter i2 = new ActualParameter();
- i2.getType().changeType(URIParameterType.type);
- ((URIParameterType)i2.getType()).setValue("file:///tmp/ifile2");
- inMessage.addParameter("i2", i2);
-
- ActualParameter i3 = new ActualParameter();
- i2.getType().changeType(URIParameterType.type);
- ((URIParameterType)i2.getType()).setValue("///tmp/ifile2");
- inMessage.addParameter("i3", i2);
-
- ActualParameter simpleArg = new ActualParameter();
- simpleArg.getType().changeType(StringParameterType.type);
- ((StringParameterType)simpleArg.getType()).setValue("argument1");
- inMessage.addParameter("a1", simpleArg);
-
- ActualParameter nameValueArg = new ActualParameter();
- nameValueArg.getType().changeType(StringParameterType.type);
- ((StringParameterType)nameValueArg.getType()).setValue("name1=value1");
- inMessage.addParameter("nameValueArg", nameValueArg);
-
- ActualParameter echo_input = new ActualParameter();
- ((StringParameterType) echo_input.getType())
- .setValue("echo_output=hello");
- inMessage.addParameter("echo_input", echo_input);
-
- return inMessage;
- }
-
- protected MessageContext getOutMessageContext() {
- MessageContext om1 = new MessageContext();
-
- // TODO: Aint the output parameters are only the name of the files staged out to the gridftp endpoint?
- ActualParameter o1 = new ActualParameter();
- ((StringParameterType) o1.getType())
- .setValue("tempfile");
- om1.addParameter("o1", o1);
-
- ActualParameter o2 = new ActualParameter();
- o2.getType().changeType(URIParameterType.type);
-
- ((URIParameterType)o2.getType()).setValue("http://path/to/upload");
- om1.addParameter("o2", o2);
-
-
-
- return om1;
- }
-
- @Before
- public void initJobContext() throws Exception {
- PropertyConfigurator.configure("src/test/resources/logging.properties");
- jobExecutionContext = new JobExecutionContext(getGFACConfig(), getServiceDesc().getType().getName());
- jobExecutionContext.setApplicationContext(getApplicationContext());
- jobExecutionContext.setInMessageContext(getInMessageContext());
- jobExecutionContext.setOutMessageContext(getOutMessageContext());
- }
-
-
-}