You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sm...@apache.org on 2011/08/06 02:32:55 UTC
svn commit: r1154417 - in /incubator/airavata/trunk/modules:
commons/gfac-schema/src/main/java/org/apache/airavata/core/gfac/type/
commons/gfac-schema/src/main/java/org/apache/airavata/core/gfac/type/parameter/
gfac-core/ gfac-core/src/main/java/org/ap...
Author: smarru
Date: Sat Aug 6 00:32:54 2011
New Revision: 1154417
URL: http://svn.apache.org/viewvc?rev=1154417&view=rev
Log:
accepting test cases from Patanachai to resolve AIRAVATA-71
Added:
incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/core/gfac/type/parameter/
incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/core/gfac/type/parameter/AbstractParameter.java
incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/core/gfac/type/parameter/BooleanParameter.java
incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/core/gfac/type/parameter/DoubleParameter.java
incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/core/gfac/type/parameter/FloatParameter.java
incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/core/gfac/type/parameter/IntegerParameter.java
incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/core/gfac/type/parameter/StringParameter.java
incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/GFACContext.java
incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/factory/EchoLocalServiceFactory.java
incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/scheduler/impl/POJOSchedulerImpl.java
incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/services/impl/POJOServiceImpl.java
incubator/airavata/trunk/modules/gfac-core/src/test/java/org/apache/airavata/core/gfac/factory/EchoLocalFactoryTest.java
Modified:
incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/core/gfac/type/DataType.java
incubator/airavata/trunk/modules/gfac-core/pom.xml
incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/InvocationContext.java
incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/MessageContext.java
incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/impl/ParameterContextImpl.java
incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/data/RegistryDataService.java
incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/EC2Provider.java
incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/LocalProvider.java
incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/SSHProvider.java
incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/type/BooleanParameter.java
incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/type/DoubleParameter.java
incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/type/FloatParameter.java
incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/type/IntegerParameter.java
incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/type/Parameter.java
incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/type/StringParameter.java
incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/type/URIParameter.java
incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/utils/GfacUtils.java
incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/utils/OutputUtils.java
incubator/airavata/trunk/modules/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/PropertiesBasedServiceImplTest.java
incubator/airavata/trunk/modules/gfac-core/src/test/java/org/apache/airavata/core/gfac/type/StringParameterTest.java
Modified: incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/core/gfac/type/DataType.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/core/gfac/type/DataType.java?rev=1154417&r1=1154416&r2=1154417&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/core/gfac/type/DataType.java (original)
+++ incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/core/gfac/type/DataType.java Sat Aug 6 00:32:54 2011
@@ -21,5 +21,10 @@
package org.apache.airavata.core.gfac.type;
-public interface DataType extends Type{
+public enum DataType{
+ String,
+ Double,
+ Integer,
+ Float,
+ Boolean
}
\ No newline at end of file
Added: incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/core/gfac/type/parameter/AbstractParameter.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/core/gfac/type/parameter/AbstractParameter.java?rev=1154417&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/core/gfac/type/parameter/AbstractParameter.java (added)
+++ incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/core/gfac/type/parameter/AbstractParameter.java Sat Aug 6 00:32:54 2011
@@ -0,0 +1,31 @@
+/*
+ *
+ * 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.type.parameter;
+
+import org.apache.airavata.core.gfac.type.DataType;
+import org.apache.airavata.core.gfac.type.Parameter;
+
+public abstract class AbstractParameter extends Parameter {
+ public abstract DataType getType();
+ public abstract void parseStringVal(String val);
+ public abstract String toStringVal();
+}
Added: incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/core/gfac/type/parameter/BooleanParameter.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/core/gfac/type/parameter/BooleanParameter.java?rev=1154417&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/core/gfac/type/parameter/BooleanParameter.java (added)
+++ incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/core/gfac/type/parameter/BooleanParameter.java Sat Aug 6 00:32:54 2011
@@ -0,0 +1,41 @@
+/*
+ *
+ * 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.type.parameter;
+
+import org.apache.airavata.core.gfac.type.DataType;
+
+public class BooleanParameter extends AbstractParameter {
+
+ private Boolean value;
+
+ public void parseStringVal(String val){
+ this.value = Boolean.parseBoolean(val);
+ }
+
+ public String toStringVal(){
+ return this.value.toString();
+ }
+
+ public DataType getType() {
+ return DataType.Boolean;
+ }
+}
Added: incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/core/gfac/type/parameter/DoubleParameter.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/core/gfac/type/parameter/DoubleParameter.java?rev=1154417&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/core/gfac/type/parameter/DoubleParameter.java (added)
+++ incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/core/gfac/type/parameter/DoubleParameter.java Sat Aug 6 00:32:54 2011
@@ -0,0 +1,41 @@
+/*
+ *
+ * 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.type.parameter;
+
+import org.apache.airavata.core.gfac.type.DataType;
+
+public class DoubleParameter extends AbstractParameter {
+
+ private Double value;
+
+ public void parseStringVal(String val){
+ this.value = Double.parseDouble(val);
+ }
+
+ public String toStringVal(){
+ return this.value.toString();
+ }
+
+ public DataType getType() {
+ return DataType.Double;
+ }
+}
Added: incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/core/gfac/type/parameter/FloatParameter.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/core/gfac/type/parameter/FloatParameter.java?rev=1154417&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/core/gfac/type/parameter/FloatParameter.java (added)
+++ incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/core/gfac/type/parameter/FloatParameter.java Sat Aug 6 00:32:54 2011
@@ -0,0 +1,41 @@
+/*
+ *
+ * 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.type.parameter;
+
+import org.apache.airavata.core.gfac.type.DataType;
+
+public class FloatParameter extends AbstractParameter {
+
+ private Float value;
+
+ public void parseStringVal(String val){
+ this.value = Float.parseFloat(val);
+ }
+
+ public String toStringVal(){
+ return this.value.toString();
+ }
+
+ public DataType getType() {
+ return DataType.Float;
+ }
+}
Added: incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/core/gfac/type/parameter/IntegerParameter.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/core/gfac/type/parameter/IntegerParameter.java?rev=1154417&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/core/gfac/type/parameter/IntegerParameter.java (added)
+++ incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/core/gfac/type/parameter/IntegerParameter.java Sat Aug 6 00:32:54 2011
@@ -0,0 +1,42 @@
+/*
+ *
+ * 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.type.parameter;
+
+import org.apache.airavata.core.gfac.type.DataType;
+
+public class IntegerParameter extends AbstractParameter {
+
+ private Integer value;
+
+ public void parseStringVal(String val){
+ this.value = Integer.parseInt(val);
+ }
+
+ public String toStringVal(){
+ return this.value.toString();
+ }
+
+ public DataType getType() {
+ return DataType.Integer;
+ }
+
+}
Added: incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/core/gfac/type/parameter/StringParameter.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/core/gfac/type/parameter/StringParameter.java?rev=1154417&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/core/gfac/type/parameter/StringParameter.java (added)
+++ incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/core/gfac/type/parameter/StringParameter.java Sat Aug 6 00:32:54 2011
@@ -0,0 +1,42 @@
+/*
+ *
+ * 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.type.parameter;
+
+import org.apache.airavata.core.gfac.type.DataType;
+
+
+public class StringParameter extends AbstractParameter {
+
+ private String value;
+
+ public void parseStringVal(String val){
+ this.value = val;
+ }
+
+ public String toStringVal(){
+ return this.value.toString();
+ }
+
+ public DataType getType() {
+ return DataType.String;
+ }
+}
Modified: incubator/airavata/trunk/modules/gfac-core/pom.xml
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/pom.xml?rev=1154417&r1=1154416&r2=1154417&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/pom.xml (original)
+++ incubator/airavata/trunk/modules/gfac-core/pom.xml Sat Aug 6 00:32:54 2011
@@ -23,6 +23,17 @@
<org.slf4j.version>1.6.1</org.slf4j.version>
<log4j.version>1.2.16</log4j.version>
</properties>
+ <repositories>
+ <repository>
+ <name>ogce.m2.all</name>
+ <id>ogce.m2.all</id>
+ <url>http://community.ucs.indiana.edu:9090/archiva/repository/ogce.m2.all</url>
+ <snapshots>
+ <updatePolicy>daily</updatePolicy>
+ </snapshots>
+ </repository>
+ </repositories>
+
<dependencies>
<dependency>
<groupId>cog-jglobus</groupId>
@@ -37,11 +48,6 @@
</dependency>
<dependency>
<groupId>cog-4_1_6_rc2</groupId>
- <artifactId>cryptix32</artifactId>
- <version>cog-4_1_6</version>
- </dependency>
- <dependency>
- <groupId>cog-4_1_6_rc2</groupId>
<artifactId>cryptix-asn1</artifactId>
<version>cog-4_1_6</version>
</dependency>
@@ -91,17 +97,18 @@
<version>0.4.3</version>
</dependency>
<dependency>
- <groupId>xpp3</groupId>
- <artifactId>xpp3</artifactId>
- <version>1.1.4c</version>
+ <groupId>airavata</groupId>
+ <artifactId>airavata-gfac-schema-utils</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
</dependency>
+
+ <!-- Workflow Tracking -->
<dependency>
<groupId>workflow-tracking</groupId>
<artifactId>workflow_tracking</artifactId>
<version>2.7.1</version>
<type>jar</type>
</dependency>
-
<dependency>
<groupId>workflow-tracking</groupId>
<artifactId>workflow_tracking_types</artifactId>
@@ -109,15 +116,11 @@
<type>jar</type>
</dependency>
<dependency>
- <groupId>xmlbeans</groupId>
- <artifactId>xbean</artifactId>
- <version>2.3.0</version>
- </dependency>
- <dependency>
<groupId>workflow-context-header</groupId>
<artifactId>workflow-context-header</artifactId>
<version>1.0</version>
</dependency>
+
<!-- Xregistry jars -->
<dependency>
<groupId>xregistry</groupId>
Added: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/GFACContext.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/GFACContext.java?rev=1154417&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/GFACContext.java (added)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/GFACContext.java Sat Aug 6 00:32:54 2011
@@ -0,0 +1,51 @@
+/*
+ *
+ * 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.context;
+
+import org.apache.airavata.core.gfac.type.ApplicationDeploymentDescription;
+import org.apache.airavata.core.gfac.type.HostDescription;
+import org.apache.airavata.core.gfac.type.ServiceDescription;
+
+public class GFACContext{
+ private HostDescription host;
+ private ApplicationDeploymentDescription app;
+ private ServiceDescription service;
+
+ public HostDescription getHost() {
+ return host;
+ }
+ public void setHost(HostDescription host) {
+ this.host = host;
+ }
+ public ApplicationDeploymentDescription getApp() {
+ return app;
+ }
+ public void setApp(ApplicationDeploymentDescription app) {
+ this.app = app;
+ }
+ public ServiceDescription getService() {
+ return service;
+ }
+ public void setService(ServiceDescription service) {
+ this.service = service;
+ }
+}
Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/InvocationContext.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/InvocationContext.java?rev=1154417&r1=1154416&r2=1154417&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/InvocationContext.java (original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/InvocationContext.java Sat Aug 6 00:32:54 2011
@@ -33,7 +33,8 @@ public class InvocationContext {
private String serviceName;
private ExecutionContext executionContext;
- private Map<String, MessageContext> messageContextMap = new HashMap<String, MessageContext>();
+ private GFACContext gfacContext;
+ private Map<String, MessageContext> messageContextMap = new HashMap<String, MessageContext>();
private Map<String, SecurityContext> securityContextMap = new HashMap<String, SecurityContext>();;
public String getServiceName() {
@@ -44,6 +45,14 @@ public class InvocationContext {
this.serviceName = serviceName;
}
+ public GFACContext getGfacContext() {
+ return gfacContext;
+ }
+
+ public void setGfacContext(GFACContext gfacContext) {
+ this.gfacContext = gfacContext;
+ }
+
public ExecutionContext getExecutionContext() {
return executionContext;
}
Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/MessageContext.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/MessageContext.java?rev=1154417&r1=1154416&r2=1154417&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/MessageContext.java (original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/MessageContext.java Sat Aug 6 00:32:54 2011
@@ -29,11 +29,9 @@ public interface MessageContext<T> {
public T getParameterValue(String name);
- public String getParameterType(String name);
-
public String getStringParameterValue(String name);
- public void addParameter(String name, String type, T value);
+ public void addParameter(String name, T value);
public void setValue(String name, T value);
}
Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/impl/ParameterContextImpl.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/impl/ParameterContextImpl.java?rev=1154417&r1=1154416&r2=1154417&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/impl/ParameterContextImpl.java (original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/impl/ParameterContextImpl.java Sat Aug 6 00:32:54 2011
@@ -26,41 +26,36 @@ import java.util.Iterator;
import java.util.Map;
import org.apache.airavata.core.gfac.context.MessageContext;
-import org.apache.airavata.core.gfac.type.Parameter;
+import org.apache.airavata.core.gfac.type.parameter.AbstractParameter;
-@SuppressWarnings("rawtypes")
-public class ParameterContextImpl implements MessageContext<Parameter> {
+public class ParameterContextImpl implements MessageContext<AbstractParameter> {
- private Map<String, Parameter> value;
+ private Map<String, AbstractParameter> value;
public ParameterContextImpl() {
- this.value = new HashMap<String, Parameter>();
+ this.value = new HashMap<String, AbstractParameter>();
}
public Iterator<String> getParameterNames() {
return this.value.keySet().iterator();
}
- public Parameter getParameterValue(String name) {
+ public AbstractParameter getParameterValue(String name) {
return this.value.get(name);
}
- public String getParameterType(String name) {
- return this.value.get(name).getTypeName();
- }
-
public String getStringParameterValue(String name) {
if (this.value.containsKey(name))
- return this.value.get(name).toString();
+ return this.value.get(name).toStringVal();
else
return null;
}
- public void addParameter(String name, String type, Parameter value) {
+ public void addParameter(String name, AbstractParameter value) {
this.value.put(name, value);
}
- public void setValue(String name, Parameter value) {
+ public void setValue(String name, AbstractParameter value) {
this.value.put(name, value);
}
Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/data/RegistryDataService.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/data/RegistryDataService.java?rev=1154417&r1=1154416&r2=1154417&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/data/RegistryDataService.java (original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/data/RegistryDataService.java Sat Aug 6 00:32:54 2011
@@ -38,7 +38,7 @@ import org.apache.airavata.core.gfac.exc
import org.apache.airavata.core.gfac.extension.DataServiceChain;
import org.apache.airavata.core.gfac.model.ExecutionModel;
import org.apache.airavata.core.gfac.registry.RegistryService;
-import org.apache.airavata.core.gfac.type.StringParameter;
+import org.apache.airavata.core.gfac.type.parameter.StringParameter;
import org.apache.airavata.core.gfac.utils.GfacUtils;
import org.apache.xmlbeans.XmlException;
import org.ogce.schemas.gfac.documents.ApplicationDescriptionDocument;
@@ -155,8 +155,7 @@ public class RegistryDataService extends
ParameterContextImpl outtmp = new ParameterContextImpl();
for (OutputParameterType output : serviceMap.getPortTypeArray(0).getMethodArray(0)
.getOutputParameterArray()) {
- outtmp.addParameter(output.getParameterName(), output.getParameterType().toString(),
- new StringParameter());
+ outtmp.addParameter(output.getParameterName(), new StringParameter());
}
context.addMessageContext(OUTPUT_MESSAGE_CONTEXT, outtmp);
}
Added: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/factory/EchoLocalServiceFactory.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/factory/EchoLocalServiceFactory.java?rev=1154417&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/factory/EchoLocalServiceFactory.java (added)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/factory/EchoLocalServiceFactory.java Sat Aug 6 00:32:54 2011
@@ -0,0 +1,87 @@
+/*
+ *
+ * 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.factory;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.apache.airavata.core.gfac.services.GenericService;
+import org.apache.airavata.core.gfac.services.impl.POJOServiceImpl;
+import org.apache.airavata.core.gfac.type.DataType;
+import org.apache.airavata.core.gfac.type.HostDescription;
+import org.apache.airavata.core.gfac.type.Parameter;
+import org.apache.airavata.core.gfac.type.ServiceDescription;
+import org.apache.airavata.core.gfac.type.app.ShellApplicationDeployment;
+
+public class EchoLocalServiceFactory extends AbstractServiceFactory {
+
+ private GenericService service;
+
+ public GenericService getGenericService() {
+ if (service == null) {
+ /*
+ * Host
+ */
+ HostDescription host = new HostDescription();
+ host.setName("localhost");
+
+ /*
+ * App
+ */
+ ShellApplicationDeployment app = new ShellApplicationDeployment();
+ app.setName("EchoLocal");
+ app.setExecutable("/bin/echo");
+ app.setTmpDir("/tmp");
+ app.setWorkingDir("/tmp");
+ app.setInputDir("/tmp/input");
+ app.setOutputDir("/tmp/output");
+ app.setStdOut("/tmp/echo.stdout");
+ app.setStdErr("/tmp/echo.stdout");
+ app.setEnv(new HashMap<String, String>());
+
+ /*
+ * Service
+ */
+ ServiceDescription serv = new ServiceDescription();
+ serv.setName("EchoPOJO");
+
+ Parameter input = new Parameter();
+ input.setName("echo_input");
+ input.setType(DataType.String);
+ List<Parameter> inputList = new ArrayList<Parameter>();
+ inputList.add(input);
+
+ Parameter output = new Parameter();
+ output.setName("echo_output");
+ output.setType(DataType.String);
+ List<Parameter> outputList = new ArrayList<Parameter>();
+ outputList.add(output);
+
+ serv.setInputParameters(inputList);
+ serv.setOutputParameters(outputList);
+
+ service = new POJOServiceImpl(host, app, serv);
+ }
+ return service;
+ }
+}
Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/EC2Provider.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/EC2Provider.java?rev=1154417&r1=1154416&r2=1154417&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/EC2Provider.java (original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/EC2Provider.java Sat Aug 6 00:32:54 2011
@@ -102,7 +102,6 @@ public class EC2Provider extends Abstrac
return buff.toString();
}
- @Override
public void initialize(InvocationContext invocationContext) throws GfacException {
ExecutionContext appExecContext = invocationContext.getExecutionContext();
ExecutionModel model = appExecContext.getExecutionModel();
@@ -236,7 +235,6 @@ public class EC2Provider extends Abstrac
}
}
- @Override
public void execute(InvocationContext invocationContext) throws GfacException {
ExecutionContext context = invocationContext.getExecutionContext();
ExecutionModel model = context.getExecutionModel();
@@ -363,13 +361,11 @@ public class EC2Provider extends Abstrac
}
}
- @Override
public void dispose(InvocationContext invocationContext) throws GfacException {
// TODO Auto-generated method stub
}
- @Override
public void abort(InvocationContext invocationContext) throws GfacException {
// TODO Auto-generated method stub
Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/LocalProvider.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/LocalProvider.java?rev=1154417&r1=1154416&r2=1154417&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/LocalProvider.java (original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/LocalProvider.java Sat Aug 6 00:32:54 2011
@@ -28,22 +28,21 @@ import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import org.apache.airavata.core.gfac.context.ExecutionContext;
import org.apache.airavata.core.gfac.context.InvocationContext;
import org.apache.airavata.core.gfac.exception.GfacException;
import org.apache.airavata.core.gfac.exception.GfacException.FaultCode;
-import org.apache.airavata.core.gfac.exception.JobSubmissionFault;
-import org.apache.airavata.core.gfac.notification.NotificationService;
+import org.apache.airavata.core.gfac.type.ApplicationDeploymentDescription;
+import org.apache.airavata.core.gfac.type.HostDescription;
+import org.apache.airavata.core.gfac.type.ServiceDescription;
+import org.apache.airavata.core.gfac.type.app.ShellApplicationDeployment;
import org.apache.airavata.core.gfac.utils.GFacConstants;
-import org.apache.airavata.core.gfac.utils.GFacOptions.CurrentProviders;
import org.apache.airavata.core.gfac.utils.GfacUtils;
import org.apache.airavata.core.gfac.utils.OutputUtils;
-import edu.indiana.extreme.lead.workflow_tracking.common.DurationObj;
-
public class LocalProvider extends AbstractProvider {
private static final String SPACE = " ";
@@ -58,46 +57,50 @@ public class LocalProvider extends Abstr
}
public void initialize(InvocationContext invocationContext) throws GfacException {
- ExecutionContext context = invocationContext.getExecutionContext();
+ ApplicationDeploymentDescription app = invocationContext.getGfacContext().getApp();
- log.info("working diectroy = " + context.getExecutionModel().getWorkingDir());
- log.info("temp directory = " + context.getExecutionModel().getTmpDir());
- new File(context.getExecutionModel().getWorkingDir()).mkdir();
- new File(context.getExecutionModel().getTmpDir()).mkdir();
- new File(context.getExecutionModel().getInputDataDir()).mkdir();
- new File(context.getExecutionModel().getOutputDataDir()).mkdir();
+ log.info("working diectroy = " + app.getWorkingDir());
+ log.info("temp directory = " + app.getTmpDir());
+ new File(app.getWorkingDir()).mkdir();
+ new File(app.getTmpDir()).mkdir();
+ new File(app.getInputDir()).mkdir();
+ new File(app.getOutputDir()).mkdir();
}
- public void execute(InvocationContext invocationContext) throws GfacException {
- ExecutionContext context = invocationContext.getExecutionContext();
-
+ public void execute(InvocationContext context) throws GfacException {
+ HostDescription host = context.getGfacContext().getHost();
+ ShellApplicationDeployment app = (ShellApplicationDeployment)context.getGfacContext().getApp();
+ ServiceDescription service = context.getGfacContext().getService();
+
+ // input parameter
+ ArrayList<String> tmp = new ArrayList<String>();
+ for (Iterator<String> iterator = context.getMessageContext("input").getParameterNames(); iterator.hasNext();) {
+ String key = iterator.next();
+ tmp.add(context.getMessageContext("input").getStringParameterValue(key));
+ }
+
List<String> cmdList = new ArrayList<String>();
try {
/*
- * Notifier
- */
- NotificationService notifier = context.getNotificationService();
-
- /*
* Builder Command
*/
- cmdList.add(context.getExecutionModel().getExecutable());
- cmdList.addAll(context.getExecutionModel().getInputParameters());
+ cmdList.add(app.getExecutable());
+ cmdList.addAll(tmp);
// create process builder from command
ProcessBuilder builder = new ProcessBuilder(cmdList);
// get the env of the host and the application
- Map<String, String> nv = context.getExecutionModel().getEnv();
+ Map<String, String> nv = app.getEnv();
builder.environment().putAll(nv);
// extra env's
- builder.environment().put(GFacConstants.INPUT_DATA_DIR, context.getExecutionModel().getInputDataDir());
- builder.environment().put(GFacConstants.OUTPUT_DATA_DIR, context.getExecutionModel().getOutputDataDir());
+ builder.environment().put(GFacConstants.INPUT_DATA_DIR, app.getInputDir());
+ builder.environment().put(GFacConstants.OUTPUT_DATA_DIR, app.getOutputDir());
// working directory
- builder.directory(new File(context.getExecutionModel().getWorkingDir()));
+ builder.directory(new File(app.getWorkingDir()));
// log info
log.info("Command = " + buildCommand(cmdList));
@@ -106,18 +109,13 @@ public class LocalProvider extends Abstr
log.info("Env[" + key + "] = " + builder.environment().get(key));
}
- // notify start
- DurationObj compObj = notifier.computationStarted();
-
// running cmd
Process process = builder.start();
final BufferedReader in = new BufferedReader(new InputStreamReader(process.getInputStream()));
final BufferedReader err = new BufferedReader(new InputStreamReader(process.getErrorStream()));
- final BufferedWriter stdoutWtiter = new BufferedWriter(new FileWriter(context.getExecutionModel()
- .getStdOut()));
- final BufferedWriter stdErrWtiter = new BufferedWriter(new FileWriter(context.getExecutionModel()
- .getStderr()));
+ final BufferedWriter stdoutWtiter = new BufferedWriter(new FileWriter(app.getStdOut()));
+ final BufferedWriter stdErrWtiter = new BufferedWriter(new FileWriter(app.getStdErr()));
Thread t1 = new Thread(new Runnable() {
@@ -193,9 +191,6 @@ public class LocalProvider extends Abstr
// wait for the process (application) to finish executing
int returnValue = process.waitFor();
- // notify end
- notifier.computationFinished(compObj);
-
// make sure other two threads are done
t1.join();
t2.join();
@@ -211,24 +206,31 @@ public class LocalProvider extends Abstr
}
StringBuffer buf = new StringBuffer();
- buf.append("Executed ").append(buildCommand(cmdList)).append(" on the localHost, working directory =")
- .append(context.getExecutionModel().getWorkingDir()).append("tempDirectory =")
- .append(context.getExecutionModel().getTmpDir()).append("With the status")
+ buf.append("Executed ")
+ .append(buildCommand(cmdList))
+ .append(" on the localHost, working directory = ")
+ .append(app.getWorkingDir())
+ .append(" tempDirectory = ")
+ .append(app.getTmpDir())
+ .append(" With the status ")
.append(String.valueOf(returnValue));
- context.getNotificationService().info(buf.toString());
log.info(buf.toString());
- context.getExecutionModel().setStdoutStr(GfacUtils.readFile(context.getExecutionModel().getStdOut()));
- context.getExecutionModel().setStderrStr(GfacUtils.readFile(context.getExecutionModel().getStderr()));
+ String stdOutStr = GfacUtils.readFile(app.getStdOut());
+ String stdErrStr = GfacUtils.readFile(app.getStdErr());
// set to context
- OutputUtils.fillOutputFromStdout(invocationContext.getMessageContext("output"), context.getExecutionModel()
- .getStdoutStr(), context.getExecutionModel().getStderrStr());
+ OutputUtils.fillOutputFromStdout(context.getMessageContext("output"), stdOutStr, stdErrStr);
} catch (IOException e) {
- throw new JobSubmissionFault(e, "", "", buildCommand(cmdList), CurrentProviders.Local);
+ log.error("error", e);
+ throw new GfacException(e, FaultCode.LocalError);
} catch (InterruptedException e) {
+ log.error("error", e);
+ throw new GfacException(e, FaultCode.LocalError);
+ } catch (Exception e){
+ log.error("error", e);
throw new GfacException(e, FaultCode.LocalError);
}
Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/SSHProvider.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/SSHProvider.java?rev=1154417&r1=1154416&r2=1154417&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/SSHProvider.java (original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/SSHProvider.java Sat Aug 6 00:32:54 2011
@@ -58,7 +58,6 @@ public class SSHProvider extends Abstrac
return buff.toString();
}
- @Override
public void initialize(InvocationContext invocationContext) throws GfacException {
ExecutionContext appExecContext = invocationContext.getExecutionContext();
ExecutionModel model = appExecContext.getExecutionModel();
@@ -103,8 +102,7 @@ public class SSHProvider extends Abstrac
}
}
}
-
- @Override
+
public void execute(InvocationContext invocationContext) throws GfacException {
ExecutionContext context = invocationContext.getExecutionContext();
ExecutionModel model = context.getExecutionModel();
@@ -233,13 +231,11 @@ public class SSHProvider extends Abstrac
}
}
- @Override
public void dispose(InvocationContext invocationContext) throws GfacException {
// TODO Auto-generated method stub
}
- @Override
public void abort(InvocationContext invocationContext) throws GfacException {
// TODO Auto-generated method stub
Added: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/scheduler/impl/POJOSchedulerImpl.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/scheduler/impl/POJOSchedulerImpl.java?rev=1154417&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/scheduler/impl/POJOSchedulerImpl.java (added)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/scheduler/impl/POJOSchedulerImpl.java Sat Aug 6 00:32:54 2011
@@ -0,0 +1,42 @@
+/*
+ *
+ * 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.scheduler.impl;
+
+import org.apache.airavata.core.gfac.context.InvocationContext;
+import org.apache.airavata.core.gfac.exception.GfacException;
+import org.apache.airavata.core.gfac.provider.GramProvider;
+import org.apache.airavata.core.gfac.provider.LocalProvider;
+import org.apache.airavata.core.gfac.provider.Provider;
+import org.apache.airavata.core.gfac.scheduler.Scheduler;
+import org.apache.airavata.core.gfac.type.HostDescription;
+import org.apache.airavata.core.gfac.utils.GfacUtils;
+
+public class POJOSchedulerImpl implements Scheduler {
+
+ public Provider schedule(InvocationContext context) throws GfacException {
+ HostDescription host = context.getGfacContext().getHost();
+ if(GfacUtils.isLocalHost(host.getName())){
+ return new LocalProvider();
+ }
+ return new GramProvider();
+ }
+}
Added: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/services/impl/POJOServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/services/impl/POJOServiceImpl.java?rev=1154417&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/services/impl/POJOServiceImpl.java (added)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/services/impl/POJOServiceImpl.java Sat Aug 6 00:32:54 2011
@@ -0,0 +1,75 @@
+/*
+ *
+ * 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.core.gfac.context.GFACContext;
+import org.apache.airavata.core.gfac.context.InvocationContext;
+import org.apache.airavata.core.gfac.exception.GfacException;
+import org.apache.airavata.core.gfac.extension.DataServiceChain;
+import org.apache.airavata.core.gfac.extension.PostExecuteChain;
+import org.apache.airavata.core.gfac.extension.PreExecuteChain;
+import org.apache.airavata.core.gfac.scheduler.Scheduler;
+import org.apache.airavata.core.gfac.scheduler.impl.POJOSchedulerImpl;
+import org.apache.airavata.core.gfac.type.ApplicationDeploymentDescription;
+import org.apache.airavata.core.gfac.type.HostDescription;
+import org.apache.airavata.core.gfac.type.ServiceDescription;
+
+public class POJOServiceImpl extends AbstractSimpleService {
+
+ private GFACContext context;
+
+ public POJOServiceImpl(HostDescription host, ApplicationDeploymentDescription app, ServiceDescription service){
+ this.context = new GFACContext();
+ context.setHost(host);
+ context.setApp(app);
+ context.setService(service);
+ }
+
+ public void init() throws GfacException {
+ }
+
+ public void dispose() throws GfacException {
+ }
+
+ public void preProcess(InvocationContext context) throws GfacException {
+ context.setGfacContext(this.context);
+ }
+
+ public void postProcess(InvocationContext context) throws GfacException {
+ }
+
+ public Scheduler getScheduler(InvocationContext context) throws GfacException {
+ return new POJOSchedulerImpl();
+ }
+
+ public PreExecuteChain[] getPreExecutionSteps(InvocationContext context) throws GfacException {
+ return null;
+ }
+
+ public PostExecuteChain[] getPostExecuteSteps(InvocationContext context) throws GfacException {
+ return null;
+ }
+
+ public DataServiceChain[] getDataChains(InvocationContext context) throws GfacException {
+ return null;
+ }
+}
Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/type/BooleanParameter.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/type/BooleanParameter.java?rev=1154417&r1=1154416&r2=1154417&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/type/BooleanParameter.java (original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/type/BooleanParameter.java Sat Aug 6 00:32:54 2011
@@ -1,50 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.core.gfac.type;
-
-public class BooleanParameter implements Parameter<Boolean> {
-
- private final static String TYPE = "Boolean";
-
- private Boolean value;
-
- @Override
- public void fromString(String val) {
- this.value = Boolean.parseBoolean(val);
- }
-
- @Override
- public String toString() {
- return this.value.toString();
- }
-
- @Override
- public Boolean toJavaObject() {
- return this.value;
- }
-
- @Override
- public String getTypeName() {
- return TYPE;
- }
-
-}
Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/type/DoubleParameter.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/type/DoubleParameter.java?rev=1154417&r1=1154416&r2=1154417&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/type/DoubleParameter.java (original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/type/DoubleParameter.java Sat Aug 6 00:32:54 2011
@@ -1,49 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.core.gfac.type;
-
-public class DoubleParameter implements Parameter<Double> {
-
- private final static String TYPE = "Interger";
-
- private Double value;
-
- @Override
- public void fromString(String val) {
- this.value = Double.parseDouble(val);
- }
-
- @Override
- public String toString() {
- return this.value.toString();
- }
-
- @Override
- public Double toJavaObject() {
- return this.value;
- }
-
- @Override
- public String getTypeName() {
- return TYPE;
- }
-}
Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/type/FloatParameter.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/type/FloatParameter.java?rev=1154417&r1=1154416&r2=1154417&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/type/FloatParameter.java (original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/type/FloatParameter.java Sat Aug 6 00:32:54 2011
@@ -1,49 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.core.gfac.type;
-
-public class FloatParameter implements Parameter<Float> {
-
- private final static String TYPE = "Float";
-
- private Float value;
-
- @Override
- public void fromString(String val) {
- this.value = Float.parseFloat(val);
- }
-
- @Override
- public String toString() {
- return this.value.toString();
- }
-
- @Override
- public Float toJavaObject() {
- return this.value;
- }
-
- @Override
- public String getTypeName() {
- return TYPE;
- }
-}
Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/type/IntegerParameter.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/type/IntegerParameter.java?rev=1154417&r1=1154416&r2=1154417&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/type/IntegerParameter.java (original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/type/IntegerParameter.java Sat Aug 6 00:32:54 2011
@@ -1,50 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.core.gfac.type;
-
-public class IntegerParameter implements Parameter<Integer> {
-
- private final static String TYPE = "Interger";
-
- private Integer value;
-
- @Override
- public void fromString(String val) {
- this.value = Integer.parseInt(val);
- }
-
- @Override
- public String toString() {
- return this.value.toString();
- }
-
- @Override
- public Integer toJavaObject() {
- return this.value;
- }
-
- @Override
- public String getTypeName() {
- return TYPE;
- }
-
-}
Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/type/Parameter.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/type/Parameter.java?rev=1154417&r1=1154416&r2=1154417&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/type/Parameter.java (original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/type/Parameter.java Sat Aug 6 00:32:54 2011
@@ -1,33 +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.type;
-
-public interface Parameter<T> {
-
- public String getTypeName();
-
- public void fromString(String val);
-
- public String toString();
-
- public T toJavaObject();
-}
Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/type/StringParameter.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/type/StringParameter.java?rev=1154417&r1=1154416&r2=1154417&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/type/StringParameter.java (original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/type/StringParameter.java Sat Aug 6 00:32:54 2011
@@ -1,50 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.core.gfac.type;
-
-public class StringParameter implements Parameter<String> {
-
- private final static String TYPE = "String";
-
- private String value;
-
- @Override
- public void fromString(String val) {
- this.value = val;
- }
-
- @Override
- public String toString() {
- return this.value;
- }
-
- @Override
- public String toJavaObject() {
- return this.value;
- }
-
- @Override
- public String getTypeName() {
- return TYPE;
- }
-
-}
Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/type/URIParameter.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/type/URIParameter.java?rev=1154417&r1=1154416&r2=1154417&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/type/URIParameter.java (original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/type/URIParameter.java Sat Aug 6 00:32:54 2011
@@ -1,57 +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.type;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-
-public class URIParameter implements Parameter<URI> {
-
- private final static String TYPE = "URI";
-
- private URI value;
-
- @Override
- public void fromString(String val) {
- try {
- this.value = new URI(val);
- } catch (URISyntaxException ue) {
- // TODO handle exception
- ue.printStackTrace();
- }
- }
-
- @Override
- public String toString() {
- return this.value.toString();
- }
-
- @Override
- public URI toJavaObject() {
- return this.value;
- }
-
- @Override
- public String getTypeName() {
- return TYPE;
- }
-}
Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/utils/GfacUtils.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/utils/GfacUtils.java?rev=1154417&r1=1154416&r2=1154417&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/utils/GfacUtils.java (original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/utils/GfacUtils.java Sat Aug 6 00:32:54 2011
@@ -259,93 +259,7 @@ public class GfacUtils {
} catch (UnknownHostException e) {
throw new GfacException(e, FaultCode.LocalError);
}
- }
-
- /**
- * This method perpare the arguments to be passed to the invocation
- *
- * @param inputMessage
- * @param parmsValuesOnly
- * , this is usually true. If it is false, the parameters are passed as Name value pairs. If the
- * parameter name is foo and it is a array type parameters will be passed as foo0,foo1 ....
- * @return
- * @throws GfacException
- */
- public static ArrayList<String> prepareParameters(MessageContext inputMessage, boolean parmsValuesOnly)
- throws GfacException {
- try {
- ArrayList<String> params = new ArrayList<String>();
- Iterator<String> names = inputMessage.getParameterNames();
- while (names.hasNext()) {
- String name = names.next();
- String type = inputMessage.getParameterType(name);
-
- if (GFacConstants.Types.TYPE_DATAID.equals(type)) {
- // add parameter name if needed
- if (!parmsValuesOnly) {
- params.add(name);
- }
- params.add(new URI(inputMessage.getStringParameterValue(name)).getPath());
- } else if (GFacConstants.Types.TYPE_DATAID_ARRAY.equals(type)) {
- Object value = inputMessage.getParameterValue(name);
- if (value instanceof Object[]) {
- Object[] valueArray = (Object[]) value;
- for (int j = 0; j < valueArray.length; j++) {
- // add parameter name if needed
- if (!parmsValuesOnly) {
- params.add(name + j);
- }
- params.add(new URI(valueArray[j].toString()).getPath());
- }
- }
- } else if (GFacConstants.Types.TYPE_LEADFILEID.equals(type)
- || GFacConstants.Types.TYPE_URI.equals(type)) {
- // add parameter name if needed
- if (!parmsValuesOnly) {
- params.add(name);
- }
- params.add(new URI(inputMessage.getStringParameterValue(name)).getPath());
- } else if (GFacConstants.Types.TYPE_LEADFILEID_ARRAY.equals(type)
- || GFacConstants.Types.TYPE_URI_ARRAY.equals(type)) {
- Object value = inputMessage.getParameterValue(name);
- if (value instanceof Object[]) {
- Object[] valueArray = (Object[]) value;
- for (int j = 0; j < valueArray.length; j++) {
- // add parameter name if needed
- if (!parmsValuesOnly) {
- params.add(name + j);
- }
- params.add(new URI(valueArray[j].toString()).getPath());
- }
- }
- } else {
- if (GfacUtils.isArray(type)) {
- Object value = inputMessage.getParameterValue(name);
- if (value instanceof Object[]) {
- Object[] valueArray = (Object[]) value;
- for (int j = 0; j < valueArray.length; j++) {
- // add parameter name if needed
- if (!parmsValuesOnly) {
- params.add(name + j);
- }
- params.add(valueArray[j].toString());
- }
- }
- } else {
- if (!parmsValuesOnly) {
- params.add(name);
- }
- params.add(inputMessage.getStringParameterValue(name));
- }
-
- // add parameter name if needed
- }
- }
- return params;
- } catch (URISyntaxException e) {
- throw new GfacException(e, FaultCode.InvaliedLocalArgumnet);
- }
- }
+ }
public static boolean isInbuiltOperation(String name) {
return GFacConstants.InbuitOperations.OP_KILL.equals(name)
Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/utils/OutputUtils.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/utils/OutputUtils.java?rev=1154417&r1=1154416&r2=1154417&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/utils/OutputUtils.java (original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/utils/OutputUtils.java Sat Aug 6 00:32:54 2011
@@ -26,11 +26,11 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.airavata.core.gfac.context.MessageContext;
-import org.apache.airavata.core.gfac.type.Parameter;
+import org.apache.airavata.core.gfac.type.parameter.AbstractParameter;
public class OutputUtils {
- public static void fillOutputFromStdout(MessageContext<Parameter> outMessage, String stdout, String stderr) {
+ public static void fillOutputFromStdout(MessageContext<AbstractParameter> outMessage, String stdout, String stderr) {
for (Iterator<String> iterator = outMessage.getParameterNames(); iterator.hasNext();) {
String parameterName = iterator.next();
@@ -40,8 +40,8 @@ public class OutputUtils {
continue;
}
- Parameter x = outMessage.getParameterValue(parameterName);
- x.fromString(parseStdout(stdout, parameterName));
+ AbstractParameter x = outMessage.getParameterValue(parameterName);
+ x.parseStringVal(parseStdout(stdout, parameterName));
}
}
Added: incubator/airavata/trunk/modules/gfac-core/src/test/java/org/apache/airavata/core/gfac/factory/EchoLocalFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/test/java/org/apache/airavata/core/gfac/factory/EchoLocalFactoryTest.java?rev=1154417&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/test/java/org/apache/airavata/core/gfac/factory/EchoLocalFactoryTest.java (added)
+++ incubator/airavata/trunk/modules/gfac-core/src/test/java/org/apache/airavata/core/gfac/factory/EchoLocalFactoryTest.java Sat Aug 6 00:32:54 2011
@@ -0,0 +1,82 @@
+/*
+ *
+ * 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.factory;
+
+import org.apache.airavata.core.gfac.context.InvocationContext;
+import org.apache.airavata.core.gfac.context.MessageContext;
+import org.apache.airavata.core.gfac.context.impl.ParameterContextImpl;
+import org.apache.airavata.core.gfac.exception.GfacException;
+import org.apache.airavata.core.gfac.services.GenericService;
+import org.apache.airavata.core.gfac.type.parameter.StringParameter;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class EchoLocalFactoryTest {
+
+ @Test
+ public void testEchoLocal() {
+ InvocationContext ct = new InvocationContext();
+
+ /*
+ * Input
+ */
+ ParameterContextImpl input = new ParameterContextImpl();
+ StringParameter z = new StringParameter();
+ z.parseStringVal("echo_output=hello");
+ input.addParameter("echo_input", z);
+
+ /*
+ * Output
+ */
+ ParameterContextImpl output = new ParameterContextImpl();
+ StringParameter b = new StringParameter();
+ output.addParameter("echo_output", b);
+
+ ct.addMessageContext("input", input);
+ ct.addMessageContext("output", output);
+
+ try {
+ GenericService service = new EchoLocalServiceFactory()
+ .createService();
+
+ service.execute(ct);
+ } catch (GfacException g) {
+ g.printStackTrace();
+ }
+
+ Assert.assertNotNull(ct.getMessageContext("output"));
+ Assert.assertNotNull(ct.getMessageContext("output").getParameterValue(
+ "echo_output"));
+ Assert.assertEquals("hello", ((ParameterContextImpl) ct
+ .getMessageContext("output")).getParameterValue("echo_output")
+ .toStringVal());
+ }
+
+ @Test
+ public void testGetGenericService() {
+ }
+
+ @Test
+ public void testCreateService() {
+ }
+
+}
Modified: incubator/airavata/trunk/modules/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/PropertiesBasedServiceImplTest.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/PropertiesBasedServiceImplTest.java?rev=1154417&r1=1154416&r2=1154417&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/PropertiesBasedServiceImplTest.java (original)
+++ incubator/airavata/trunk/modules/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/PropertiesBasedServiceImplTest.java Sat Aug 6 00:32:54 2011
@@ -28,7 +28,7 @@ import org.apache.airavata.core.gfac.con
import org.apache.airavata.core.gfac.context.impl.GSISecurityContext;
import org.apache.airavata.core.gfac.context.impl.ParameterContextImpl;
import org.apache.airavata.core.gfac.notification.DummyNotification;
-import org.apache.airavata.core.gfac.type.StringParameter;
+import org.apache.airavata.core.gfac.type.parameter.StringParameter;
import org.junit.Assert;
import org.junit.Test;
@@ -68,8 +68,8 @@ public class PropertiesBasedServiceImplT
// parameter
ParameterContextImpl x = new ParameterContextImpl();
StringParameter parameter = new StringParameter();
- parameter.fromString("Hello");
- x.addParameter("echo", parameter.getTypeName(), parameter);
+ parameter.parseStringVal("Hello");
+ x.addParameter("echo", parameter);
ct.addMessageContext("input", x);
PropertiesBasedServiceImpl service = new PropertiesBasedServiceImpl();
Modified: incubator/airavata/trunk/modules/gfac-core/src/test/java/org/apache/airavata/core/gfac/type/StringParameterTest.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/test/java/org/apache/airavata/core/gfac/type/StringParameterTest.java?rev=1154417&r1=1154416&r2=1154417&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/test/java/org/apache/airavata/core/gfac/type/StringParameterTest.java (original)
+++ incubator/airavata/trunk/modules/gfac-core/src/test/java/org/apache/airavata/core/gfac/type/StringParameterTest.java Sat Aug 6 00:32:54 2011
@@ -21,13 +21,14 @@
package org.apache.airavata.core.gfac.type;
+import org.apache.airavata.core.gfac.type.parameter.StringParameter;
import org.junit.Test;
public class StringParameterTest {
@Test
public void getName() {
StringParameter x = new StringParameter();
- x.fromString("xxx");
- System.out.println(x.getTypeName());
+ x.parseStringVal("xxx");
+ System.out.println(x.getType());
}
}