Add a test which check that serialization compatibility is kept (and avoid such probl... 73/4673/3
Sylvestre Ledru [Thu, 4 Aug 2011 15:11:04 +0000 (17:11 +0200)]
(windows part added)
Change-Id: I9ebe64a0504a6978f704e2dc335622fdc051e52b

20 files changed:
scilab/Scilab.sln
scilab/Scilab_f2c.sln
scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/Boolean.data [new file with mode: 0644]
scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/Int16.data [new file with mode: 0644]
scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/Int16.signed.data [new file with mode: 0644]
scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/Int32.data [new file with mode: 0644]
scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/Int32.signed.data [new file with mode: 0644]
scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/Int64.data [new file with mode: 0644]
scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/Int64.signed.data [new file with mode: 0644]
scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/Int8.data [new file with mode: 0644]
scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/Int8.signed.data [new file with mode: 0644]
scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/List.data [new file with mode: 0644]
scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/MList.data [new file with mode: 0644]
scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/TList.data [new file with mode: 0644]
scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/double.complex.data [new file with mode: 0644]
scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/double.data [new file with mode: 0644]
scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/string.data [new file with mode: 0644]
scilab/modules/types/tests/java/org/scilab/tests/modules/types/testSerialization.java [new file with mode: 0644]
scilab/modules/types/tests/java/types-JAVA-tests.filters [new file with mode: 0644]
scilab/modules/types/tests/java/types-JAVA-tests.vcxproj [new file with mode: 0644]

index 1e4404c..92cf47d 100644 (file)
@@ -577,6 +577,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test-all", "Visual-Studio-s
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "noui_data", "modules\ui_data\src\noui_data\noui_data.vcxproj", "{337A52F8-310E-49E3-A2BA-F19CA32EB617}"
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "types-JAVA-tests", "modules\types\tests\java\types-JAVA-tests.vcxproj", "{3F4504A3-1116-40BD-9612-F5E83D09CC99}"
+EndProject
 Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
                Debug|Win32 = Debug|Win32
@@ -1805,6 +1807,10 @@ Global
                {337A52F8-310E-49E3-A2BA-F19CA32EB617}.Release|Win32.Build.0 = Release|Win32
                {337A52F8-310E-49E3-A2BA-F19CA32EB617}.Release|x64.ActiveCfg = Release|x64
                {337A52F8-310E-49E3-A2BA-F19CA32EB617}.Release|x64.Build.0 = Release|x64
+               {3F4504A3-1116-40BD-9612-F5E83D09CC99}.Debug|Win32.ActiveCfg = Debug|Win32
+               {3F4504A3-1116-40BD-9612-F5E83D09CC99}.Debug|x64.ActiveCfg = Debug|x64
+               {3F4504A3-1116-40BD-9612-F5E83D09CC99}.Release|Win32.ActiveCfg = Release|Win32
+               {3F4504A3-1116-40BD-9612-F5E83D09CC99}.Release|x64.ActiveCfg = Release|x64
        EndGlobalSection
        GlobalSection(SolutionProperties) = preSolution
                HideSolutionNode = FALSE
index 350570e..53e80ed 100644 (file)
@@ -357,6 +357,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test-all", "Visual-Studio-s
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "noui_data", "modules\ui_data\src\noui_data\noui_data.vcxproj", "{337A52F8-310E-49E3-A2BA-F19CA32EB617}"
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "types-JAVA-tests", "modules\types\tests\java\types-JAVA-tests.vcxproj", "{3F4504A3-1116-40BD-9612-F5E83D09CC99}"
+EndProject
 Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
                Debug|Win32 = Debug|Win32
@@ -1581,6 +1583,10 @@ Global
                {337A52F8-310E-49E3-A2BA-F19CA32EB617}.Release|Win32.Build.0 = Release|Win32
                {337A52F8-310E-49E3-A2BA-F19CA32EB617}.Release|x64.ActiveCfg = Release|x64
                {337A52F8-310E-49E3-A2BA-F19CA32EB617}.Release|x64.Build.0 = Release|x64
+               {3F4504A3-1116-40BD-9612-F5E83D09CC99}.Debug|Win32.ActiveCfg = Debug|Win32
+               {3F4504A3-1116-40BD-9612-F5E83D09CC99}.Debug|x64.ActiveCfg = Debug|x64
+               {3F4504A3-1116-40BD-9612-F5E83D09CC99}.Release|Win32.ActiveCfg = Release|Win32
+               {3F4504A3-1116-40BD-9612-F5E83D09CC99}.Release|x64.ActiveCfg = Release|x64
        EndGlobalSection
        GlobalSection(SolutionProperties) = preSolution
                HideSolutionNode = FALSE
diff --git a/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/Boolean.data b/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/Boolean.data
new file mode 100644 (file)
index 0000000..c431085
Binary files /dev/null and b/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/Boolean.data differ
diff --git a/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/Int16.data b/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/Int16.data
new file mode 100644 (file)
index 0000000..10c42fc
Binary files /dev/null and b/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/Int16.data differ
diff --git a/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/Int16.signed.data b/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/Int16.signed.data
new file mode 100644 (file)
index 0000000..7efaea6
Binary files /dev/null and b/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/Int16.signed.data differ
diff --git a/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/Int32.data b/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/Int32.data
new file mode 100644 (file)
index 0000000..10c42fc
Binary files /dev/null and b/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/Int32.data differ
diff --git a/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/Int32.signed.data b/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/Int32.signed.data
new file mode 100644 (file)
index 0000000..7efaea6
Binary files /dev/null and b/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/Int32.signed.data differ
diff --git a/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/Int64.data b/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/Int64.data
new file mode 100644 (file)
index 0000000..10c42fc
Binary files /dev/null and b/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/Int64.data differ
diff --git a/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/Int64.signed.data b/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/Int64.signed.data
new file mode 100644 (file)
index 0000000..7efaea6
Binary files /dev/null and b/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/Int64.signed.data differ
diff --git a/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/Int8.data b/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/Int8.data
new file mode 100644 (file)
index 0000000..10c42fc
Binary files /dev/null and b/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/Int8.data differ
diff --git a/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/Int8.signed.data b/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/Int8.signed.data
new file mode 100644 (file)
index 0000000..7efaea6
Binary files /dev/null and b/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/Int8.signed.data differ
diff --git a/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/List.data b/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/List.data
new file mode 100644 (file)
index 0000000..ba4059f
Binary files /dev/null and b/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/List.data differ
diff --git a/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/MList.data b/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/MList.data
new file mode 100644 (file)
index 0000000..1673d17
Binary files /dev/null and b/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/MList.data differ
diff --git a/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/TList.data b/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/TList.data
new file mode 100644 (file)
index 0000000..0aacea2
Binary files /dev/null and b/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/TList.data differ
diff --git a/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/double.complex.data b/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/double.complex.data
new file mode 100644 (file)
index 0000000..906f6a6
Binary files /dev/null and b/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/double.complex.data differ
diff --git a/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/double.data b/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/double.data
new file mode 100644 (file)
index 0000000..fa63a1d
Binary files /dev/null and b/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/double.data differ
diff --git a/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/string.data b/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/string.data
new file mode 100644 (file)
index 0000000..39eba0a
Binary files /dev/null and b/scilab/modules/types/tests/java/org/scilab/tests/modules/types/referenceData/string.data differ
diff --git a/scilab/modules/types/tests/java/org/scilab/tests/modules/types/testSerialization.java b/scilab/modules/types/tests/java/org/scilab/tests/modules/types/testSerialization.java
new file mode 100644 (file)
index 0000000..c37921f
--- /dev/null
@@ -0,0 +1,370 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - DIGITEO - Sylvestre LEDRU
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+package org.scilab.tests.modules.types;
+
+import org.testng.annotations.*;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.ObjectOutputStream;
+import java.io.FileInputStream;
+import java.io.ObjectInputStream;
+
+import org.scilab.modules.types.ScilabType;
+import org.scilab.modules.types.ScilabDouble;
+import org.scilab.modules.types.ScilabInteger;
+import org.scilab.modules.types.ScilabIntegerTypeEnum;
+import org.scilab.modules.types.ScilabBoolean;
+import org.scilab.modules.types.ScilabString;
+import org.scilab.modules.types.ScilabList;
+import org.scilab.modules.types.ScilabTList;
+import org.scilab.modules.types.ScilabMList;
+import org.scilab.modules.types.ScilabTypeEnum;
+
+public class testSerialization {
+    String referenceDataPath = "tests/java/org/scilab/tests/modules/types/referenceData/";
+    
+
+
+
+       private void writeReference(ScilabType a, String to) throws IOException {
+        
+        FileOutputStream fos = new FileOutputStream(to);
+
+        ObjectOutputStream oos= new ObjectOutputStream(fos);
+        try {
+            oos.writeObject(a); 
+            oos.flush();
+        } finally {
+
+            try {
+                oos.close();
+            } finally {
+                fos.close();
+            }
+        }
+    }
+
+    private ScilabType readFromFile(String filename) {
+               ScilabType a = null;
+               try {
+                       FileInputStream fis = new FileInputStream(filename);
+
+                       ObjectInputStream ois= new ObjectInputStream(fis);
+                       try {   
+                               a = (ScilabType) ois.readObject();
+                       } finally {
+                               try {
+                                       ois.close();
+                               } finally {
+                                       fis.close();
+                               }
+                       }
+               } catch(IOException ioe) {
+                       ioe.printStackTrace();
+               } catch(ClassNotFoundException cnfe) {
+                       cnfe.printStackTrace();
+               }
+        return a;
+
+    }
+
+    private String scilabDoubleFile=referenceDataPath+"double.data";
+
+// Uncomment to regenerate a new reference file
+    //@BeforeMethod
+       public void writeDoubleFileReference() throws IOException {
+               double [][]a={{21.2, 22.0, 42.0, 39.0},{23.2, 24.0, 44.0, 40.0}};
+               ScilabDouble aMatrix = new ScilabDouble(a);
+        writeReference(aMatrix, scilabDoubleFile);
+    }
+
+    private String scilabDoubleComplexFile=referenceDataPath+"double.complex.data";
+// Uncomment to regenerate a new reference file
+    //@BeforeMethod
+       public void writeDoubleComplexFileReference() throws IOException {
+               double [][]a={{21.2, 22.0, 42.0, 39.0},{23.2, 24.0, 44.0, 40.0}};
+               double [][]aImg={{210.2, 220.0, 420.0, 390.0},{230.2, 240.0, 440.0, 400.0}};
+               ScilabDouble aMatrix = new ScilabDouble(a,aImg);
+        writeReference(aMatrix, scilabDoubleComplexFile);
+    }
+
+    private String scilabStringFile=referenceDataPath+"string.data";
+
+// Uncomment to regenerate a new reference file
+    //@BeforeMethod
+       public void writeStringFileReference() throws IOException {
+               String [][]a={{"This","is","my","string"},{"and","I want to", "compare"," them"}};
+               ScilabString aMatrix = new ScilabString(a);
+        writeReference(aMatrix, scilabStringFile);
+    }
+
+
+       @Test
+       public void readJavaSerializedDoubleTest() throws IOException {
+
+               double [][]a={{21.2, 22.0, 42.0, 39.0},{23.2, 24.0, 44.0, 40.0}};
+               ScilabDouble aMatrix = new ScilabDouble(a);
+               assert aMatrix.equals(readFromFile(scilabDoubleFile)) == true;
+       }
+
+       @Test
+       public void readJavaSerializedComplexTest() throws IOException {
+
+               double [][]a={{21.2, 22.0, 42.0, 39.0},{23.2, 24.0, 44.0, 40.0}};
+               double [][]aImg={{210.2, 220.0, 420.0, 390.0},{230.2, 240.0, 440.0, 400.0}};
+
+               ScilabDouble aMatrix = new ScilabDouble(a, aImg);
+               assert aMatrix.equals(readFromFile(scilabDoubleComplexFile)) == true;
+       }
+
+
+       @Test
+       public void readJavaSerializedStringTest() throws IOException {
+
+               String [][]a={{"This","is","my","string"},{"and","I want to", "compare"," them"}};
+               ScilabString aMatrix = new ScilabString(a);
+               assert aMatrix.equals(readFromFile(scilabStringFile)) == true;
+       }
+
+    private String scilabInt8File=referenceDataPath+"Int8.data";
+    private String scilabInt8SignedFile=referenceDataPath+"Int8.signed.data";
+
+// Uncomment to regenerate a new reference file
+    //@BeforeMethod
+       public void writeInt8FileReference() throws IOException {
+               byte [][]a={{32,42,41}, {12,13,32}};
+               ScilabInteger aMatrix = new ScilabInteger(a, true);
+        writeReference(aMatrix, scilabInt8File);
+    }
+
+
+       @Test
+       public void readJavaSerializedInt8Test() throws IOException {
+               byte [][]a={{32,42,41}, {12,13,32}};
+               ScilabInteger aMatrix = new ScilabInteger(a, true);
+               assert aMatrix.equals(readFromFile(scilabInt8File)) == true;
+       }
+
+// Uncomment to regenerate a new reference file
+    //@BeforeMethod
+       public void writeInt8SignedFileReference() throws IOException {
+               byte [][]a={{32,42,41}, {12,13,32}};
+               ScilabInteger aMatrix = new ScilabInteger(a, false);
+        writeReference(aMatrix, scilabInt8SignedFile);
+    }
+
+
+       @Test
+       public void readJavaSerializedInt8SignedTest() throws IOException {
+               byte [][]a={{32,42,41}, {12,13,32}};
+               ScilabInteger aMatrix = new ScilabInteger(a, false);
+               assert aMatrix.equals(readFromFile(scilabInt8SignedFile)) == true;
+       }
+
+    private String scilabInt16File=referenceDataPath+"Int16.data";
+    private String scilabInt16SignedFile=referenceDataPath+"Int16.signed.data";
+
+// Uncomment to regenerate a new reference file
+    //@BeforeMethod
+       public void writeInt16FileReference() throws IOException {
+               byte [][]a={{32,42,41}, {12,13,32}};
+               ScilabInteger aMatrix = new ScilabInteger(a, true);
+        writeReference(aMatrix, scilabInt16File);
+    }
+
+
+       @Test
+       public void readJavaSerializedInt16Test() throws IOException {
+               byte [][]a={{32,42,41}, {12,13,32}};
+               ScilabInteger aMatrix = new ScilabInteger(a, true);
+               assert aMatrix.equals(readFromFile(scilabInt16File)) == true;
+       }
+
+// Uncomment to regenerate a new reference file
+    //@BeforeMethod
+       public void writeInt16SignedFileReference() throws IOException {
+               byte [][]a={{32,42,41}, {12,13,32}};
+               ScilabInteger aMatrix = new ScilabInteger(a, false);
+        writeReference(aMatrix, scilabInt16SignedFile);
+    }
+
+
+       @Test
+       public void readJavaSerializedInt16SignedTest() throws IOException {
+               byte [][]a={{32,42,41}, {12,13,32}};
+               ScilabInteger aMatrix = new ScilabInteger(a, false);
+               assert aMatrix.equals(readFromFile(scilabInt16SignedFile)) == true;
+       }
+
+
+    private String scilabInt32File=referenceDataPath+"Int32.data";
+    private String scilabInt32SignedFile=referenceDataPath+"Int32.signed.data";
+
+// Uncomment to regenerate a new reference file
+    //@BeforeMethod
+       public void writeInt32FileReference() throws IOException {
+               byte [][]a={{32,42,41}, {12,13,32}};
+               ScilabInteger aMatrix = new ScilabInteger(a, true);
+        writeReference(aMatrix, scilabInt32File);
+    }
+
+
+       @Test
+       public void readJavaSerializedInt32Test() throws IOException {
+               byte [][]a={{32,42,41}, {12,13,32}};
+               ScilabInteger aMatrix = new ScilabInteger(a, true);
+               assert aMatrix.equals(readFromFile(scilabInt32File)) == true;
+       }
+
+// Uncomment to regenerate a new reference file
+    //@BeforeMethod
+       public void writeInt32SignedFileReference() throws IOException {
+               byte [][]a={{32,42,41}, {12,13,32}};
+               ScilabInteger aMatrix = new ScilabInteger(a, false);
+        writeReference(aMatrix, scilabInt32SignedFile);
+    }
+
+
+       @Test
+       public void readJavaSerializedInt32SignedTest() throws IOException {
+               byte [][]a={{32,42,41}, {12,13,32}};
+               ScilabInteger aMatrix = new ScilabInteger(a, false);
+               assert aMatrix.equals(readFromFile(scilabInt32SignedFile)) == true;
+       }
+
+    private String scilabInt64File=referenceDataPath+"Int64.data";
+    private String scilabInt64SignedFile=referenceDataPath+"Int64.signed.data";
+
+// Uncomment to regenerate a new reference file
+    //@BeforeMethod
+       public void writeInt64FileReference() throws IOException {
+               byte [][]a={{32,42,41}, {12,13,32}};
+               ScilabInteger aMatrix = new ScilabInteger(a, true);
+        writeReference(aMatrix, scilabInt64File);
+    }
+
+
+       @Test
+       public void readJavaSerializedInt64Test() throws IOException {
+               byte [][]a={{32,42,41}, {12,13,32}};
+               ScilabInteger aMatrix = new ScilabInteger(a, true);
+               assert aMatrix.equals(readFromFile(scilabInt64File)) == true;
+       }
+
+// Uncomment to regenerate a new reference file
+    //@BeforeMethod
+       public void writeInt64SignedFileReference() throws IOException {
+               byte [][]a={{32,42,41}, {12,13,32}};
+               ScilabInteger aMatrix = new ScilabInteger(a, false);
+        writeReference(aMatrix, scilabInt64SignedFile);
+    }
+
+
+       @Test
+       public void readJavaSerializedInt64SignedTest() throws IOException {
+               byte [][]a={{32,42,41}, {12,13,32}};
+               ScilabInteger aMatrix = new ScilabInteger(a, false);
+               assert aMatrix.equals(readFromFile(scilabInt64SignedFile)) == true;
+       }
+    private String scilabBooleanFile=referenceDataPath+"Boolean.data";
+
+// Uncomment to regenerate a new reference file
+    //@BeforeMethod
+       public void writeBooleanFileReference() throws IOException {
+               boolean [][]a={{true,false,true}, {true,true,true}};
+               ScilabBoolean aMatrix = new ScilabBoolean(a);
+        writeReference(aMatrix, scilabBooleanFile);
+    }
+
+
+       @Test
+       public void readJavaSerializedBooleanTest() throws IOException {
+               boolean [][]a={{true,false,true}, {true,true,true}};
+               ScilabBoolean aMatrix = new ScilabBoolean(a);
+               assert aMatrix.equals(readFromFile(scilabBooleanFile)) == true;
+       }
+
+    private String scilabListFile=referenceDataPath+"List.data";
+
+// Uncomment to regenerate a new reference file
+    //@BeforeMethod
+       public void writeListFileReference() throws IOException {
+               ScilabList data = new ScilabList();
+               data.add(new ScilabDouble(2));
+               data.add(new ScilabDouble(51));
+
+               data.add(new ScilabString("hello"));
+        writeReference(data, scilabListFile);
+    }
+
+
+       @Test
+       public void readJavaSerializedListTest() throws IOException {
+               ScilabList data = new ScilabList();
+               data.add(new ScilabDouble(2));
+               data.add(new ScilabDouble(51));
+               data.add(new ScilabString("hello"));
+               assert data.equals(readFromFile(scilabListFile)) == true;
+       }
+
+    private String scilabTListFile=referenceDataPath+"TList.data";
+
+// Uncomment to regenerate a new reference file
+    //@BeforeMethod
+       public void writeTListFileReference() throws IOException {
+               ScilabTList data = new ScilabTList();
+               data.add(new ScilabString("hello"));
+               data.add(new ScilabDouble(2));
+               data.add(new ScilabDouble(51));
+        writeReference(data, scilabTListFile);
+    }
+
+
+       @Test
+       public void readJavaSerializedTListTest() throws IOException {
+               ScilabTList data = new ScilabTList();
+               data.add(new ScilabString("hello"));
+               data.add(new ScilabDouble(2));
+               data.add(new ScilabDouble(51));
+
+               assert data.equals(readFromFile(scilabTListFile)) == true;
+       }
+    private String scilabMListFile=referenceDataPath+"MList.data";
+
+// Uncomment to regenerate a new reference file
+    //@BeforeMethod
+       public void writeMListFileReference() throws IOException {
+               ScilabMList data = new ScilabMList();
+               data.add(new ScilabString("hello"));
+               data.add(new ScilabDouble(2));
+               data.add(new ScilabDouble(51));
+        writeReference(data, scilabMListFile);
+    }
+
+
+       @Test
+       public void readJavaSerializedMListTest() throws IOException {
+               ScilabMList data = new ScilabMList();
+               data.add(new ScilabString("hello"));
+               data.add(new ScilabDouble(2));
+               data.add(new ScilabDouble(51));
+               assert data.equals(readFromFile(scilabMListFile)) == true;
+       }
+
+
+
+
+
+}
+
diff --git a/scilab/modules/types/tests/java/types-JAVA-tests.filters b/scilab/modules/types/tests/java/types-JAVA-tests.filters
new file mode 100644 (file)
index 0000000..834c441
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+  </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/scilab/modules/types/tests/java/types-JAVA-tests.vcxproj b/scilab/modules/types/tests/java/types-JAVA-tests.vcxproj
new file mode 100644 (file)
index 0000000..f283f35
--- /dev/null
@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{3F4504A3-1116-40BD-9612-F5E83D09CC99}</ProjectGuid>
+    <RootNamespace>types-java-tests</RootNamespace>
+    <Keyword>MakeFileProj</Keyword>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>Makefile</ConfigurationType>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Makefile</ConfigurationType>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>Makefile</ConfigurationType>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>Makefile</ConfigurationType>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup>
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)modules\types\jar\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)$(Configuration)\</IntDir>
+    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">set JAVA_HOME=$(SolutionDir)java\jdk
+set PATH=$(SolutionDir)java\ant\bin;%PATH%;
+cd ..\..
+call ant test
+</NMakeBuildCommandLine>
+    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">set JAVA_HOME=$(SolutionDir)java\jdk
+set PATH=$(SolutionDir)java\ant\bin;%PATH%;
+cd ..\..
+call ant test
+
+</NMakeReBuildCommandLine>
+    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+    <NMakePreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">WIN32;_DEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
+    <NMakeIncludeSearchPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>
+    <NMakeForcedIncludes Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(NMakeForcedIncludes)</NMakeForcedIncludes>
+    <NMakeAssemblySearchPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>
+    <NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)modules\types\jar\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)$(Configuration)\</IntDir>
+    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">set JAVA_HOME=$(SolutionDir)java\jdk
+set PATH=$(SolutionDir)java\ant\bin;%PATH%;
+cd ..\..
+call ant test
+</NMakeBuildCommandLine>
+    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">set JAVA_HOME=$(SolutionDir)java\jdk
+set PATH=$(SolutionDir)java\ant\bin;%PATH%;
+cd ..\..
+call ant test
+
+</NMakeReBuildCommandLine>
+    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+    <NMakePreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">WIN32;_DEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
+    <NMakeIncludeSearchPath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>
+    <NMakeForcedIncludes Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(NMakeForcedIncludes)</NMakeForcedIncludes>
+    <NMakeAssemblySearchPath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>
+    <NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)modules\types\jar\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)$(Configuration)\</IntDir>
+    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">set JAVA_HOME=$(SolutionDir)java\jdk
+set PATH=$(SolutionDir)java\ant\bin;%PATH%;
+cd ..\..
+call ant test
+</NMakeBuildCommandLine>
+    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">set JAVA_HOME=$(SolutionDir)java\jdk
+set PATH=$(SolutionDir)java\ant\bin;%PATH%;
+cd ..\..
+call ant test
+
+</NMakeReBuildCommandLine>
+    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+    <NMakePreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">WIN32;NDEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
+    <NMakeIncludeSearchPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>
+    <NMakeForcedIncludes Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakeForcedIncludes)</NMakeForcedIncludes>
+    <NMakeAssemblySearchPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>
+    <NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)modules\types\jar\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)$(Configuration)\</IntDir>
+    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|x64'">set JAVA_HOME=$(SolutionDir)java\jdk
+set PATH=$(SolutionDir)java\ant\bin;%PATH%;
+cd ..\..
+call ant test
+</NMakeBuildCommandLine>
+    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|x64'">set JAVA_HOME=$(SolutionDir)java\jdk
+set PATH=$(SolutionDir)java\ant\bin;%PATH%;
+cd ..\..
+call ant test
+
+</NMakeReBuildCommandLine>
+    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+    <NMakePreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">WIN32;NDEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
+    <NMakeIncludeSearchPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>
+    <NMakeForcedIncludes Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(NMakeForcedIncludes)</NMakeForcedIncludes>
+    <NMakeAssemblySearchPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>
+    <NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>
+  </PropertyGroup>
+  <ItemDefinitionGroup>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\..\jvm\src\java\jvm-JAVA.vcxproj">
+      <Project>{e9783492-017e-4811-9cc7-6b71856f847c}</Project>
+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\localization\src\java\localization-JAVA.vcxproj">
+      <Project>{fba3bc3f-8a2c-4d47-a50d-eb808be42f43}</Project>
+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\types\src\java\types-JAVA.vcxproj">
+      <Project>{abcb724e-8534-4420-ac12-7c33a606aba3}</Project>
+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file