Package org.auraframework.impl.java.renderer

Examples of org.auraframework.impl.java.renderer.JavaRendererDef.render()


     * @expectedResults JavaRendererDef.render() function accepts a character stream and returns the stream, populated
     *                  with markup.
     */
    public void testInvokeRender() throws Exception {
        JavaRendererDef def = createRenderer("java://org.auraframework.impl.renderer.sampleJavaRenderers.TestSimpleRenderer");
        def.render(dummyCmp, sw);
        this.goldFileText(sw.toString());
    }

    private class AppendableThrower implements Appendable {
        private final IOException ioe;
View Full Code Here


        IOException ioe = new IOException();
        AuraError err = new AuraError("expected");
        RuntimeException re = new RuntimeException("expected");

        try {
            def.render(null, new AppendableThrower(ioe));
            fail("no exception on a throwing appendable");
        } catch (AuraExecutionException expected) {
            assertEquals("Did not throw wrapped IOException", ioe, expected.getCause());
        }
View Full Code Here

        } catch (AuraExecutionException expected) {
            assertEquals("Did not throw wrapped IOException", ioe, expected.getCause());
        }

        try {
            def.render(null, new AppendableThrower(err));
            fail("No exception on a throwing appendable.");
        } catch (AuraError expected) {
            assertEquals("Did not throw error", err, expected);
        }
View Full Code Here

        } catch (AuraError expected) {
            assertEquals("Did not throw error", err, expected);
        }

        try {
            def.render(null, new AppendableThrower(re));
            fail("no exception on a throwing appendable");
        } catch (AuraExecutionException expected) {
            assertEquals("Did not throw error", re, expected.getCause());
        }
View Full Code Here

        }

        // Make sure ArithmeticExceptions are wrapped and sent up the chain
        def = createRenderer("java://org.auraframework.impl.renderer.sampleJavaRenderers.TestRendererThrowingException");
        try {
            def.render(dummyCmp, sw);
            fail("Should be able to catch exceptions during rendering.");
        } catch (AuraExecutionException e) {
            // The thrown Exception should be AuraExecutionException, but we should still have the ArithemeticException
            // with the correct message for the cause
            checkExceptionFull(e.getCause(), ArithmeticException.class, "From TestRendererThrowingException");
View Full Code Here

        }

        // Make sure QuickFixExceptions are not swallowed
        def = createRenderer("java://org.auraframework.impl.renderer.sampleJavaRenderers.TestRendererThrowsQFEDuringRender");
        try {
            def.render(dummyCmp, sw);
            fail("Should be able to catch QuickFixExceptions during rendering.");
        } catch (Exception e) {
            checkExceptionFull(e, InvalidDefinitionException.class, "From TestRendererThrowsQFEDuringRender");
        }
    }
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.