|
From: <de...@us...> - 2012-11-22 07:56:14
|
Revision: 8063
http://fudaa.svn.sourceforge.net/fudaa/?rev=8063&view=rev
Author: deniger
Date: 2012-11-22 07:56:08 +0000 (Thu, 22 Nov 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-mascaret/server/src/test/java/org/fudaa/dodico/mascaret/CompleteStructureTest.java
Modified: trunk/soft/fudaa-mascaret/server/src/test/java/org/fudaa/dodico/mascaret/CompleteStructureTest.java
===================================================================
--- trunk/soft/fudaa-mascaret/server/src/test/java/org/fudaa/dodico/mascaret/CompleteStructureTest.java 2012-11-21 14:28:20 UTC (rev 8062)
+++ trunk/soft/fudaa-mascaret/server/src/test/java/org/fudaa/dodico/mascaret/CompleteStructureTest.java 2012-11-22 07:56:08 UTC (rev 8063)
@@ -15,7 +15,7 @@
* @author Frederic Deniger
*/
public class CompleteStructureTest extends AbstractMascaretTestCase {
-
+
private static void createFile(SParametresCAS parametresCas, File target) {
EdamoxXmlReaderWriter xmlWriter = new EdamoxXmlReaderWriter("1.0");
EdamoxXMLContent content = new EdamoxXMLContent(parametresCas);
@@ -39,7 +39,13 @@
}
return newInstance;
}
-
+
+ /**
+ *
+ * @param in the class to instanciate. Call #instanciate(Class) for complex objects.
+ * @return
+ * @throws Exception
+ */
private static Object doInstanciation(Class in) throws Exception {
if (Boolean.TYPE.equals(in)) {
return true;
@@ -86,7 +92,12 @@
}
return instanciate(in);
}
-
+
+ /**
+ * Write a file containing all paramaters of a study file. Then read it and test that the result is the same than the initial data.
+ *
+ * @throws Exception
+ */
public void testValidate() throws Exception {
File tempFile = createTempFile(".xml");
SParametresCAS res = (SParametresCAS) instanciate(SParametresCAS.class);
@@ -101,10 +112,17 @@
assertNotNull(readContent.getParametresCas());
EdamoxXmlReaderWriterTest.testCompare(res, readContent.getParametresCas());
}
-
+
+ /**
+ * Just to check the content of the file.
+ * //WARN the absolute path must be change.
+ * @param args
+ * @throws Exception
+ */
public static void main(String[] args) throws Exception {
//to be modified: create a xml file in a hardcoded file.
SParametresCAS res = (SParametresCAS) instanciate(SParametresCAS.class);
+
createFile(res, new File("C:\\data\\tmp\\toto.xml"));
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2012-11-30 07:49:21
|
Revision: 8087
http://fudaa.svn.sourceforge.net/fudaa/?rev=8087&view=rev
Author: deniger
Date: 2012-11-30 07:49:10 +0000 (Fri, 30 Nov 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-mascaret/server/src/test/java/org/fudaa/dodico/mascaret/CompleteStructureTest.java
Modified: trunk/soft/fudaa-mascaret/server/src/test/java/org/fudaa/dodico/mascaret/CompleteStructureTest.java
===================================================================
--- trunk/soft/fudaa-mascaret/server/src/test/java/org/fudaa/dodico/mascaret/CompleteStructureTest.java 2012-11-28 18:52:28 UTC (rev 8086)
+++ trunk/soft/fudaa-mascaret/server/src/test/java/org/fudaa/dodico/mascaret/CompleteStructureTest.java 2012-11-30 07:49:10 UTC (rev 8087)
@@ -123,6 +123,6 @@
//to be modified: create a xml file in a hardcoded file.
SParametresCAS res = (SParametresCAS) instanciate(SParametresCAS.class);
- createFile(res, new File("C:\\data\\tmp\\toto.xml"));
+ createFile(res, new File("C:\\data\\tmp\\masc.xml"));
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2014-11-16 22:05:26
|
Revision: 8933
http://sourceforge.net/p/fudaa/svn/8933
Author: deniger
Date: 2014-11-16 22:05:21 +0000 (Sun, 16 Nov 2014)
Log Message:
-----------
maj versions finales
Modified Paths:
--------------
trunk/soft/fudaa-mascaret/server/src/test/java/org/fudaa/dodico/mascaret/CompleteStructureTest.java
Modified: trunk/soft/fudaa-mascaret/server/src/test/java/org/fudaa/dodico/mascaret/CompleteStructureTest.java
===================================================================
--- trunk/soft/fudaa-mascaret/server/src/test/java/org/fudaa/dodico/mascaret/CompleteStructureTest.java 2014-11-16 21:55:32 UTC (rev 8932)
+++ trunk/soft/fudaa-mascaret/server/src/test/java/org/fudaa/dodico/mascaret/CompleteStructureTest.java 2014-11-16 22:05:21 UTC (rev 8933)
@@ -6,6 +6,7 @@
import java.io.File;
import java.lang.reflect.Array;
import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
import org.fudaa.ctulu.CtuluLog;
import org.fudaa.dodico.corba.mascaret.SParametresCAS;
@@ -33,9 +34,11 @@
Object newInstance = in.newInstance();
Field[] declaredFields = in.getDeclaredFields();
for (Field field : declaredFields) {
- Class<?> declaringClass = field.getType();
- Object value = doInstanciation(declaringClass);
- field.set(newInstance, value);
+ if (!Modifier.isFinal(field.getModifiers())) {
+ Class<?> declaringClass = field.getType();
+ Object value = doInstanciation(declaringClass);
+ field.set(newInstance, value);
+ }
}
return newInstance;
}
@@ -114,15 +117,15 @@
}
/**
- * Just to check the content of the file.
- * //WARN the absolute path must be change.
+ * Just to check the content of the file. //WARN the absolute path must be change.
+ *
* @param args
- * @throws Exception
+ * @throws Exception
*/
public static void main(String[] args) throws Exception {
//to be modified: create a xml file in a hardcoded file.
SParametresCAS res = (SParametresCAS) instanciate(SParametresCAS.class);
-
+
createFile(res, new File("C:\\data\\tmp\\masc.xml"));
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|