Package org.easymock.internal

Examples of org.easymock.internal.DefaultClassInstantiator.newInstance()


    @Test
    public void privateConstructor() {
        final DefaultClassInstantiator instantiator = new DefaultClassInstantiator();
        try {
            instantiator.newInstance(PrivateConstructorClass.class);
            fail("Shouldn't be able to mock a class with a private constructor using DefaultInstantiator");
        } catch (final Exception e) {
        }
    }
View Full Code Here


    }

    @Test
    public void badSerializable() throws Exception {
        final DefaultClassInstantiator instantiator = new DefaultClassInstantiator();
        instantiator.newInstance(BadlyDoneSerializableClass.class);
    }

    private <T> void checkInstatiation(final Class<T> clazz) {
        final T mock = createMock(clazz);
        assertTrue(clazz.isAssignableFrom(mock.getClass()));
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.