Fix for testcases
[jabaws.git] / engine / compbio / engine / client / EnvVariableProcessor.java
index 3423c8f..5d161df 100644 (file)
@@ -18,6 +18,7 @@
 \r
 package compbio.engine.client;\r
 \r
+import java.util.Arrays;\r
 import java.util.Collections;\r
 import java.util.Map;\r
 \r
@@ -46,6 +47,7 @@ public class EnvVariableProcessor {
        }\r
 \r
        static String[] getEnvVariableList(String property) {\r
+               property = property.trim(); \r
                if (containsMultipleVariables(property)) {\r
                        return property.split(NEXT_ENV_PROPERTY_DELIMITER);\r
                }\r
@@ -63,7 +65,8 @@ public class EnvVariableProcessor {
                                        "Must be only one value per property! Make sure the property does not contain '"\r
                                                        + PROP_NAME_VALUE_SEPARATOR + "' symbol!");\r
                }\r
-               if (vars.length == 0) {\r
+               if (vars.length == 0 || vars.length==1) {\r
+                       log.warn("Environmental variable '"+property+"' does not have a value!");\r
                        return "";\r
                }\r
                return vars[1];\r
@@ -76,14 +79,7 @@ public class EnvVariableProcessor {
                return property.contains(PROP_NAME_VALUE_SEPARATOR);\r
        }\r
 \r
-       /**\r
-        * This method change relative paths to absolute for two environmental\r
-        * variables MAFFT-BINARIES and FASTA_4_MAFFT to avoid requesting every user\r
-        * to specify these path for every installation\r
-        */\r
-       void absolutiseMafftpaths() {\r
 \r
-       }\r
 \r
        /*\r
         * This is a horrible hack, but it only requires to simplify configuration\r
@@ -108,6 +104,7 @@ public class EnvVariableProcessor {
                                                + PROP_NAME_VALUE_SEPARATOR + "propertyValue. "\r
                                                + "Given values is: " + evar);\r
                        }\r
+                       evar=evar.trim(); \r
                        String varName = getEnvVariableName(evar);\r
                        String varValue = getEnvVariableValue(evar);\r
                        // absolutise local paths to mafft env variables\r