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/06/25 17:17:38 UTC
svn commit: r1139550 [6/6] - in /incubator/airavata/core/trunk/gfac: ./
.settings/ src/main/java/org/apache/airavata/core/gfac/context/
src/main/java/org/apache/airavata/core/gfac/context/impl/
src/main/java/org/apache/airavata/core/gfac/context/impl/u...
Modified: incubator/airavata/core/trunk/gfac/src/test/java/org/apache/airavata/core/gfac/services/impl/PropertiesBasedServiceImplTest.java
URL: http://svn.apache.org/viewvc/incubator/airavata/core/trunk/gfac/src/test/java/org/apache/airavata/core/gfac/services/impl/PropertiesBasedServiceImplTest.java?rev=1139550&r1=1139549&r2=1139550&view=diff
==============================================================================
--- incubator/airavata/core/trunk/gfac/src/test/java/org/apache/airavata/core/gfac/services/impl/PropertiesBasedServiceImplTest.java (original)
+++ incubator/airavata/core/trunk/gfac/src/test/java/org/apache/airavata/core/gfac/services/impl/PropertiesBasedServiceImplTest.java Sat Jun 25 15:17:35 2011
@@ -1,3 +1,24 @@
+/*
+ *
+ * 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.fail;
@@ -7,77 +28,77 @@ 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.services.impl.PropertiesBasedServiceImpl;
import org.apache.airavata.core.gfac.type.StringParameter;
import org.junit.Assert;
import org.junit.Test;
public class PropertiesBasedServiceImplTest {
- @Test
- public void testInit() {
- try{
- InvocationContext ct = new InvocationContext();
- ct.setExecutionContext(new ExecutionContextImpl());
-
- PropertiesBasedServiceImpl service = new PropertiesBasedServiceImpl();
- service.init();
- }catch(Exception e){
- e.printStackTrace();
- fail("ERROR");
- }
- }
-
- @Test
- public void testExecute() {
- try{
- InvocationContext ct = new InvocationContext();
- ct.setExecutionContext(new ExecutionContextImpl());
-
- ct.getExecutionContext().setNotificationService(new DummyNotification());
-
- GSISecurityContext gsiSecurityContext = new GSISecurityContext();
- gsiSecurityContext.setMyproxyServer("myproxy.teragrid.org");
- gsiSecurityContext.setMyproxyUserName("ogce");
- gsiSecurityContext.setMyproxyPasswd("Jdas7wph");
- gsiSecurityContext.setMyproxyLifetime(14400);
- ct.addSecurityContext("myproxy", gsiSecurityContext);
-
- ct.setServiceName("{http://www.extreme.indiana.edu/namespaces/2004/01/gFac}Echo_Service");
-
- //parameter
- ParameterContextImpl x = new ParameterContextImpl();
- StringParameter parameter = new StringParameter();
- parameter.fromString("Hello");
- x.addParameter("echo", parameter.getTypeName(), parameter);
- ct.addMessageContext("input", x);
-
- PropertiesBasedServiceImpl service = new PropertiesBasedServiceImpl();
- service.init();
- service.execute(ct);
-
- Assert.assertNotNull(ct.getMessageContext("output"));
- Assert.assertNotNull(ct.getMessageContext("output").getParameterValue("Echoed_Output"));
- Assert.assertEquals("\"Hello\"", ct.getMessageContext("output").getParameterValue("Echoed_Output").toString());
-
- }catch(Exception e){
- e.printStackTrace();
- fail("ERROR");
- }
- }
-
- @Test
- public void testDispose() {
- try{
- InvocationContext ct = new InvocationContext();
- ct.setExecutionContext(new ExecutionContextImpl());
-
- PropertiesBasedServiceImpl service = new PropertiesBasedServiceImpl();
- service.dispose();
- }catch(Exception e){
- e.printStackTrace();
- fail("ERROR");
- }
- }
+ @Test
+ public void testInit() {
+ try {
+ InvocationContext ct = new InvocationContext();
+ ct.setExecutionContext(new ExecutionContextImpl());
+
+ PropertiesBasedServiceImpl service = new PropertiesBasedServiceImpl();
+ service.init();
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail("ERROR");
+ }
+ }
+
+ @Test
+ public void testExecute() {
+ try {
+ InvocationContext ct = new InvocationContext();
+ ct.setExecutionContext(new ExecutionContextImpl());
+
+ ct.getExecutionContext().setNotificationService(new DummyNotification());
+
+ GSISecurityContext gsiSecurityContext = new GSISecurityContext();
+ gsiSecurityContext.setMyproxyServer("myproxy.teragrid.org");
+ gsiSecurityContext.setMyproxyUserName("ogce");
+ gsiSecurityContext.setMyproxyPasswd("Jdas7wph");
+ gsiSecurityContext.setMyproxyLifetime(14400);
+ ct.addSecurityContext("myproxy", gsiSecurityContext);
+
+ ct.setServiceName("{http://www.extreme.indiana.edu/namespaces/2004/01/gFac}Echo_Service");
+
+ // parameter
+ ParameterContextImpl x = new ParameterContextImpl();
+ StringParameter parameter = new StringParameter();
+ parameter.fromString("Hello");
+ x.addParameter("echo", parameter.getTypeName(), parameter);
+ ct.addMessageContext("input", x);
+
+ PropertiesBasedServiceImpl service = new PropertiesBasedServiceImpl();
+ service.init();
+ service.execute(ct);
+
+ Assert.assertNotNull(ct.getMessageContext("output"));
+ Assert.assertNotNull(ct.getMessageContext("output").getParameterValue("Echoed_Output"));
+ Assert.assertEquals("\"Hello\"", ct.getMessageContext("output").getParameterValue("Echoed_Output")
+ .toString());
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail("ERROR");
+ }
+ }
+
+ @Test
+ public void testDispose() {
+ try {
+ InvocationContext ct = new InvocationContext();
+ ct.setExecutionContext(new ExecutionContextImpl());
+
+ PropertiesBasedServiceImpl service = new PropertiesBasedServiceImpl();
+ service.dispose();
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail("ERROR");
+ }
+ }
}
Modified: incubator/airavata/core/trunk/gfac/src/test/java/org/apache/airavata/core/gfac/type/StringParameterTest.java
URL: http://svn.apache.org/viewvc/incubator/airavata/core/trunk/gfac/src/test/java/org/apache/airavata/core/gfac/type/StringParameterTest.java?rev=1139550&r1=1139549&r2=1139550&view=diff
==============================================================================
--- incubator/airavata/core/trunk/gfac/src/test/java/org/apache/airavata/core/gfac/type/StringParameterTest.java (original)
+++ incubator/airavata/core/trunk/gfac/src/test/java/org/apache/airavata/core/gfac/type/StringParameterTest.java Sat Jun 25 15:17:35 2011
@@ -1,14 +1,33 @@
+/*
+ *
+ * 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 org.apache.airavata.core.gfac.type.StringParameter;
import org.junit.Test;
-
public class StringParameterTest {
- @Test
- public void getName() {
- StringParameter x = new StringParameter();
- x.fromString("xxx");
- System.out.println(x.getTypeName());
- }
+ @Test
+ public void getName() {
+ StringParameter x = new StringParameter();
+ x.fromString("xxx");
+ System.out.println(x.getTypeName());
+ }
}
Modified: incubator/airavata/core/trunk/gfac/src/test/resources/service.properties
URL: http://svn.apache.org/viewvc/incubator/airavata/core/trunk/gfac/src/test/resources/service.properties?rev=1139550&r1=1139549&r2=1139550&view=diff
==============================================================================
--- incubator/airavata/core/trunk/gfac/src/test/resources/service.properties (original)
+++ incubator/airavata/core/trunk/gfac/src/test/resources/service.properties Sat Jun 25 15:17:35 2011
@@ -1,7 +1,28 @@
+#
+#
+# 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.
+#
+#
+
ssl.hostcertsKeyFile=/home/ptangcha/ogce-workspace/sgfac/target/dist-bin/conf/ogce_services_key.pem
ssl.trustedCertsFile=/home/ptangcha/ogce-workspace/sgfac/target/dist-bin/certificates
registryURL=https://ogceportal.iu.teragrid.org:19443/xregistry
scheduler.class= org.apache.airavata.core.gfac.scheduler.impl.SchedulerImpl
datachain.classes=org.apache.airavata.core.gfac.extension.data.RegistryDataService
#prechain.classes=
-#postchain.classes
\ No newline at end of file
+#postchain.classes