Fix external_objects_java module tests under Linux/Mac OS X 75/12575/3
Vincent COUVERT [Wed, 18 Sep 2013 09:07:32 +0000 (11:07 +0200)]
Change-Id: I128fad2d074877821b3a87ea55ca9b718f4b7da6

17 files changed:
scilab/modules/external_objects_java/Makefile.am
scilab/modules/external_objects_java/Makefile.in
scilab/modules/external_objects_java/tests/unit_tests/bean-helper.dia.ref
scilab/modules/external_objects_java/tests/unit_tests/bean-helper.tst
scilab/modules/external_objects_java/tests/unit_tests/ecjclasspath.sce [new file with mode: 0644]
scilab/modules/external_objects_java/tests/unit_tests/jautoUnwrap.dia.ref
scilab/modules/external_objects_java/tests/unit_tests/jautoUnwrap.tst
scilab/modules/external_objects_java/tests/unit_tests/jcompile.dia.ref
scilab/modules/external_objects_java/tests/unit_tests/jcompile.tst
scilab/modules/external_objects_java/tests/unit_tests/jinvoke_db.dia.ref
scilab/modules/external_objects_java/tests/unit_tests/jinvoke_db.tst
scilab/modules/external_objects_java/tests/unit_tests/jsetfield.dia.ref
scilab/modules/external_objects_java/tests/unit_tests/jsetfield.tst
scilab/modules/external_objects_java/tests/unit_tests/junwrap.dia.ref
scilab/modules/external_objects_java/tests/unit_tests/junwrap.tst
scilab/modules/external_objects_java/tests/unit_tests/jwrap.dia.ref
scilab/modules/external_objects_java/tests/unit_tests/jwrap.tst

index 82440f7..8360e90 100644 (file)
@@ -127,6 +127,11 @@ libsciexternal_objects_java_la_sci_gateway_DATA = sci_gateway/external_objects_j
 libsciexternal_objects_java_la_includedir=$(pkgincludedir)
 libsciexternal_objects_java_la_include_HEADERS =
 
+#### external_objects_java : test files ####
+libsciexternal_objects_java_la_testsdir = $(mydatadir)/tests/
+libsciexternal_objects_java_la_tests_DATA = \
+tests/libintl.jar
+
 if GUI
 USEANT=1
 endif
index c26a131..474dd3e 100644 (file)
@@ -168,6 +168,7 @@ am__installdirs = "$(DESTDIR)$(pkglibdir)" \
        "$(DESTDIR)$(libsciexternal_objects_java_la_etcdir)" \
        "$(DESTDIR)$(libsciexternal_objects_java_la_rootdir)" \
        "$(DESTDIR)$(libsciexternal_objects_java_la_sci_gatewaydir)" \
+       "$(DESTDIR)$(libsciexternal_objects_java_la_testsdir)" \
        "$(DESTDIR)$(libsciexternal_objects_java_la_includedir)"
 LTLIBRARIES = $(noinst_LTLIBRARIES) $(pkglib_LTLIBRARIES)
 libsciexternal_objects_java_algo_la_LIBADD =
@@ -294,7 +295,8 @@ am__can_run_installinfo = \
   esac
 DATA = $(libsciexternal_objects_java_la_etc_DATA) \
        $(libsciexternal_objects_java_la_root_DATA) \
-       $(libsciexternal_objects_java_la_sci_gateway_DATA)
+       $(libsciexternal_objects_java_la_sci_gateway_DATA) \
+       $(libsciexternal_objects_java_la_tests_DATA)
 HEADERS = $(libsciexternal_objects_java_la_include_HEADERS)
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
 # Read a list of newline-separated strings from the standard input,
@@ -760,6 +762,12 @@ libsciexternal_objects_java_la_sci_gateway_DATA = sci_gateway/external_objects_j
 #### external_objects_java : include files ####
 libsciexternal_objects_java_la_includedir = $(pkgincludedir)
 libsciexternal_objects_java_la_include_HEADERS = 
+
+#### external_objects_java : test files ####
+libsciexternal_objects_java_la_testsdir = $(mydatadir)/tests/
+libsciexternal_objects_java_la_tests_DATA = \
+tests/libintl.jar
+
 @GUI_TRUE@USEANT = 1
 all: $(BUILT_SOURCES)
        $(MAKE) $(AM_MAKEFLAGS) all-am
@@ -1263,6 +1271,27 @@ uninstall-libsciexternal_objects_java_la_sci_gatewayDATA:
        @list='$(libsciexternal_objects_java_la_sci_gateway_DATA)'; test -n "$(libsciexternal_objects_java_la_sci_gatewaydir)" || list=; \
        files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
        dir='$(DESTDIR)$(libsciexternal_objects_java_la_sci_gatewaydir)'; $(am__uninstall_files_from_dir)
