summaryrefslogtreecommitdiffstats
path: root/bindings/func-java/src/test
diff options
context:
space:
mode:
authormakkalot <makkalot@gmail.com>2008-07-18 10:34:37 +0300
committermakkalot <makkalot@gmail.com>2008-07-18 10:34:37 +0300
commit8d1588e5644672e64785a6e4500d356eafdd9f4e (patch)
tree9777bff2cf294f56cc9f4ef9fb402416cb69a977 /bindings/func-java/src/test
parent36a4693b112a0435cac5420dee110634c445cefd (diff)
parentb53416b16bd54bf7a0ffbc0029d71b2a71e84a87 (diff)
downloadfunc-8d1588e5644672e64785a6e4500d356eafdd9f4e.tar.gz
func-8d1588e5644672e64785a6e4500d356eafdd9f4e.tar.xz
func-8d1588e5644672e64785a6e4500d356eafdd9f4e.zip
Merge branch 'async_status' into new_layout
Diffstat (limited to 'bindings/func-java/src/test')
-rw-r--r--bindings/func-java/src/test/groovy/FuncFactoryTest.groovy32
-rw-r--r--bindings/func-java/src/test/groovy/org/func/FuncFactoryTest.groovy38
-rw-r--r--bindings/func-java/src/test/groovy/org/func/FuncImplTest.groovy62
3 files changed, 132 insertions, 0 deletions
diff --git a/bindings/func-java/src/test/groovy/FuncFactoryTest.groovy b/bindings/func-java/src/test/groovy/FuncFactoryTest.groovy
new file mode 100644
index 0000000..fd0ab86
--- /dev/null
+++ b/bindings/func-java/src/test/groovy/FuncFactoryTest.groovy
@@ -0,0 +1,32 @@
+import org.func.FuncFactory
+import org.func.Func
+
+/**
+ * Copyright (C) 2008, Byte-Code srl <http://www.byte-code.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Date: Jul 11, 2008
+ * Time: 10:06:03 AM
+ */
+class FuncFactoryTest extends GroovyTestCase {
+
+ void testFuncFactory() {
+ def func = FuncFactory.getFunc()
+
+ assertNotNull ("Func Factory returns a null Func Implementation", func)
+ assertTrue ("Func Factory does not return a correct Func object", func instanceof Func)
+ }
+
+} \ No newline at end of file
diff --git a/bindings/func-java/src/test/groovy/org/func/FuncFactoryTest.groovy b/bindings/func-java/src/test/groovy/org/func/FuncFactoryTest.groovy
new file mode 100644
index 0000000..0cbc0f7
--- /dev/null
+++ b/bindings/func-java/src/test/groovy/org/func/FuncFactoryTest.groovy
@@ -0,0 +1,38 @@
+package org.func
+
+import org.func.FuncFactory
+import org.func.Func
+
+/**
+ * Copyright (C) 2008, Byte-Code srl <http://www.byte-code.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Date: Jul 11, 2008
+ * Time: 10:06:03 AM
+ *
+ * @author Marco Mornati
+ * @e-mail mmornati@byte-code.com
+ * @version 1.0
+ */
+class FuncFactoryTest extends GroovyTestCase {
+
+ void testFuncFactory() {
+ def func = FuncFactory.getFunc()
+
+ assertNotNull("Func Factory returns a null Func Implementation", func)
+ assertTrue("Func Factory does not return a correct Func object", func instanceof Func)
+ }
+
+} \ No newline at end of file
diff --git a/bindings/func-java/src/test/groovy/org/func/FuncImplTest.groovy b/bindings/func-java/src/test/groovy/org/func/FuncImplTest.groovy
new file mode 100644
index 0000000..cd9ce60
--- /dev/null
+++ b/bindings/func-java/src/test/groovy/org/func/FuncImplTest.groovy
@@ -0,0 +1,62 @@
+package org.func
+
+import org.jvyaml.YAML
+
+/**
+ * Copyright (C) 2008, Byte-Code srl <http://www.byte-code.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Date: Jul 11, 2008
+ * Time: 10:30:47 AM
+ *
+ * @author Marco Mornati
+ * @e-mail mmornati@byte-code.com
+ * @version 1.0
+ *
+ */
+class FuncImplTest extends GroovyTestCase {
+
+ void testCall() {
+ Func func = FuncFactory.getFunc("/home/mmornati/projects/func/scripts/func-transmit")
+ def response = func.call ("*", "hardware", "info")
+ assertTrue ("Func Response is not a Map", response instanceof Map)
+ }
+
+ void testListModules() {
+ Func func = FuncFactory.getFunc("/home/mmornati/projects/func/scripts/func-transmit")
+ def response = func.listModules("bcmmornati")
+ assertTrue ("Func Response is not a Map", response instanceof Map)
+ }
+
+ void testListModuleMethods() {
+ Func func = FuncFactory.getFunc("/home/mmornati/projects/func/scripts/func-transmit")
+ def response = func.listModuleMethods("bcmmornati", "hardware")
+ assertTrue ("Func Response is not a Map", response instanceof Map)
+ }
+
+ void testClientPatch() {
+ def clients = ["client1", "client2"]
+ FuncImpl func = FuncFactory.getFunc()
+ def returned = func.clientsCallPatch(clients)
+ assertEquals ("Error in ClientsPatch generation", returned, "client1;client2")
+ }
+
+ void testListMinions() {
+ Func func = FuncFactory.getFunc()
+ def response = func.listMinions()
+ assertTrue ("Error in calling listMinions", response instanceof List)
+ }
+
+} \ No newline at end of file