[LutinJ2R-commits] r7 - src/test/org/codelutin/j2r
Author: thimel Date: 2006-09-01 10:42:50 +0000 (Fri, 01 Sep 2006) New Revision: 7 Modified: src/test/org/codelutin/j2r/JNITest.java src/test/org/codelutin/j2r/NetTest.java Log: Amelioration des tests Modified: src/test/org/codelutin/j2r/JNITest.java =================================================================== --- src/test/org/codelutin/j2r/JNITest.java 2006-09-01 10:41:55 UTC (rev 6) +++ src/test/org/codelutin/j2r/JNITest.java 2006-09-01 10:42:50 UTC (rev 7) @@ -43,11 +43,13 @@ private static Log log = LogFactory.getLog(JNITest.class); private REngine engine; + private String savedRType; @Override protected void setUp() throws Exception { LutinTimer init = new LutinTimer(); init.startTiming(); + savedRType = System.getProperty("R.type", ""); System.setProperty("R.type", "jni"); if (engine == null) { engine = new RProxy(); @@ -60,10 +62,14 @@ @Override protected void tearDown() throws Exception { engine.terminate(); + System.setProperty("R.type", savedRType); } public void testDouble() throws Exception { assertEquals(5.0, engine.eval("5.0")); + engine.voidEval("t<-sin(0)"); + double d = (Double)engine.eval("t"); + assertEquals(0.0, d); } public void testIntArray() throws Exception { Modified: src/test/org/codelutin/j2r/NetTest.java =================================================================== --- src/test/org/codelutin/j2r/NetTest.java 2006-09-01 10:41:55 UTC (rev 6) +++ src/test/org/codelutin/j2r/NetTest.java 2006-09-01 10:42:50 UTC (rev 7) @@ -50,12 +50,14 @@ private static Log log = LogFactory.getLog(NetTest.class); private REngine engine; + private String savedRType; @Override protected void setUp() throws Exception { LutinTimer init = new LutinTimer(); init.startTiming(); -// System.setProperty("R.type", "net://192.168.99.122:6312"); + savedRType = System.getProperty("R.type", ""); + System.setProperty("R.type", "net://:6311"); if (engine == null) { engine = new RProxy(); } @@ -64,8 +66,17 @@ } } + @Override + protected void tearDown() throws Exception { + engine.terminate(); + System.setProperty("R.type", savedRType); + } + public void testDouble() throws Exception { assertEquals(5.0, engine.eval("5.0")); + engine.voidEval("t<-sin(0)"); + double d = (Double)engine.eval("t"); + assertEquals(0.0, d); } public void testIntArray() throws Exception {
participants (1)
-
thimel@users.labs.libre-entreprise.org