Package com.thoughtworks.proxy.kit

Examples of com.thoughtworks.proxy.kit.NoOperationResetter


        }
        assertEquals(0, pool2.getAvailable());
    }

    public void testPoolReturnsNullIfExhausted() {
        final Pool pool = new Pool(Identifiable.class, new NoOperationResetter(), getFactory());
        pool.add(createIdentifiables(1));
        Object obj1 = pool.get();
        assertNotNull(obj1);
        assertEquals(0, pool.getAvailable());
        assertNull(pool.get());
View Full Code Here


                new Class[]{Resetter.class}, new Object[]{new NoOperationResetter()}, getFactory())));
    }

    public void testSerializeWithXStreamInPureReflectionMode() {
        useSerializedProxy((Resetter)serializeWithXStreamAndPureReflection(Dispatching.object(
                new Class[]{Resetter.class}, new Object[]{new NoOperationResetter()}, getFactory())));
    }
View Full Code Here

        assertEquals(0, pool.getAvailable());
        assertNull(pool.get());
    }

    public void testPoolSizeIsConstant() {
        final Pool pool = new Pool(Identifiable.class, new NoOperationResetter(), getFactory());
        pool.add(createIdentifiables(3));
        assertEquals(3, pool.size());
        Object obj1 = pool.get();
        assertEquals(3, pool.size());
        Object obj2 = pool.get();
View Full Code Here

        assertNotNull(obj2);
        assertNotNull(obj3);
    }

    public void testPoolGrowingManually() {
        final Pool pool = new Pool(Identifiable.class, new NoOperationResetter(), getFactory());
        pool.add(createIdentifiables(1));
        Object obj1 = pool.get();
        assertEquals(0, pool.getAvailable());
        pool.add(new InstanceCounter());
        Object obj2 = pool.get();
View Full Code Here

        assertNotNull(borrowed0);
        assertNotNull(borrowed1);
    }

    public void testSerializeWithJDK() throws IOException, ClassNotFoundException {
        final Pool pool = new Pool(Identifiable.class, new NoOperationResetter(), getFactory());
        pool.add(createIdentifiables(2));
        Object borrowed = pool.get();
        useSerializedProxy((Pool)serializeWithJDK(pool));
        assertNotNull(borrowed); // keep instance
    }
View Full Code Here

        useSerializedProxy((Pool)serializeWithJDK(pool));
        assertNotNull(borrowed); // keep instance
    }

    public void testSerializeWithXStream() {
        final Pool pool = new Pool(Identifiable.class, new NoOperationResetter(), getFactory());
        pool.add(createIdentifiables(2));
        Object borrowed = pool.get();
        useSerializedProxy((Pool)serializeWithXStream(pool));
        assertNotNull(borrowed); // keep instance
    }
View Full Code Here

        useSerializedProxy((Pool)serializeWithXStream(pool));
        assertNotNull(borrowed); // keep instance
    }

    public void testSerializeWithXStreamInPureReflectionMode() {
        final Pool pool = new Pool(Identifiable.class, new NoOperationResetter(), getFactory());
        pool.add(createIdentifiables(2));
        Object borrowed = pool.get();
        useSerializedProxy((Pool)serializeWithXStreamAndPureReflection(pool));
        assertNotNull(borrowed); // keep instance
    }
View Full Code Here

        assertNotNull(borrowed); // keep instance
    }

    public void testForcedSerializationWithJDK() throws IOException, ClassNotFoundException {
        final Pool pool = new Pool(
                Identifiable.class, new NoOperationResetter(), getFactory(), Pool.SERIALIZATION_FORCE);
        pool.add(createIdentifiables(2));
        Object borrowed = pool.get();
        useSerializedProxy((Pool)serializeWithJDK(pool));
        assertNotNull(borrowed); // keep instance
    }
View Full Code Here

        assertNotNull(borrowed); // keep instance
    }

    public void testForcedSerializationWithXStream() {
        final Pool pool = new Pool(
                Identifiable.class, new NoOperationResetter(), getFactory(), Pool.SERIALIZATION_FORCE);
        pool.add(createIdentifiables(2));
        Object borrowed = pool.get();
        useSerializedProxy((Pool)serializeWithXStream(pool));
        assertNotNull(borrowed); // keep instance
    }
View Full Code Here

        assertNotNull(borrowed); // keep instance
    }

    public void testForcedSerializationWithXStreamInPureReflectionMode() {
        final Pool pool = new Pool(
                Identifiable.class, new NoOperationResetter(), getFactory(), Pool.SERIALIZATION_FORCE);
        pool.add(createIdentifiables(2));
        Object borrowed = pool.get();
        useSerializedProxy((Pool)serializeWithXStreamAndPureReflection(pool));
        assertNotNull(borrowed); // keep instance
    }
View Full Code Here

TOP

Related Classes of com.thoughtworks.proxy.kit.NoOperationResetter

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.