+install-libsciexternal_objects_java_la_testsDATA: $(libsciexternal_objects_java_la_tests_DATA)
+       @$(NORMAL_INSTALL)
+       @list='$(libsciexternal_objects_java_la_tests_DATA)'; test -n "$(libsciexternal_objects_java_la_testsdir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(libsciexternal_objects_java_la_testsdir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(libsciexternal_objects_java_la_testsdir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(libsciexternal_objects_java_la_testsdir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(libsciexternal_objects_java_la_testsdir)" || exit $$?; \
+       done
+
+uninstall-libsciexternal_objects_java_la_testsDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(libsciexternal_objects_java_la_tests_DATA)'; test -n "$(libsciexternal_objects_java_la_testsdir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       dir='$(DESTDIR)$(libsciexternal_objects_java_la_testsdir)'; $(am__uninstall_files_from_dir)
 install-libsciexternal_objects_java_la_includeHEADERS: $(libsciexternal_objects_java_la_include_HEADERS)
        @$(NORMAL_INSTALL)
        @list='$(libsciexternal_objects_java_la_include_HEADERS)'; test -n "$(libsciexternal_objects_java_la_includedir)" || list=; \
@@ -1373,7 +1402,7 @@ check: $(BUILT_SOURCES)
        $(MAKE) $(AM_MAKEFLAGS) check-am
 all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) all-local
 installdirs:
-       for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(libsciexternal_objects_java_la_etcdir)" "$(DESTDIR)$(libsciexternal_objects_java_la_rootdir)" "$(DESTDIR)$(libsciexternal_objects_java_la_sci_gatewaydir)" "$(DESTDIR)$(libsciexternal_objects_java_la_includedir)"; do \
+       for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(libsciexternal_objects_java_la_etcdir)" "$(DESTDIR)$(libsciexternal_objects_java_la_rootdir)" "$(DESTDIR)$(libsciexternal_objects_java_la_sci_gatewaydir)" "$(DESTDIR)$(libsciexternal_objects_java_la_testsdir)" "$(DESTDIR)$(libsciexternal_objects_java_la_includedir)"; do \
          test -z "$$dir" || $(MKDIR_P) "$$dir"; \
        done
 install: $(BUILT_SOURCES)
@@ -1435,7 +1464,8 @@ install-data-am: install-data-local \
        install-libsciexternal_objects_java_la_etcDATA \
        install-libsciexternal_objects_java_la_includeHEADERS \
        install-libsciexternal_objects_java_la_rootDATA \
-       install-libsciexternal_objects_java_la_sci_gatewayDATA
+       install-libsciexternal_objects_java_la_sci_gatewayDATA \
+       install-libsciexternal_objects_java_la_testsDATA
 
 install-dvi: install-dvi-am
 
@@ -1485,6 +1515,7 @@ uninstall-am: uninstall-libsciexternal_objects_java_la_etcDATA \
        uninstall-libsciexternal_objects_java_la_includeHEADERS \
        uninstall-libsciexternal_objects_java_la_rootDATA \
        uninstall-libsciexternal_objects_java_la_sci_gatewayDATA \
+       uninstall-libsciexternal_objects_java_la_testsDATA \
        uninstall-pkglibLTLIBRARIES
 
 .MAKE: all check check-am install install-am install-strip
@@ -1502,16 +1533,18 @@ uninstall-am: uninstall-libsciexternal_objects_java_la_etcDATA \
        install-libsciexternal_objects_java_la_includeHEADERS \
        install-libsciexternal_objects_java_la_rootDATA \
        install-libsciexternal_objects_java_la_sci_gatewayDATA \
-       install-man install-pdf install-pdf-am \
-       install-pkglibLTLIBRARIES install-ps install-ps-am \
-       install-strip installcheck installcheck-am installdirs \
-       maintainer-clean maintainer-clean-generic mostlyclean \
-       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
-       pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
+       install-libsciexternal_objects_java_la_testsDATA install-man \
+       install-pdf install-pdf-am install-pkglibLTLIBRARIES \
+       install-ps install-ps-am install-strip installcheck \
+       installcheck-am installdirs maintainer-clean \
+       maintainer-clean-generic mostlyclean mostlyclean-compile \
+       mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+       tags tags-am uninstall uninstall-am \
        uninstall-libsciexternal_objects_java_la_etcDATA \
        uninstall-libsciexternal_objects_java_la_includeHEADERS \
        uninstall-libsciexternal_objects_java_la_rootDATA \
        uninstall-libsciexternal_objects_java_la_sci_gatewayDATA \
+       uninstall-libsciexternal_objects_java_la_testsDATA \
        uninstall-pkglibLTLIBRARIES
 
 
index 66a5889..c878542 100644 (file)
@@ -4,16 +4,17 @@
 //
 //  This file is distributed under the same license as the Scilab package.
 // =============================================================================
+exec("SCI/modules/external_objects_java/tests/unit_tests/ecjclasspath.sce", -1);
 c = jcompile("Test", ["public class Test {";
-       "private double field;";
-       "public Test() {";
-       "}";
-       "public double getField() {";
-       "return field;";
-       "}";
-       "public void setField(double a) {";
-       "field = a;";
-       "}";
-       "}";]);
+"private double field;";
+"public Test() {";
+"}";
+"public double getField() {";
+"return field;";
+"}";
+"public void setField(double a) {";
+"field = a;";
+"}";
+"}";]);
 a = c.new();
 a.field=2;
