Package org.auraframework.integration

Examples of org.auraframework.integration.Integration.injectComponent()


        // No stream to write output to
        assertException(integration, simpleComponentTag, attributes, "", "", null);

        // No local ID should be fine
        try {
            integration.injectComponent(simpleComponentTag, attributes, "", "", out);
        } catch (Exception unexpected) {
            fail("Not specifying a localId to injected component should be tolerated.");
        }
    }
    /**
 
View Full Code Here


                String.format(baseComponentTag, "", ""));
        Map<String, Object> attributes = Maps.newHashMap();
        Appendable out = new StringBuffer();
        Integration integration = createIntegration();
        try {
            integration.injectComponent(cmp1.getDescriptorName(), attributes, "", "", out);
            integration.injectComponent(cmp2.getDescriptorName(), attributes, "", "", out);
        } catch (Exception unexpected) {
            fail("Failed to inject multiple component. Exception:" + unexpected.getMessage());
        }
        // Verify that the boot strap was written only once
View Full Code Here

        Map<String, Object> attributes = Maps.newHashMap();
        Appendable out = new StringBuffer();
        Integration integration = createIntegration();
        try {
            integration.injectComponent(cmp1.getDescriptorName(), attributes, "", "", out);
            integration.injectComponent(cmp2.getDescriptorName(), attributes, "", "", out);
        } catch (Exception unexpected) {
            fail("Failed to inject multiple component. Exception:" + unexpected.getMessage());
        }
        // Verify that the boot strap was written only once
        assertNotNull(out);
View Full Code Here

        attributes.put("objAttr", "Object");

        Appendable out = new StringBuffer();
        Integration integration = createIntegration();
        try {
            integration.injectComponent(cmp.getDescriptorName(), attributes, "", "", out, async);
        } catch (Exception unexpected) {
            fail("Exception occured when injecting component with attribute values. Exception:"
                    + unexpected.getMessage());
        }
    }
View Full Code Here

        attributes.put("mouseout", "function(e){alert('mouseout')}");

        Appendable out = new StringBuffer();
        Integration integration = createIntegration();
        try {
            integration.injectComponent(cmp.getDescriptorName(), attributes, "", "", out);
        } catch (Exception unexpected) {
            fail("Exception occured when injecting component with attribute and event handlers. Exception:"
                    + unexpected.getMessage());
        }
    }
View Full Code Here

        Map<String, Object> attributes = Maps.newHashMap();
        attributes.put("fooBar", "");
        Appendable out = new StringBuffer();
        Integration integration = createIntegration();
        try {
            integration.injectComponent(simpleComponentTag, attributes, "", "", out);
            fail("Using nonexisting attribute names should have failed.");
        } catch (AuraRuntimeException expected) {
            // TODO rework after ccollab: Earlier error message was like
            // "Unknown attribute or event ui:button:fooBar"
            assertEquals("Unknown attribute or event ui:button - fooBar", expected.getMessage());
View Full Code Here

        Map<String, Object> attributes = Maps.newHashMap();
        attributes.put("stringArray", "I am not a list!");
        Appendable out = new StringBuffer();
        Integration integration = createIntegration();
        try {
            integration.injectComponent(arraysComponentTag, attributes, "", "", out);
            fail("Passing attribute with wrong type should have failed.");
        } catch (AuraRuntimeException expected) {
            // TODO rework after ccollab: Earlier error message was like
            // "Unknown attribute or event ui:button:fooBar"
            assertEquals("Whatever we gonna throw ....", expected.getMessage());
View Full Code Here

        Appendable out = new StringBuffer();
        Integration integration = createIntegration();
        attributes.put("label", "Click Me");
        attributes.put("press", new Integer(10));
        try {
            integration.injectComponent(simpleComponentTag, attributes, "", "", out);
            fail("Should have failed to accept a non String value for event handler.");
        } catch (AuraRuntimeException expected) {
            // Expected
        } catch (Exception unexpected) {
            fail("Failed to detect bad value provided for event handlers. Failed :" + unexpected.getMessage());
View Full Code Here

    public void testInjectingNonExistingComponent() throws Exception {
        Map<String, Object> attributes = Maps.newHashMap();
        Appendable out = new StringBuffer();
        Integration integration = createIntegration();
        try {
            integration.injectComponent("foo:bared", attributes, "", "", out);
            fail("Instantiating component through integration service should have failed because of missing component def.");
        } catch (DefinitionNotFoundException expected) {
            // Expected exception
            assertTrue(expected.getMessage().contains("No COMPONENT named markup://foo:bared found"));
        }
View Full Code Here

        String validApp = "test:laxSecurity";
        Map<String, Object> attributes = Maps.newHashMap();
        Appendable out = new StringBuffer();
        Integration integration = createIntegration();
        try {
            integration.injectComponent(validApp, attributes, "", "", out);
            fail("Injecting an application through integration service should have failed.");
        } catch (DefinitionNotFoundException expected) {
            // TODO: Maybe a better error message?
            assertTrue(expected.getMessage().contains("No COMPONENT named markup://test:laxSecurity found"));
        }
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.