1 package org.lcsim.geometry.field;
2
3 import org.jdom.Element;
4
5
6
7
8
9 public class DipoleTest extends FieldTest
10 {
11 private Dipole dipole;
12 public DipoleTest(String testName)
13 {
14 super(testName);
15 }
16
17 protected void setUp() throws Exception
18 {
19 Element element = new Element("dipole");
20 element.setAttribute("zmin","10");
21 element.setAttribute("zmax","20");
22 element.setAttribute("rmax","100");
23 for (int i=0; i<3; i++)
24 {
25 Element coeff = new Element("dipoleCoeff");
26 coeff.setAttribute("value",String.valueOf(5-i));
27 element.addContent(coeff);
28 }
29 dipole = new Dipole(element);
30 }
31
32 public void testDipole()
33 {
34 testFieldAt(dipole,0,0,0,0,0,0);
35 testFieldAt(dipole,0,0,40,0,0,0);
36 testFieldAt(dipole,80,80,15,0,0,0);
37
38 testFieldAt(dipole,0,0,15,740,0,0);
39 }
40
41 }