index deb650a..81939fd 100644 (file)
@@ -5,17 +5,18 @@
 //  This file is distributed under the same license as the Scilab package.
 // =============================================================================
 
+exec("SCI/modules/external_objects_java/tests/unit_tests/ecjclasspath.sce", -1);
 
 c = jcompile("Test", ["public class Test {";
-       "private double field;";
-       "public Test() {";
-       "}";
-       "public double getField() {";
-       "return field;";
-       "}";
-       "public void setField(double a) {";
-       "field = a;";
-       "}";
-       "}";]);
+"private double field;";
+"public Test() {";
+"}";
+"public double getField() {";
+"return field;";
+"}";
+"public void setField(double a) {";
+"field = a;";
+"}";
+"}";]);
 a = c.new();
 a.field=2;
diff --git a/scilab/modules/external_objects_java/tests/unit_tests/ecjclasspath.sce b/scilab/modules/external_objects_java/tests/unit_tests/ecjclasspath.sce
new file mode 100644 (file)
index 0000000..d704c53
--- /dev/null
@@ -0,0 +1,15 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Vincent COUVERT
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// Add ecj to classpath if needed
+if getos()<>"Windows" then
+    if isdir(SCI + "/thirdparty/") then
+        javaclasspath(SCI + "/thirdparty/ecj.jar"); // Source version
+    elseif isdir(SCI + "/../../thirdparty/") then
+        javaclasspath(SCI + "/../../thirdparty/ecj.jar"); // Binary version
+    end
+end
index 46defd7..c0aaf3a 100644 (file)
@@ -4,6 +4,7 @@
 //
 //  This file is distributed under the same license as the Scilab package.
 // =============================================================================
+exec("SCI/modules/external_objects_java/tests/unit_tests/ecjclasspath.sce", -1);
 jautoUnwrap(%t)
 assert_checktrue(jautoUnwrap());
 jautoUnwrap(%f);
index af5a817..e2023b2 100644 (file)
@@ -5,6 +5,8 @@
 //  This file is distributed under the same license as the Scilab package.
 // =============================================================================
 
+exec("SCI/modules/external_objects_java/tests/unit_tests/ecjclasspath.sce", -1);
+
 jautoUnwrap(%t)
 assert_checktrue(jautoUnwrap());
 jautoUnwrap(%f);
index 54beb62..4b55d42 100644 (file)
 //
 // <-- JVM MANDATORY -->
 //
+exec("SCI/modules/external_objects_java/tests/unit_tests/ecjclasspath.sce", -1);
 c = jcompile("Test", ["public class Test {";
-       "public int field;";
-       "public Test(int n) {";
-       "field = n;";
-       "}";
-       "}";]);
+"public int field;";
+"public Test(int n) {";
+"field = n;";
+"}";
+"}";]);
 assert_checkequal(jgetclassname(c),"Test");
 t = c.new(128);
 v = jgetfield(t, "field");
 // or easier
 //junwraprem(t.field)
 jremove c t v;
-fd = mopen(TMPDIR+'/HelloWorld.java','wt');
+fd = mopen(TMPDIR+"/HelloWorld.java","wt");
 mputl(["public class HelloWorld {"
-                   "public static String getHello() {"
-                   "return ""Hello World !!"";"
-                   "}"
-                   "}"],fd);
+"public static String getHello() {"
+"return ""Hello World !!"";"
+"}"
+"}"],fd);
 mclose(fd);
 jcompile(TMPDIR+"/HelloWorld.java")
 jimport HelloWorld;
index 61f39d0..d53deb5 100644 (file)
 // <-- JVM MANDATORY -->
 //
 
+exec("SCI/modules/external_objects_java/tests/unit_tests/ecjclasspath.sce", -1);
+
 c = jcompile("Test", ["public class Test {";
-       "public int field;";
-       "public Test(int n) {";
-       "field = n;";
-       "}";
-       "}";]);
+"public int field;";
+"public Test(int n) {";
+"field = n;";
+"}";
+"}";]);
 assert_checkequal(jgetclassname(c),"Test");
 
 t = c.new(128);
@@ -28,12 +30,12 @@ v = jgetfield(t, "field");
 jremove c t v;
 
 
-fd = mopen(TMPDIR+'/HelloWorld.java','wt');
+fd = mopen(TMPDIR+"/HelloWorld.java","wt");
 mputl(["public class HelloWorld {"
-                   "public static String getHello() {"
-                   "return ""Hello World !!"";"
-                   "}"
-                   "}"],fd);
+"public static String getHello() {"
+"return ""Hello World !!"";"
+"}"
+"}"],fd);
 mclose(fd);
 
 jcompile(TMPDIR+"/HelloWorld.java")
index 69acb68..eb1f801 100644 (file)
@@ -5,12 +5,13 @@
 //
 //  This file is distributed under the same license as the Scilab package.
 // =============================================================================
