Examples of Aop1


Examples of org.nutz.aop.asm.test.Aop1

        assertTrue(newClass.getDeclaredConstructors().length > 0);
    }

    @Test
    public void testReturnPrimitive() throws Throwable {
        Aop1 a1 = classAgent.define(Nutzs.cd(), Aop1.class)
                            .getConstructor(String.class)
                            .newInstance("Nutz");
        a1.returnLong();
        a1.returnBoolean();
        a1.returnByte();
        a1.returnChar();
        a1.returnFloat();
        a1.returnShort();
        a1.returnDouble();
    }
View Full Code Here

Examples of org.nutz.aop.asm.test.Aop1

        a1.returnDouble();
    }

    @Test
    public void testReturnPrimitiveArray() {
        Aop1 a1 = getNewInstance(Aop1.class);
        a1.returnIntArray();
        a1.returnLongArray();
        a1.returnBooleanArray();
        a1.returnByteArray();
        a1.returnCharArray();
        a1.returnFloatArray();
        a1.returnShortArray();
        a1.returnDoubleArray();
    }
View Full Code Here

Examples of org.nutz.aop.asm.test.Aop1

        a1.returnDoubleArray();
    }

    @Test
    public void testReturnObject() throws Throwable {
        Aop1 a1 = getNewInstance(Aop1.class);
        a1.returnString();
        a1.returnObjectArray();
        a1.getRunnable();
        a1.getEnum();
    }
View Full Code Here

Examples of org.nutz.aop.asm.test.Aop1

        a1.getEnum();
    }

    @Test(expected = RuntimeException.class)
    public void testThrowError() throws Throwable {
        Aop1 a1 = getNewInstance(Aop1.class);
        a1.throwError();
    }
View Full Code Here

Examples of org.nutz.aop.asm.test.Aop1

        a1.throwError();
    }

    @Test(expected = Exception.class)
    public void testThrowException() throws Throwable {
        Aop1 a1 = getNewInstance(Aop1.class);
        a1.throwException();
    }
View Full Code Here

Examples of org.nutz.aop.asm.test.Aop1

        a1.throwException();
    }

    @Test
    public void testArgs() throws Throwable {
        Aop1 a1 = getNewInstance(Aop1.class);
        a1.nonArgsVoid();
        a1.argsVoid("Wendal is the best!");
        a1.mixObjectsVoid("Arg1", new Object(), 1, null);
        a1.mixArgsVoid("XX", "WendalXXX", 0, 'c', 1L, 9090L);
        a1.mixArgsVoid2("Aop1",
                        Boolean.TRUE,
                        8888,
                        'p',
                        34L,
                        false,
                        'b',
                        "Gp",
                        null,
                        null,
                        23L,
                        90L,
                        78L);
        String result = String.valueOf(a1.mixArgsVoid4("WendalXXX"));
        assertEquals("WendalXXX", result);
    }
View Full Code Here

Examples of org.nutz.aop.asm.test.Aop1

        AsmClassAgent agent = new AsmClassAgent();
        MyL interceptor = new MyL();
        agent.addInterceptor(new RegexMethodMatcher(null, "nonArgsVoid", 0), interceptor);
        agent.addInterceptor(MethodMatcherFactory.matcher(".*"), new LoggingMethodInterceptor());
        Mirror<Aop1> mirror = Mirror.me(agent.define(Nutzs.cd(), Aop1.class));
        Aop1 aop1 = mirror.born("Nutz");
        aop1.nonArgsVoid();
        assertFalse(interceptor.runned);
        aop1.argsVoid(null);
        assertTrue(interceptor.runned);
    }
View Full Code Here

Examples of org.nutz.aop.asm.test.Aop1

    }

    @Test
    public void testBorn() {
        Class<Aop1> klass = classAgent.define(Nutzs.cd(), Aop1.class);
        Aop1 a1 = Mirror.me(klass).born("Nut");
        a1.returnObjectArray();
    }
View Full Code Here

Examples of org.nutz.aop.asm.test.Aop1

        assertTrue(newClass.getDeclaredConstructors().length > 0);
    }

    @Test
    public void testReturnPrimitive() throws Throwable {
        Aop1 a1 = classAgent.define(Nutzs.cd(), Aop1.class)
                            .getConstructor(String.class)
                            .newInstance("Nutz");
        a1.returnLong();
        a1.returnBoolean();
        a1.returnByte();
        a1.returnChar();
        a1.returnFloat();
        a1.returnShort();
        a1.returnDouble();
    }
View Full Code Here

Examples of org.nutz.aop.asm.test.Aop1

        a1.returnDouble();
    }

    @Test
    public void testReturnPrimitiveArray() {
        Aop1 a1 = getNewInstance(Aop1.class);
        a1.returnIntArray();
        a1.returnLongArray();
        a1.returnBooleanArray();
        a1.returnByteArray();
        a1.returnCharArray();
        a1.returnFloatArray();
        a1.returnShortArray();
        a1.returnDoubleArray();
    }
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.