Examples of SuppressMethod


Examples of samples.suppressmethod.SuppressMethod

    @Test
    public void testGetInt() throws Exception {
        suppress(method(SuppressMethod.class, "getInt"));

        SuppressMethod tested = new SuppressMethod();
        assertEquals("A method returning an int should return 0 after suppressing method code.", 0, tested.getInt());
    }
View Full Code Here

Examples of samples.suppressmethod.SuppressMethod

    @Test
    public void testGetLong() throws Exception {
        suppress(method(SuppressMethod.class, "getLong"));

        SuppressMethod tested = new SuppressMethod();
        assertEquals("A method returning a long should return 0 after suppressing method code.", 0, tested.getLong());
    }
View Full Code Here

Examples of samples.suppressmethod.SuppressMethod

    @Test
    public void testGetBoolean() throws Exception {
        suppress(method(SuppressMethod.class, "getBoolean"));

        SuppressMethod tested = new SuppressMethod();
        assertFalse("A method returning a boolean should return false after suppressing method code.", tested
                .getBoolean());
    }
View Full Code Here

Examples of samples.suppressmethod.SuppressMethod

    @Test
    public void testGetFloat() throws Exception {
        suppress(method(SuppressMethod.class, "getFloat"));

        SuppressMethod tested = new SuppressMethod();
        assertEquals("A method returning a float should return 0.0f after suppressing method code.", 0.0f, tested
                .getFloat(), 0);
    }
View Full Code Here

Examples of samples.suppressmethod.SuppressMethod

    @Test
    public void testGetDouble() throws Exception {
        suppress(method(SuppressMethod.class, "getDouble"));

        SuppressMethod tested = new SuppressMethod();
        assertEquals("A method returning a double should return 0.0d after suppressing method code.", 0.0d, tested
                .getDouble(), 0);
    }
View Full Code Here

Examples of samples.suppressmethod.SuppressMethod

    @Test
    public void testGetDouble_parameter() throws Exception {
        suppress(method(SuppressMethod.class, "getDouble", new Class<?>[] { double.class }));

        SuppressMethod tested = new SuppressMethod();
        assertEquals("A method returning a double should return 0.0d after suppressing method code.", 0.0d, tested
                .getDouble(8.7d), 0);
    }
View Full Code Here

Examples of samples.suppressmethod.SuppressMethod

    @Test
    public void testInvokeVoid() throws Exception {
        suppress(method(SuppressMethod.class, "invokeVoid", new Class<?>[] { StringBuilder.class }));

        SuppressMethod tested = new SuppressMethod();
        // Should not cause an NPE when suppressing code.
        tested.invokeVoid(null);
    }
View Full Code Here

Examples of samples.suppressmethod.SuppressMethod

    @Test
    public void testInvokeVoid_noParameterTypeSupplied() throws Exception {
        suppress(method(SuppressMethod.class, "invokeVoid"));

        SuppressMethod tested = new SuppressMethod();
        // Should not cause an NPE when suppressing code.
        tested.invokeVoid(null);
    }
View Full Code Here

Examples of samples.suppressmethod.SuppressMethod

    @Test
    public void suppressAllMethodsInMultipleClasses() throws Exception {
        suppress(methodsDeclaredIn(SuppressMethod.class, SuppressMethodExample.class));

        SuppressMethod tested1 = new SuppressMethod();
        SuppressMethodExample tested2 = new SuppressMethodExample();
        // Should not cause an NPE when suppressing code.
        tested1.invokeVoid(null);

        assertNull(tested1.getObject());
        assertEquals(0, tested1.getInt());
        assertNull(tested2.getObject());
    }
View Full Code Here

Examples of samples.suppressmethod.SuppressMethod

    @Test
    public void suppressOverridingMethod() throws Exception {
        suppress(method(SuppressMethod.class, "myMethod"));

        SuppressMethod tested = new SuppressMethod();
        assertEquals(0, tested.myMethod());
    }
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.