+exec("SCI/modules/external_objects_java/tests/unit_tests/ecjclasspath.sce", -1);
 c = jcompile("TestDirectBuffer",["import java.nio.DoubleBuffer;";
-                                 "public class TestDirectBuffer {";
-                                 "public static void increment(DoubleBuffer x) {";
-                                 "for (int i = 0; i < x.capacity(); i++) x.put(i, x.get(i) + 1);";
-                                 "}";
-                                 "}"])
+"public class TestDirectBuffer {";
+"public static void increment(DoubleBuffer x) {";
+"for (int i = 0; i < x.capacity(); i++) x.put(i, x.get(i) + 1);";
+"}";
+"}"])
  c  =
  
 class TestDirectBuffer
index c5cd9b0..d8cbd7c 100644 (file)
@@ -6,12 +6,14 @@
 //  This file is distributed under the same license as the Scilab package.
 // =============================================================================
 
+exec("SCI/modules/external_objects_java/tests/unit_tests/ecjclasspath.sce", -1);
+
 c = jcompile("TestDirectBuffer",["import java.nio.DoubleBuffer;";
-                                 "public class TestDirectBuffer {";
-                                 "public static void increment(DoubleBuffer x) {";
-                                 "for (int i = 0; i < x.capacity(); i++) x.put(i, x.get(i) + 1);";
-                                 "}";
-                                 "}"])
+"public class TestDirectBuffer {";
+"public static void increment(DoubleBuffer x) {";
+"for (int i = 0; i < x.capacity(); i++) x.put(i, x.get(i) + 1);";
+"}";
+"}"])
 a = 1:10000;
 b = a + 1; // only used to compare with the following...
 jinvoke_db(c, "increment", "a");
index d63fd0a..76039da 100644 (file)
@@ -4,14 +4,15 @@
 //
 //  This file is distributed under the same license as the Scilab package.
 // ===================================================================
+exec("SCI/modules/external_objects_java/tests/unit_tests/ecjclasspath.sce", -1);
 s = "Hello World !";
 r = jgetfield(jwrap(s), "CASE_INSENSITIVE_ORDER");
 c = jcompile("Test", ["public class Test {";
-       "public int field;";
-       "public Test(int n) {";
-       "field = n;";
-       "}";
-       "}";]);
+"public int field;";
+"public Test(int n) {";
+"field = n;";
+"}";
+"}";]);
 t = c.new(128);
 jsetfield(t, "field", 256);
 assert_checkequal(int32(256), jgetfield(t, "field"));
index 683ffc7..a038379 100644 (file)
@@ -5,15 +5,17 @@
 //  This file is distributed under the same license as the Scilab package.
 // ===================================================================
 
+exec("SCI/modules/external_objects_java/tests/unit_tests/ecjclasspath.sce", -1);
+
 s = "Hello World !";
 r = jgetfield(jwrap(s), "CASE_INSENSITIVE_ORDER");
 
 c = jcompile("Test", ["public class Test {";
-       "public int field;";
-       "public Test(int n) {";
-       "field = n;";
-       "}";
-       "}";]);
+"public int field;";
+"public Test(int n) {";
+"field = n;";
+"}";
+"}";]);
 t = c.new(128);
 jsetfield(t, "field", 256);
 assert_checkequal(int32(256), jgetfield(t, "field"));
\ No newline at end of file
index 97f1b65..fd621ea 100644 (file)
@@ -4,6 +4,7 @@
 //
 //  This file is distributed under the same license as the Scilab package.
 // =============================================================================
+exec("SCI/modules/external_objects_java/tests/unit_tests/ecjclasspath.sce", -1);
 jautoUnwrap(%f);
 myString=jwrap("foo");
 assert_checkequal(jgetclassname(myString),"java.lang.String");
