Package com.thoughtworks.proxy.kit

Examples of com.thoughtworks.proxy.kit.NoOperationResetter


        assertTrue(resetter.reset(this));
    }

    public void testSerializeWithJDK() throws IOException, ClassNotFoundException {
        useSerializedProxy((Resetter)serializeWithJDK(Decorating.object(
                new Class[]{Resetter.class}, new NoOperationResetter(), new AssertingDecorator(), getFactory())));
    }
View Full Code Here


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

    public void testSerializeWithXStream() {
        useSerializedProxy((Resetter)serializeWithXStream(Decorating.object(
                new Class[]{Resetter.class}, new NoOperationResetter(), new AssertingDecorator(), getFactory())));
    }
View Full Code Here

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

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

    protected void setUp() throws Exception {
        InstanceCounter.counter = 0;
    }

    public void testInstancesCanBeAccessed() {
        final Pool pool = new Pool(Identifiable.class, new NoOperationResetter(), getFactory());
        pool.add(createIdentifiables(1));
        Identifiable borrowed = (Identifiable)pool.get();
        assertNotNull(borrowed);
        assertEquals(0, borrowed.getId());
    }
View Full Code Here

        assertNotNull(borrowed);
        assertEquals(0, borrowed.getId());
    }

    public void testInstancesCanBeRecycled() {
        final Pool pool = new Pool(Identifiable.class, new NoOperationResetter(), getFactory());
        pool.add(createIdentifiables(3));
        Object borrowed0 = pool.get();
        Object borrowed1 = pool.get();
        Object borrowed2 = pool.get();
View Full Code Here

        Object borrowedReloaded = pool.get();
        assertEquals(borrowed, borrowedReloaded);
    }

    public void testSizeIsConstant() {
        final Pool pool = new Pool(Identifiable.class, new NoOperationResetter(), getFactory());
        pool.add(createIdentifiables(3));

        assertEquals(3, pool.size());
        Object borrowed0 = pool.get();
        assertEquals(3, pool.size());
View Full Code Here

        assertTrue(resetter.reset(this));
    }

    public void testSerializeWithJDK() throws IOException, ClassNotFoundException {
        useSerializedProxy((Resetter)serializeWithJDK(Dispatching.object(
                new Class[]{Resetter.class}, new Object[]{new NoOperationResetter()}, getFactory())));
    }
View Full Code Here

        assertNotNull(borrowed1);
        assertNotNull(borrowed2);
    }

    public void testUnmanagedInstanceCannotBeReleased() {
        final Pool pool = new Pool(Identifiable.class, new NoOperationResetter(), getFactory());
        try {
            pool.release(new InstanceCounter());
            fail("Thrown " + ClassCastException.class.getName() + " expected");
        } catch (final ClassCastException e) {
        }
View Full Code Here

        } catch (final ClassCastException e) {
        }
    }

    public void testElementMustBeReturnedToOwnPool() {
        final Pool pool1 = new Pool(Identifiable.class, new NoOperationResetter(), getFactory());
        pool1.add(createIdentifiables(1));
        final Pool pool2 = new Pool(Identifiable.class, new NoOperationResetter(), getFactory());
        Object o1 = pool1.get();
        assertEquals(0, pool1.getAvailable());
        try {
            pool2.release(o1);
            fail("Thrown " + IllegalArgumentException.class.getName() + " expected");
View Full Code Here

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

    public void testSerializeWithXStream() {
        useSerializedProxy((Resetter)serializeWithXStream(Dispatching.object(
                new Class[]{Resetter.class}, new Object[]{new NoOperationResetter()}, getFactory())));
    }
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.