public class BooleanTest extends TestCase {
public void test() {
MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
try {
JAFuture future = new JAFuture();
JidFactories factory = new JidFactories();
factory.initialize(mailboxFactory.createMailbox());
BooleanJid boolean1 = (BooleanJid) BooleanJidFactory.fac.newActor(factory.getMailbox(), factory);
BooleanJid boolean2 = (BooleanJid) (new CopyJID()).send(future, boolean1);
(new SetBoolean(true)).send(future, boolean2);
BooleanJid boolean3 = (BooleanJid) (new CopyJID()).send(future, boolean2);
int sl = GetSerializedLength.req.send(future, boolean1);
assertEquals(1, sl);
sl = GetSerializedLength.req.send(future, boolean2);
assertEquals(1, sl);
sl = GetSerializedLength.req.send(future, boolean3);
assertEquals(1, sl);
assertFalse(GetBoolean.req.send(future, boolean1));
assertTrue(GetBoolean.req.send(future, boolean2));
assertTrue(GetBoolean.req.send(future, boolean3));
Actor jidJid1 = ActorJidFactory.fac.newActor(factory.getMailbox(), factory);
SetActor sjvb = new SetActor(JidFactories.BOOLEAN_JID_TYPE);
sjvb.send(future, jidJid1);
BooleanJid rpa = (BooleanJid) (new ResolvePathname("0")).send(future, jidJid1);
assertFalse(GetBoolean.req.send(future, rpa));
(new SetBoolean(true)).send(future, rpa);