@@ -14,103 +15,103 @@ assert_checkequal(jgetclassname(a),"double");
 b=junwrap(a);
 assert_checkequal(typeof(b),"constant");
 c = jcompile("Test", ["public class Test {";
-    "public int[] returnArrayInt() {";
-    "    return new int[]{1,2,3,4};";
-    "}";
-    "}";]);
+"public int[] returnArrayInt() {";
+"    return new int[]{1,2,3,4};";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(int32([1,2,3,4]), junwrap(t.returnArrayInt()));
 c = jcompile("Test", ["public class Test {";
-    "public int returnInt() {";
-    "    return 32;";
-    "}";
-    "}";]);
+"public int returnInt() {";
+"    return 32;";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(int32(32), junwrap(t.returnInt()));
 //////////////////////////////////////////////
 c = jcompile("Test", ["public class Test {";
-    "public double[] returnDouble() {";
-    "    return new double[]{1,2,3,4};";
-    "}";
-    "}";]);
+"public double[] returnDouble() {";
+"    return new double[]{1,2,3,4};";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal([1,2,3,4], junwrap(t.returnDouble()));
 c = jcompile("Test", ["public class Test {";
-    "public double returnDouble() {";
-    "    return 32;";
-    "}";
-    "}";]);
+"public double returnDouble() {";
+"    return 32;";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(32, junwrap(t.returnDouble()));
 //////////////////////////////////////////////
 c = jcompile("Test", ["public class Test {";
-    "public byte[] returnByte() {";
-    "    return new byte[]{1,2,3,4};";
-    "}";
-    "}";]);
+"public byte[] returnByte() {";
+"    return new byte[]{1,2,3,4};";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(int8([1,2,3,4]), junwrap(t.returnByte()));
 c = jcompile("Test", ["public class Test {";
-    "public byte returnByte() {";
-    "    return 32;";
-    "}";
-    "}";]);
+"public byte returnByte() {";
+"    return 32;";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(int8(32), junwrap(t.returnByte()));
 //////////////////////////////////////////////
 c = jcompile("Test", ["public class Test {";
-    "public short[] returnShort() {";
-    "    return new short[]{1,2,3,4};";
-    "}";
-    "}";]);
+"public short[] returnShort() {";
+"    return new short[]{1,2,3,4};";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(int16([1,2,3,4]), junwrap(t.returnShort()));
 c = jcompile("Test", ["public class Test {";
-    "public short returnShort() {";
-    "    return 32;";
-    "}";
-    "}";]);
+"public short returnShort() {";
+"    return 32;";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(int16(32), junwrap(t.returnShort()));
 //////////////////////////////////////////////
 c = jcompile("Test", ["public class Test {";
-    "public long[] returnLong() {";
-    "    return new long[]{1L,2L,3L,4L};";
-    "}";
-    "}";]);
+"public long[] returnLong() {";
+"    return new long[]{1L,2L,3L,4L};";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(int32([1,2,3,4]), junwrap(t.returnLong()));
 c = jcompile("Test", ["public class Test {";
-    "public long returnLong() {";
-    "    return 32L;";
-    "}";
-    "}";]);
+"public long returnLong() {";
+"    return 32L;";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(int32(32), junwrap(t.returnLong()));
 //////////////////////////////////////////////
 c = jcompile("Test", ["public class Test {";
-    "public float[] returnFloat() {";
-    "    return new float[]{1f,2f,3f,4f};";
-    "}";
-    "}";]);
+"public float[] returnFloat() {";
+"    return new float[]{1f,2f,3f,4f};";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal([1,2,3,4], junwrap(t.returnFloat()));
 c = jcompile("Test", ["public class Test {";
-    "public float returnFloat() {";
-    "    return 32f;";
-    "}";
-    "}";]);
+"public float returnFloat() {";
+"    return 32f;";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(32, junwrap(t.returnFloat()));
@@ -133,26 +134,26 @@ assert_checkequal(32, junwrap(t.returnFloat()));
 // assert_checkequal(int16(32), t.returnChar());
 //////////////////////////////////////////////
 c = jcompile("Test", ["public class Test {";
-    "public boolean[] returnBoolean() {";
-    "    return new boolean[]{true,true,false,false};";
-    "}";
-    "}";]);
+"public boolean[] returnBoolean() {";
+"    return new boolean[]{true,true,false,false};";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal([%t,%t,%f,%f], junwrap(t.returnBoolean()));
 c = jcompile("Test", ["public class Test {";
-    "public boolean returnBoolean() {";
-    "    return true;";
-    "}";
-    "}";]);
+"public boolean returnBoolean() {";
+"    return true;";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(%t, junwrap(t.returnBoolean()));
 jautoUnwrap(%t);
 c = jcompile("Test", ["public class Test {";
-  "public static Double[][] foo(double d) {";
-  "Double[][] dd = new Double[][]{{d, d+1},{d+2,d+3}};";
-  "return dd;"
-  "}";
-  "}"]);
+"public static Double[][] foo(double d) {";
+"Double[][] dd = new Double[][]{{d, d+1},{d+2,d+3}};";
+"return dd;"
+"}";
+"}"]);
 assert_checkequal( [123,125;124,126], c.foo(123));
index 749a705..f56eff0 100644 (file)
@@ -5,6 +5,8 @@
 //  This file is distributed under the same license as the Scilab package.
 // =============================================================================
 
+exec("SCI/modules/external_objects_java/tests/unit_tests/ecjclasspath.sce", -1);
+
 jautoUnwrap(%f);
 myString=jwrap("foo");
 assert_checkequal(jgetclassname(myString),"java.lang.String");
