public class DoubleTest extends TestCase {
public void test() {
MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
try {
JAFuture future = new JAFuture();
JidFactories factory = new JidFactories();
factory.initialize(mailboxFactory.createMailbox());
DoubleJid double1 = (DoubleJid) DoubleJidFactory.fac.newActor(factory.getMailbox(), factory);
DoubleJid double2 = (DoubleJid) (new CopyJID()).send(future, double1);
(new SetDouble(1.D)).send(future, double2);
DoubleJid double3 = (DoubleJid) (new CopyJID()).send(future, double2);
int sl = GetSerializedLength.req.send(future, double1);
assertEquals(8, sl);
sl = GetSerializedLength.req.send(future, double2);
assertEquals(8, sl);
sl = GetSerializedLength.req.send(future, double3);
assertEquals(8, sl);
double v = GetDouble.req.send(future, double1);
assertEquals(0.D, v);
v = GetDouble.req.send(future, double2);
assertEquals(1.D, v);
v = GetDouble.req.send(future, double3);
assertEquals(1.D, v);
Actor jidJid1 = ActorJidFactory.fac.newActor(factory.getMailbox(), factory);
SetActor sjvl = new SetActor(JidFactories.DOUBLE_JID_TYPE);
sjvl.send(future, jidJid1);
DoubleJid rpa = (DoubleJid) (new ResolvePathname("0")).send(future, jidJid1);
v = GetDouble.req.send(future, rpa);
assertEquals(0.D, v);