airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From patanac...@apache.org
Subject svn commit: r1182598 - in /incubator/airavata/trunk/modules: commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/parameter/ gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/
Date Wed, 12 Oct 2011 22:10:49 GMT
Author: patanachai
Date: Wed Oct 12 22:10:49 2011
New Revision: 1182598

URL: http://svn.apache.org/viewvc?rev=1182598&view=rev
Log:
Fix build error

Modified:
    incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/parameter/ParameterFactory.java
    incubator/airavata/trunk/modules/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/PropertiesBasedServiceImplTest.java

Modified: incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/parameter/ParameterFactory.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/parameter/ParameterFactory.java?rev=1182598&r1=1182597&r2=1182598&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/parameter/ParameterFactory.java
(original)
+++ incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/parameter/ParameterFactory.java
Wed Oct 12 22:10:49 2011
@@ -74,9 +74,9 @@ public class ParameterFactory {
                     Class<? extends AbstractParameter> cl = Class.forName(config.getString(key)).asSubclass(
                             AbstractParameter.class);
 
-                    map.put(key, cl);
+                    map.put(key.toLowerCase(), cl);
                     DataType type = new DataType(key);
-                    typeMap.put(key, type);
+                    typeMap.put(key.toLowerCase(), type);
                     types.add(type);
 
                 } catch (Exception e) {
@@ -106,18 +106,20 @@ public class ParameterFactory {
     }
     
     public AbstractParameter createActualParameter(String type) throws Exception{
-        if (!map.containsKey(type))
+        String lower = type.toLowerCase();
+        if (!map.containsKey(lower))
             throw new RuntimeException("Type is not supprted: " + type);
-        Class<? extends AbstractParameter> cl = map.get(type);
+        Class<? extends AbstractParameter> cl = map.get(lower);
         AbstractParameter result = cl.newInstance();
-        result.setType(getType(type));
+        result.setType(getType(lower));
         return result;
     }
     
     public DataType getType(String type){
-        if (!typeMap.containsKey(type))
+        String lower = type.toLowerCase();
+        if (!typeMap.containsKey(lower))
             throw new RuntimeException("Type is not supprted: " + type);
-        return typeMap.get(type);
+        return typeMap.get(lower);
     }
 
     public boolean hasType(DataType dataType, String type){

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=1182598&r1=1182597&r2=1182598&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
Wed Oct 12 22:10:49 2011
@@ -120,7 +120,7 @@ public class PropertiesBasedServiceImplT
 			 * Input
 			 */
 			ParameterContextImpl input = new ParameterContextImpl();
-			StringParameter echo_input = new StringParameter();
+			AbstractParameter echo_input = ParameterFactory.getInstance().createActualParameter("String");
 			echo_input.parseStringVal("echo_output=hello");
 			input.add("echo_input", echo_input);
 
@@ -128,7 +128,7 @@ public class PropertiesBasedServiceImplT
 			 * Output
 			 */
 			ParameterContextImpl output = new ParameterContextImpl();
-			StringParameter echo_output = new StringParameter();
+			AbstractParameter echo_output = ParameterFactory.getInstance().createActualParameter("String");
 			output.add("echo_output", echo_output);
 
 			// parameter



Mime
View raw message