Examples of ReplicableObject


Examples of programming5.code.ReplicableObject

    public void testReplicate_ReplicableType() {
        ReplicableObject[] toReplicate = new ReplicableObject[0];
        ReplicableObject[] replica = new ReplicableObject[0];
        ArrayOperations.replicate(toReplicate, replica);
        assertEquals(0, replica.length);
        ReplicableObject one = new ReplicableObject(1);
        toReplicate = new ReplicableObject[] {one};
        replica = new ReplicableObject[1];
        ArrayOperations.replicate(toReplicate, replica);
        assertNotSame(replica, toReplicate);
        assertNotSame(replica[0], toReplicate[0]);
        assertArrayEquals(new ReplicableObject[] {one}, replica);
        ReplicableObject two = new ReplicableObject(2);
        ReplicableObject three = new ReplicableObject(3);
        toReplicate = new ReplicableObject[] {one, two, three};
        replica = new ReplicableObject[3];
        ArrayOperations.replicate(toReplicate, replica);
        two.setField(20);
        assertEquals(20, toReplicate[1].getField());
View Full Code Here

Examples of programming5.code.ReplicableObject

    /**
     * Test of prefix method, of class ArrayOperations.
     */
    @Test
    public void testPrefix_ObjectArr_int() {
        ReplicableObject one = new ReplicableObject(1);
        ReplicableObject two = new ReplicableObject(2);
        ReplicableObject three = new ReplicableObject(3);
        ReplicableObject[] toPrefix = new ReplicableObject[] {one, two, three};
        Object[] prefix = ArrayOperations.prefix(toPrefix, 0);
        assertEquals(0, prefix.length);
        prefix = ArrayOperations.prefix(toPrefix, 2);
        assertEquals(2, prefix.length);
View Full Code Here

Examples of programming5.code.ReplicableObject

    /**
     * Test of suffix method, of class ArrayOperations.
     */
    @Test
    public void testSuffix_ObjectArr_int() {
        ReplicableObject one = new ReplicableObject(1);
        ReplicableObject two = new ReplicableObject(2);
        ReplicableObject three = new ReplicableObject(3);
        ReplicableObject[] toSuffix = new ReplicableObject[] {one, two, three};
        Object[] suffix = ArrayOperations.suffix(toSuffix, 0);
        assertEquals(3, suffix.length);
        assertArrayEquals(new ReplicableObject[] {one, two, three}, suffix);
        suffix = ArrayOperations.suffix(toSuffix, 2);
View Full Code Here

Examples of programming5.code.ReplicableObject

    /**
     * Test of subArray method, of class ArrayOperations.
     */
    @Test
    public void testSubArray_3args_7() {
        ReplicableObject one = new ReplicableObject(1);
        ReplicableObject two = new ReplicableObject(2);
        ReplicableObject three = new ReplicableObject(3);
        ReplicableObject[] toCut = new ReplicableObject[] {one, two, three};
        Object[] subArray = ArrayOperations.subArray(toCut, 0, 3);
        assertEquals(3, subArray.length);
        assertArrayEquals(new ReplicableObject[] {one, two, three}, subArray);
        subArray = ArrayOperations.subArray(toCut, 1, 2);
View Full Code Here

Examples of programming5.code.ReplicableObject

    /**
     * Test of join method, of class ArrayOperations.
     */
    @Test
    public void testJoin_ObjectArrArr() {
        ReplicableObject one = new ReplicableObject(1);
        ReplicableObject two = new ReplicableObject(2);
        ReplicableObject three = new ReplicableObject(3);
        ReplicableObject[] empty = new ReplicableObject[0];
        ReplicableObject[] single = new ReplicableObject[] {one};
        ReplicableObject[] multiple = new ReplicableObject[] {one, two, three};
        Object[] joined = ArrayOperations.join(empty);
        assertEquals(0, joined.length);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.