@@ -18,19 +20,19 @@ assert_checkequal(typeof(b),"constant");
 
 
 c = jcompile("Test", ["public class Test {";
-    "public int[] returnArrayInt() {";
-    "    return new int[]{1,2,3,4};";
-    "}";
-    "}";]);
+"public int[] returnArrayInt() {";
+"    return new int[]{1,2,3,4};";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(int32([1,2,3,4]), junwrap(t.returnArrayInt()));
 
 c = jcompile("Test", ["public class Test {";
-    "public int returnInt() {";
-    "    return 32;";
-    "}";
-    "}";]);
+"public int returnInt() {";
+"    return 32;";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(int32(32), junwrap(t.returnInt()));
@@ -38,19 +40,19 @@ assert_checkequal(int32(32), junwrap(t.returnInt()));
 //////////////////////////////////////////////
 
 c = jcompile("Test", ["public class Test {";
-    "public double[] returnDouble() {";
-    "    return new double[]{1,2,3,4};";
-    "}";
-    "}";]);
+"public double[] returnDouble() {";
+"    return new double[]{1,2,3,4};";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal([1,2,3,4], junwrap(t.returnDouble()));
 
 c = jcompile("Test", ["public class Test {";
-    "public double returnDouble() {";
-    "    return 32;";
-    "}";
-    "}";]);
+"public double returnDouble() {";
+"    return 32;";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(32, junwrap(t.returnDouble()));
@@ -58,19 +60,19 @@ assert_checkequal(32, junwrap(t.returnDouble()));
 //////////////////////////////////////////////
 
 c = jcompile("Test", ["public class Test {";
-    "public byte[] returnByte() {";
-    "    return new byte[]{1,2,3,4};";
-    "}";
-    "}";]);
+"public byte[] returnByte() {";
+"    return new byte[]{1,2,3,4};";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(int8([1,2,3,4]), junwrap(t.returnByte()));
 
 c = jcompile("Test", ["public class Test {";
-    "public byte returnByte() {";
-    "    return 32;";
-    "}";
-    "}";]);
+"public byte returnByte() {";
+"    return 32;";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(int8(32), junwrap(t.returnByte()));
@@ -78,19 +80,19 @@ assert_checkequal(int8(32), junwrap(t.returnByte()));
 //////////////////////////////////////////////
 
 c = jcompile("Test", ["public class Test {";
-    "public short[] returnShort() {";
-    "    return new short[]{1,2,3,4};";
-    "}";
-    "}";]);
+"public short[] returnShort() {";
+"    return new short[]{1,2,3,4};";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(int16([1,2,3,4]), junwrap(t.returnShort()));
 
 c = jcompile("Test", ["public class Test {";
-    "public short returnShort() {";
-    "    return 32;";
-    "}";
-    "}";]);
+"public short returnShort() {";
+"    return 32;";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(int16(32), junwrap(t.returnShort()));
@@ -99,19 +101,19 @@ assert_checkequal(int16(32), junwrap(t.returnShort()));
 //////////////////////////////////////////////
 
 c = jcompile("Test", ["public class Test {";
-    "public long[] returnLong() {";
-    "    return new long[]{1L,2L,3L,4L};";
-    "}";
-    "}";]);
+"public long[] returnLong() {";
+"    return new long[]{1L,2L,3L,4L};";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(int32([1,2,3,4]), junwrap(t.returnLong()));
 
 c = jcompile("Test", ["public class Test {";
-    "public long returnLong() {";
-    "    return 32L;";
-    "}";
-    "}";]);
+"public long returnLong() {";
+"    return 32L;";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(int32(32), junwrap(t.returnLong()));
@@ -119,19 +121,19 @@ assert_checkequal(int32(32), junwrap(t.returnLong()));
 //////////////////////////////////////////////
 
 c = jcompile("Test", ["public class Test {";
-    "public float[] returnFloat() {";
-    "    return new float[]{1f,2f,3f,4f};";
-    "}";
-    "}";]);
+"public float[] returnFloat() {";
+"    return new float[]{1f,2f,3f,4f};";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal([1,2,3,4], junwrap(t.returnFloat()));
 
 c = jcompile("Test", ["public class Test {";
-    "public float returnFloat() {";
-    "    return 32f;";
-    "}";
-    "}";]);
+"public float returnFloat() {";
+"    return 32f;";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(32, junwrap(t.returnFloat()));
@@ -162,19 +164,19 @@ assert_checkequal(32, junwrap(t.returnFloat()));
 //////////////////////////////////////////////
 
 c = jcompile("Test", ["public class Test {";
-    "public boolean[] returnBoolean() {";
-    "    return new boolean[]{true,true,false,false};";
-    "}";
-    "}";]);
+"public boolean[] returnBoolean() {";
+"    return new boolean[]{true,true,false,false};";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal([%t,%t,%f,%f], junwrap(t.returnBoolean()));
 
 c = jcompile("Test", ["public class Test {";
-    "public boolean returnBoolean() {";
-    "    return true;";
-    "}";
-    "}";]);
+"public boolean returnBoolean() {";
+"    return true;";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(%t, junwrap(t.returnBoolean()));
@@ -182,10 +184,10 @@ assert_checkequal(%t, junwrap(t.returnBoolean()));
 jautoUnwrap(%t);
 
 c = jcompile("Test", ["public class Test {";
-  "public static Double[][] foo(double d) {";
-  "Double[][] dd = new Double[][]{{d, d+1},{d+2,d+3}};";
-  "return dd;"
-  "}";
-  "}"]);
+"public static Double[][] foo(double d) {";
+"Double[][] dd = new Double[][]{{d, d+1},{d+2,d+3}};";
+"return dd;"
+"}";
+"}"]);
 
 assert_checkequal( [123,125;124,126], c.foo(123));
