Package org.apache.tapestry5.ioc.internal.services.TestAnnotation

Examples of org.apache.tapestry5.ioc.internal.services.TestAnnotation.TestAnnotation2


        catch (Exception ex)
        {
            throw new RuntimeException(ex);
        }

        classFactory = new ClassFactoryImpl(loader, classPool, classSource, logger);

        classToPriorTransformException.clear();
    }
View Full Code Here


        ClassPath path = new LoaderClassPath(loader);

        classPool.appendClassPath(path);

        classSource = new CtClassSourceImpl(classPool, loader);

        try
        {
            loader.addTranslator(classPool, this);
        }
View Full Code Here

        final TestAnnotation a = (TestAnnotation) targetClass.getAnnotation(TestAnnotation.class);

        assertNotNull(a);
       
        TestAnnotation2 a2 = a.annotationValue()[0];

        assertNotNull(a2);
        assertEquals(asList(a2.colors()), asList(Color.RED, Color.GREEN));
       
        assertEquals(asList(a.arrayValue()), asList("foo", "bar"));
        assertTrue(a.booleanValue());
        assertEquals(a.byteValue(), 97);
        assertEquals(a.charValue(), 'I');
        assertEquals(a.classValue(), AnnotatedServiceImpl.class);
        assertEquals(a.doubleValue(), 3.14);
        assertEquals(a.enumValue(), Color.RED);
        assertEquals(a.floatValue(), 2.718F);
        assertEquals(a.intValue(), 123);
        assertEquals(a.longValue(), 456L);
        assertEquals(a.shortValue(), 3);
        assertEquals(a.stringValue(), "foo");

        assertNotNull(targetClass.getAnnotation(ServiceId.class));
       
        Method method = targetClass.getMethod("doWork", String.class);
        TestAnnotation methodAnnotation = method.getAnnotation(TestAnnotation.class);
       
        assertNotNull(methodAnnotation);
       
        a2 = methodAnnotation.annotationValue()[0];
       
        assertNotNull(a2);
        assertEquals(asList(a2.colors()), asList(Color.BLUE, Color.GREEN));
        assertEquals(Arrays.asList(methodAnnotation.arrayValue()), Arrays.asList("barney"));
        assertFalse(methodAnnotation.booleanValue());
        assertEquals(methodAnnotation.byteValue(), 56);
        assertEquals(methodAnnotation.charValue(), 'D');
        assertEquals(methodAnnotation.classValue(), String.class);
View Full Code Here

        final TestAnnotation a = (TestAnnotation) targetClass.getAnnotation(TestAnnotation.class);

        assertNotNull(a);
       
        TestAnnotation2 a2 = a.annotationValue()[0];

        assertNotNull(a2);
        assertEquals(asList(a2.colors()), asList(Color.RED, Color.GREEN));
       
        assertEquals(asList(a.arrayValue()), asList("foo", "bar"));
        assertTrue(a.booleanValue());
        assertEquals(a.byteValue(), 97);
        assertEquals(a.charValue(), 'I');
        assertEquals(a.classValue(), AnnotatedServiceImpl.class);
        assertEquals(a.doubleValue(), 3.14);
        assertEquals(a.enumValue(), Color.RED);
        assertEquals(a.floatValue(), 2.718F);
        assertEquals(a.intValue(), 123);
        assertEquals(a.longValue(), 456L);
        assertEquals(a.shortValue(), 3);
        assertEquals(a.stringValue(), "foo");

        assertNotNull(targetClass.getAnnotation(ServiceId.class));
       
        Method method = targetClass.getMethod("doWork", String.class, String.class);
        TestAnnotation methodAnnotation = method.getAnnotation(TestAnnotation.class);
       
        assertNotNull(methodAnnotation);
       
        a2 = methodAnnotation.annotationValue()[0];
       
        assertNotNull(a2);
        assertEquals(asList(a2.colors()), asList(Color.BLUE, Color.GREEN));
        assertEquals(Arrays.asList(methodAnnotation.arrayValue()), Arrays.asList("barney"));
        assertFalse(methodAnnotation.booleanValue());
        assertEquals(methodAnnotation.byteValue(), 56);
        assertEquals(methodAnnotation.charValue(), 'D');
        assertEquals(methodAnnotation.classValue(), String.class);
View Full Code Here

    @Primary
    private StackTraceElementAnalyzer frameAnalyzer;

    void setupRender()
    {
        ExceptionAnalysis analysis = analyzer.analyze(exception);

        stack = analysis.getExceptionInfos();

        toggleId = renderSupport.allocateClientId("toggleStack");
    }
View Full Code Here

    @Test
    public void unknown_validator_type()
    {
        ValidationMessagesSource messagesSource = mockValidationMessagesSource();
        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        ComponentResources resources = mockComponentResources();
        Messages containerMessages = mockMessages();
        Map<String, Validator> map = newMap();
View Full Code Here

    @Test
    public void validator_with_no_constraint() throws Exception
    {
        ValidationMessagesSource messagesSource = mockValidationMessagesSource();
        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        Messages messages = mockMessages();
        MessageFormatter formatter = mockMessageFormatter();
        Object inputValue = new Object();
        ComponentResources resources = mockComponentResources();
View Full Code Here

    @Test
    public void component_messages_overrides_validator_messages() throws Exception
    {
        ValidationMessagesSource messagesSource = mockValidationMessagesSource();
        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        MessageFormatter formatter = mockMessageFormatter();
        Object inputValue = new Object();
        ComponentResources resources = mockComponentResources();
        Messages containerMessages = mockMessages();
View Full Code Here

    @Test
    public void component_messages_overrides_validator_messages_per_form() throws Exception
    {
        ValidationMessagesSource messagesSource = mockValidationMessagesSource();
        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        MessageFormatter formatter = mockMessageFormatter();
        Object inputValue = new Object();
        ComponentResources resources = mockComponentResources();
        Messages containerMessages = mockMessages();
View Full Code Here

    @Test
    public void constraint_value_from_message_catalog_per() throws Exception
    {
        ValidationMessagesSource messagesSource = mockValidationMessagesSource();
        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        Messages messages = mockMessages();
        MessageFormatter formatter = mockMessageFormatter();
        Object inputValue = new Object();
        ComponentResources resources = mockComponentResources();
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.ioc.internal.services.TestAnnotation.TestAnnotation2

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.