Package org.agilewiki.jid

Examples of org.agilewiki.jid.JidFactories


        JAFuture future = new JAFuture();
        JAFactory factory = new JAFactory();
        factory.initialize(mailbox);
        factory.registerActorFactory(new BlobFactory("blob"));
        factory.defineActorType("hi", HelloWorld.class);
        JidFactories factories = new JidFactories();
        factories.initialize(mailbox, factory);

        RootJid root = new RootJid();
        root.initialize(mailbox, factory);
        (new SetActor("blob")).send(future, root);
        Blob blob = (Blob) (new ResolvePathname("0")).send(future, root);
View Full Code Here


    public void test4() throws Exception {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        Mailbox mailbox = mailboxFactory.createMailbox();
        JAFuture future = new JAFuture();

        JidFactories factory = new JidFactories();
        factory.initialize(mailboxFactory.createMailbox());

        RootJid root = new RootJid();
        root.initialize(mailbox, factory);

        SetActor setList = new SetActor(JidFactories.BOOLEAN_LIST_JID_TYPE);
View Full Code Here

    public void test5() throws Exception {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        Mailbox mailbox = mailboxFactory.createMailbox();
        JAFuture future = new JAFuture();

        JidFactories factory = new JidFactories();
        factory.initialize(mailboxFactory.createMailbox());

        RootJid root = new RootJid();
        root.initialize(mailbox, factory);

        SetActor setList = new SetActor(JidFactories.BOOLEAN_LIST_JID_TYPE);
View Full Code Here

public class IntegerTest extends TestCase {
    public void test() {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        try {
            JAFuture future = new JAFuture();
            JidFactories factory = new JidFactories();
            factory.initialize(mailboxFactory.createMailbox());

            IntegerJid int1 = (IntegerJid) IntegerJidFactory.fac.newActor(factory.getMailbox(), factory);
            IntegerJid int2 = (IntegerJid) (new CopyJID()).send(future, int1);
            (new SetInteger(1)).send(future, int2);
            IntegerJid int3 = (IntegerJid) (new CopyJID()).send(future, int2);

            int sl = GetSerializedLength.req.send(future, int1);
            assertEquals(4, sl);
            sl = GetSerializedLength.req.send(future, int2);
            assertEquals(4, sl);
            sl = GetSerializedLength.req.send(future, int3);
            assertEquals(4, sl);

            int v = GetInteger.req.send(future, int1);
            assertEquals(0, v);
            v = GetInteger.req.send(future, int2);
            assertEquals(1, v);
            v = GetInteger.req.send(future, int3);
            assertEquals(1, v);

            Actor jidJid1 = ActorJidFactory.fac.newActor(factory.getMailbox(), factory);
            SetActor sjvi = new SetActor(JidFactories.INTEGER_JID_TYPE);
            sjvi.send(future, jidJid1);
            IntegerJid rpa = (IntegerJid) (new ResolvePathname("0")).send(future, jidJid1);
            v = GetInteger.req.send(future, rpa);
            assertEquals(0, v);
View Full Code Here

public class BytesTest extends TestCase {
    public void test() {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        try {
            JAFuture future = new JAFuture();
            JidFactories factory = new JidFactories();
            factory.initialize(mailboxFactory.createMailbox());

            Actor bytes1 = BytesJidFactory.fac.newActor(factory.getMailbox(), factory);
            Actor bytes2 = (new CopyJID()).send(future, bytes1);
            (new SetBytes(new byte[3])).send(future, bytes2);
            Actor bytes3 = (new CopyJID()).send(future, bytes2);

            int sl = GetSerializedLength.req.send(future, bytes1);
            assertEquals(4, sl);
            sl = GetSerializedLength.req.send(future, bytes2);
            assertEquals(7, sl);
            sl = GetSerializedLength.req.send(future, bytes3);
            assertEquals(7, sl);

            assertNull(GetBytes.req.send(future, bytes1));
            assertEquals(3, GetBytes.req.send(future, bytes2).length);
            assertEquals(3, GetBytes.req.send(future, bytes3).length);

            Actor jidJid1 = ActorJidFactory.fac.newActor(factory.getMailbox(), factory);
            SetActor sjvbs = new SetActor(JidFactories.BYTES_JID_TYPE);
            sjvbs.send(future, jidJid1);
            Actor rpa = (new ResolvePathname("0")).send(future, jidJid1);
            assertNull(GetBytes.req.send(future, rpa));
            assertTrue((new MakeBytes(new byte[0])).send(future, rpa));
View Full Code Here

    public void test1() throws Exception {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        Mailbox mailbox = mailboxFactory.createMailbox();
        JAFuture future = new JAFuture();

        JidFactories factory = new JidFactories();
        factory.initialize(mailboxFactory.createMailbox());

        RootJid root = new RootJid();
        root.initialize(mailbox, factory);

        SetActor setMap = new SetActor(new IntegerMapJidFactory(JidFactories.INTEGER_INTEGER_MAP_JID_TYPE, IntegerJidFactory.fac));
View Full Code Here

    public void test2() throws Exception {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        Mailbox mailbox = mailboxFactory.createMailbox();
        JAFuture future = new JAFuture();

        JidFactories factory = new JidFactories();
        factory.initialize(mailboxFactory.createMailbox());

        RootJid root = new RootJid();
        root.initialize(mailbox, factory);

        SetActor setMap = new SetActor(
View Full Code Here

    public void test3() throws Exception {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        Mailbox mailbox = mailboxFactory.createMailbox();
        JAFuture future = new JAFuture();

        JidFactories factory = new JidFactories();
        factory.initialize(mailboxFactory.createMailbox());

        RootJid root = new RootJid();
        root.initialize(mailbox, factory);

        SetActor setMap = new SetActor(new IntegerMapJidFactory(
View Full Code Here

    public void test4() throws Exception {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        Mailbox mailbox = mailboxFactory.createMailbox();
        JAFuture future = new JAFuture();

        JidFactories factory = new JidFactories();
        factory.initialize(mailboxFactory.createMailbox());

        RootJid root = new RootJid();
        root.initialize(mailbox, factory);

        SetActor setMap = new SetActor(new IntegerMapJidFactory(
View Full Code Here

    public void test5() throws Exception {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        Mailbox mailbox = mailboxFactory.createMailbox();
        JAFuture future = new JAFuture();

        JidFactories factory = new JidFactories();
        factory.initialize(mailboxFactory.createMailbox());

        RootJid root = new RootJid();
        root.initialize(mailbox, factory);

        SetActor setMap = new SetActor(new IntegerMapJidFactory(
View Full Code Here

TOP

Related Classes of org.agilewiki.jid.JidFactories

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.