index 19ab29f..ea36434 100644 (file)
@@ -4,6 +4,7 @@
 //
 //  This file is distributed under the same license as the Scilab package.
 // =============================================================================
+exec("SCI/modules/external_objects_java/tests/unit_tests/ecjclasspath.sce", -1);
 myString=jwrap("foo");
 assert_checkequal(jgetclassname(myString),"java.lang.String");
 a=jwrap(2);
@@ -12,103 +13,103 @@ assert_checkequal(jgetclassname(a),"double");
 b=junwrap(a);
 assert_checkequal(typeof(b),"constant");
 c = jcompile("Test", ["public class Test {";
-    "public int[] returnArrayInt() {";
-    "    return new int[]{1,2,3,4};";
-    "}";
-    "}";]);
+"public int[] returnArrayInt() {";
+"    return new int[]{1,2,3,4};";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(int32([1,2,3,4]), t.returnArrayInt());
 c = jcompile("Test", ["public class Test {";
-    "public int returnInt() {";
-    "    return 32;";
-    "}";
-    "}";]);
+"public int returnInt() {";
+"    return 32;";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(int32(32), t.returnInt());
 //////////////////////////////////////////////
 c = jcompile("Test", ["public class Test {";
-    "public double[] returnDouble() {";
-    "    return new double[]{1,2,3,4};";
-    "}";
-    "}";]);
+"public double[] returnDouble() {";
+"    return new double[]{1,2,3,4};";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal([1,2,3,4], t.returnDouble());
 c = jcompile("Test", ["public class Test {";
-    "public double returnDouble() {";
-    "    return 32;";
-    "}";
-    "}";]);
+"public double returnDouble() {";
+"    return 32;";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(32, t.returnDouble());
 //////////////////////////////////////////////
 c = jcompile("Test", ["public class Test {";
-    "public byte[] returnByte() {";
-    "    return new byte[]{1,2,3,4};";
-    "}";
-    "}";]);
+"public byte[] returnByte() {";
+"    return new byte[]{1,2,3,4};";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(int8([1,2,3,4]), t.returnByte());
 c = jcompile("Test", ["public class Test {";
-    "public byte returnByte() {";
-    "    return 32;";
-    "}";
-    "}";]);
+"public byte returnByte() {";
+"    return 32;";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(int8(32), t.returnByte());
 //////////////////////////////////////////////
 c = jcompile("Test", ["public class Test {";
-    "public short[] returnShort() {";
-    "    return new short[]{1,2,3,4};";
-    "}";
-    "}";]);
+"public short[] returnShort() {";
+"    return new short[]{1,2,3,4};";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(int16([1,2,3,4]), t.returnShort());
 c = jcompile("Test", ["public class Test {";
-    "public short returnShort() {";
-    "    return 32;";
-    "}";
-    "}";]);
+"public short returnShort() {";
+"    return 32;";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(int16(32), t.returnShort());
 //////////////////////////////////////////////
 c = jcompile("Test", ["public class Test {";
-    "public long[] returnLong() {";
-    "    return new long[]{1L,2L,3L,4L};";
-    "}";
-    "}";]);
+"public long[] returnLong() {";
+"    return new long[]{1L,2L,3L,4L};";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(int32([1,2,3,4]), t.returnLong());
 c = jcompile("Test", ["public class Test {";
-    "public long returnLong() {";
-    "    return 32L;";
-    "}";
-    "}";]);
+"public long returnLong() {";
+"    return 32L;";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(int32(32), t.returnLong());
 //////////////////////////////////////////////
 c = jcompile("Test", ["public class Test {";
-    "public float[] returnFloat() {";
-    "    return new float[]{1f,2f,3f,4f};";
-    "}";
-    "}";]);
+"public float[] returnFloat() {";
+"    return new float[]{1f,2f,3f,4f};";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal([1,2,3,4], t.returnFloat());
 c = jcompile("Test", ["public class Test {";
-    "public float returnFloat() {";
-    "    return 32f;";
-    "}";
-    "}";]);
+"public float returnFloat() {";
+"    return 32f;";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(32, t.returnFloat());
@@ -131,18 +132,18 @@ assert_checkequal(32, t.returnFloat());
 // assert_checkequal(int16(32), t.returnChar());
 //////////////////////////////////////////////
 c = jcompile("Test", ["public class Test {";
-    "public boolean[] returnBoolean() {";
-    "    return new boolean[]{true,true,false,false};";
-    "}";
-    "}";]);
+"public boolean[] returnBoolean() {";
+"    return new boolean[]{true,true,false,false};";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal([%t,%t,%f,%f], t.returnBoolean());
 c = jcompile("Test", ["public class Test {";
-    "public boolean returnBoolean() {";
-    "    return true;";
-    "}";
-    "}";]);
+"public boolean returnBoolean() {";
+"    return true;";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(%t, t.returnBoolean());
index 38f3f5b..41bba9d 100644 (file)
@@ -5,6 +5,7 @@
 //  This file is distributed under the same license as the Scilab package.
 // =============================================================================
 
