Package org.activeio

Examples of org.activeio.Packet


        assertEquals(0, packet.position());
        assertEquals(100, packet.limit());
    }

    public void testDuplicate() {
        Packet packet = createTestPacket(100);
        packet.position(5);
        packet.limit(95);
        Packet packet2 = packet.duplicate();
        packet2.position(10);
        packet2.limit(20);
       
        assertEquals(5, packet.position());
        assertEquals(95, packet.limit());
        assertEquals(10, packet2.position());
        assertEquals(20, packet2.limit());
    }
View Full Code Here


        assertEquals(10, packet2.position());
        assertEquals(20, packet2.limit());
    }

    public void testRewind() {
        Packet packet = createTestPacket(100);
        packet.position(5);
        packet.limit(95);
        packet.rewind();
       
        assertEquals(0, packet.position());
        assertEquals(95, packet.limit());
    }
View Full Code Here

        assertEquals(0, packet.position());
        assertEquals(95, packet.limit());
    }
   
    public void testSlice() {
        Packet packet = createTestPacket(100);
        packet.position(5);
        packet.limit(95);
        Packet packet2 = packet.slice();
       
        assertEquals(0, packet2.position());
        assertEquals(90, packet2.capacity());
        assertEquals(90, packet2.limit());
    }
View Full Code Here

        ClassLoader originalLoader = Thread.currentThread().getContextClassLoader();
        try {

            RequestChannel channel = createRequestChannel(target);
            Packet response;
            try {
                channel.start();
                Packet request = serialize(invocation);
                response = channel.request(request, Service.WAIT_FOREVER_TIMEOUT);
            } finally {
                channel.dispose();               
            }
           
View Full Code Here

                  Subject subject = Subject.getSubject(AccessController.getContext());
                  String p = subject.getPrincipals().iterator().next().toString();
                  log.info("Sending request as: "+p);

                    Packet request = new ByteArrayPacket("whoami".getBytes());
                    Packet response = channel.request(request, 1000*5*1000);

                    assertNotNull(response);
                    assertEquals( p, new String(response.sliceAsBytes()) );
                    return null;
              }
          });
        } finally {
            channel.dispose();
View Full Code Here

TOP

Related Classes of org.activeio.Packet

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.