Commits

petermr  committed 9e5f9d3 Draft

added old array tests

  • Participants
  • Parent commits 9e130a1

Comments (0)

Files changed (5)

File src/main/java/org/xmlcml/declaratron/stmml/stmml/ArrayToolVisitable.java

 package org.xmlcml.declaratron.stmml.stmml;
 
 import java.util.ArrayList;
+
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashMap;

File src/test/java/org/xmlcml/declaratron/stmml/stmml/ArrayToolVisitorTest.java

 
 import nu.xom.Element;
 
+
 import org.junit.Ignore;
 import org.junit.Test;
 import org.xmlcml.cml.testutil.JumboTestUtils;
 	}
 	
 	@Test
-	@Ignore // needs MATHML_DIR
+	@Ignore // wrong result
 	public void testArrayTool() {
 		
 		Element element = NodeUtils.parseResource(Fixtures.MATHML_DIR+"arrayTest.xml");
 		ArrayToolVisitable visitable = new ArrayToolVisitable(arrayToolElement);
 		ExecutableVisitor visitor = new ExecutableVisitor();
 		Element newElement = visitor.visitElement(visitable);
+		
 		JumboTestUtils.assertEqualsIncludingFloat("test compare", 
 				NodeUtils.parseResource(Fixtures.MATHML_DIR+"arrayTestOut.xml"), 
 				newElement, true, 0.00001);		

File src/test/java/org/xmlcml/declaratron/stmml/stmml/Fixtures.java

 package org.xmlcml.declaratron.stmml.stmml;
 
 public class Fixtures {
-	public final static String MATHML_DIR = "math"; // FIXME
+	public final static String MATHML_DIR = "org/xmlcml/declaratron/math/"; // FIXME
 }

File src/test/resources/org/xmlcml/declaratron/math/arrayTest.xml

+<computation  
+    xmlns:m="http://www.w3.org/1998/Math/MathML"
+    xmlns="http://www.xml-cml.org/semanticcomputation"
+    >
+    <arrayTool start="0.7"  delta="0.05" count="27" method="createDoubles" xpath="."/>   
+</computation>

File src/test/resources/org/xmlcml/declaratron/math/arrayTestOut.xml

+    <array xmlns="http://www.xml-cml.org/schema" start="0.7" delta="0.05" count="27"/>