+exec("SCI/modules/external_objects_java/tests/unit_tests/ecjclasspath.sce", -1);
 
 myString=jwrap("foo");
 assert_checkequal(jgetclassname(myString),"java.lang.String");
@@ -17,19 +18,19 @@ assert_checkequal(typeof(b),"constant");
 
 
 c = jcompile("Test", ["public class Test {";
-    "public int[] returnArrayInt() {";
-    "    return new int[]{1,2,3,4};";
-    "}";
-    "}";]);
+"public int[] returnArrayInt() {";
+"    return new int[]{1,2,3,4};";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(int32([1,2,3,4]), t.returnArrayInt());
 
 c = jcompile("Test", ["public class Test {";
-    "public int returnInt() {";
-    "    return 32;";
-    "}";
-    "}";]);
+"public int returnInt() {";
+"    return 32;";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(int32(32), t.returnInt());
@@ -37,19 +38,19 @@ assert_checkequal(int32(32), t.returnInt());
 //////////////////////////////////////////////
 
 c = jcompile("Test", ["public class Test {";
-    "public double[] returnDouble() {";
-    "    return new double[]{1,2,3,4};";
-    "}";
-    "}";]);
+"public double[] returnDouble() {";
+"    return new double[]{1,2,3,4};";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal([1,2,3,4], t.returnDouble());
 
 c = jcompile("Test", ["public class Test {";
-    "public double returnDouble() {";
-    "    return 32;";
-    "}";
-    "}";]);
+"public double returnDouble() {";
+"    return 32;";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(32, t.returnDouble());
@@ -57,19 +58,19 @@ assert_checkequal(32, t.returnDouble());
 //////////////////////////////////////////////
 
 c = jcompile("Test", ["public class Test {";
-    "public byte[] returnByte() {";
-    "    return new byte[]{1,2,3,4};";
-    "}";
-    "}";]);
+"public byte[] returnByte() {";
+"    return new byte[]{1,2,3,4};";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(int8([1,2,3,4]), t.returnByte());
 
 c = jcompile("Test", ["public class Test {";
-    "public byte returnByte() {";
-    "    return 32;";
-    "}";
-    "}";]);
+"public byte returnByte() {";
+"    return 32;";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(int8(32), t.returnByte());
@@ -77,19 +78,19 @@ assert_checkequal(int8(32), t.returnByte());
 //////////////////////////////////////////////
 
 c = jcompile("Test", ["public class Test {";
-    "public short[] returnShort() {";
-    "    return new short[]{1,2,3,4};";
-    "}";
-    "}";]);
+"public short[] returnShort() {";
+"    return new short[]{1,2,3,4};";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(int16([1,2,3,4]), t.returnShort());
 
 c = jcompile("Test", ["public class Test {";
-    "public short returnShort() {";
-    "    return 32;";
-    "}";
-    "}";]);
+"public short returnShort() {";
+"    return 32;";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(int16(32), t.returnShort());
@@ -98,19 +99,19 @@ assert_checkequal(int16(32), t.returnShort());
 //////////////////////////////////////////////
 
 c = jcompile("Test", ["public class Test {";
-    "public long[] returnLong() {";
-    "    return new long[]{1L,2L,3L,4L};";
-    "}";
-    "}";]);
+"public long[] returnLong() {";
+"    return new long[]{1L,2L,3L,4L};";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(int32([1,2,3,4]), t.returnLong());
 
 c = jcompile("Test", ["public class Test {";
-    "public long returnLong() {";
-    "    return 32L;";
-    "}";
-    "}";]);
+"public long returnLong() {";
+"    return 32L;";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(int32(32), t.returnLong());
@@ -118,19 +119,19 @@ assert_checkequal(int32(32), t.returnLong());
 //////////////////////////////////////////////
 
 c = jcompile("Test", ["public class Test {";
-    "public float[] returnFloat() {";
-    "    return new float[]{1f,2f,3f,4f};";
-    "}";
-    "}";]);
+"public float[] returnFloat() {";
+"    return new float[]{1f,2f,3f,4f};";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal([1,2,3,4], t.returnFloat());
 
 c = jcompile("Test", ["public class Test {";
-    "public float returnFloat() {";
-    "    return 32f;";
-    "}";
-    "}";]);
+"public float returnFloat() {";
+"    return 32f;";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(32, t.returnFloat());
@@ -161,19 +162,19 @@ assert_checkequal(32, t.returnFloat());
 //////////////////////////////////////////////
 
 c = jcompile("Test", ["public class Test {";
-    "public boolean[] returnBoolean() {";
-    "    return new boolean[]{true,true,false,false};";
-    "}";
-    "}";]);
+"public boolean[] returnBoolean() {";
+"    return new boolean[]{true,true,false,false};";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal([%t,%t,%f,%f], t.returnBoolean());
 
 c = jcompile("Test", ["public class Test {";
-    "public boolean returnBoolean() {";
-    "    return true;";
-    "}";
-    "}";]);
+"public boolean returnBoolean() {";
+"    return true;";
+"}";
+"}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
 assert_checkequal(%t, t.returnBoolean());