Commit in lcsim/test/org/lcsim/spacegeom on MAIN
SpacePathTest.java+33added 1.1
added test for new function getPointAtLength(double) in SpacePath

lcsim/test/org/lcsim/spacegeom
SpacePathTest.java added at 1.1
diff -N SpacePathTest.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ SpacePathTest.java	2 Aug 2005 17:54:25 -0000	1.1
@@ -0,0 +1,33 @@
+package org.lcsim.spacegeom;
+
+import junit.framework.TestCase;
+
+public class SpacePathTest extends TestCase {
+    private SpacePath thisPath;
+    protected void setUp() throws Exception {
+        super.setUp();
+        thisPath = new SpacePath();
+        thisPath.setOrigin(new SpacePoint());
+        thisPath.setEndPoint(new CartesianPoint(1, 1, 1));
+    }
+
+    protected void tearDown() throws Exception {
+        super.tearDown();
+    }
+
+    /*
+     * Test method for 'org.lcsim.spacegeom.SpacePath.getPointAtLength(double)'
+     */
+    public void testGetPointAtLength() {
+        assertTrue(thisPath.getPointAtLength(0).equals(thisPath.origin()));
+        assertTrue(thisPath.getPointAtLength(1).equals(thisPath.endPoint()));
+        assertFalse(thisPath.getPointAtLength(1).equals(thisPath.origin()));
+        SpacePoint farPoint = new CartesianPoint(2, 2, 2);
+        assertTrue(thisPath.getPointAtLength(2).equals(farPoint));
+        SpacePoint halfPoint = new CartesianPoint(0.5, 0.5, 0.5);
+        assertTrue(thisPath.getPointAtLength(0.5).equals(halfPoint));
+        SpacePoint negPoint = new CartesianPoint(-1, -1, -1);
+        assertTrue(thisPath.getPointAtLength(-1).equals(negPoint));
+    }
+
+}
CVSspam 0.2.8