Package org.auraframework.integration

Examples of org.auraframework.integration.Integration


     * @throws Exception
     */
    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


     */
    public void testInjectingApplications() throws Exception {
        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

    public void testExceptionDuringComponentInstantiation() throws Exception {
        DefDescriptor<ComponentDef> cmp = addSourceAutoCleanup(ComponentDef.class,
                String.format(baseComponentTag, "", "<aura:attribute name='reqAttr' required='true' type='String'/>"));
        Map<String, Object> attributes = Maps.newHashMap();
        Appendable out = new StringBuffer();
        Integration integration = createIntegration();
        try {
            integration.injectComponent(cmp.getDescriptorName(), attributes, "", "", out);
        } catch (Exception unexpected) {
            fail("Exceptions during component instantiation should be funneled to the client.");
        }
    }
View Full Code Here

     * @throws Exception
     */
    public void testObserverInvoked() throws Exception {
        IntegrationServiceObserver mockObserver = Mockito.mock(IntegrationServiceObserver.class);
        AuraContext cntx = Aura.getContextService().startContext(Mode.UTEST, Format.JSON, Authentication.AUTHENTICATED);
        Integration integration = service.createIntegration("", Mode.UTEST, true, null, getNoDefaultPreloadsApp().getQualifiedName(), mockObserver);
        injectSimpleComponent(integration);
        Mockito.verify(mockObserver, Mockito.times(2)).contextEstablished(integration, cntx);
    }
View Full Code Here

        String appMarkup = "<aura:application></aura:application>";
        DefDescriptor<ApplicationDef> appDesc = getAuraTestingUtil().addSourceAutoCleanup(
                ApplicationDef.class, appMarkup);
        Map<String, Object> attributes = Maps.newHashMap();
        Appendable out = new StringBuffer();
        Integration integration = service.createIntegration("", Mode.UTEST, true, null, appDesc.getQualifiedName(), null);
        try {
            integration.injectComponent(simpleComponentTag, attributes, "", "", out);
            fail("App used for integration should extend aura:integrationServiceApp");
        } catch (AuraRuntimeException expected) {
            assertEquals("Application must extend aura:integrationServiceApp.", expected.getMessage());
        }
    }
View Full Code Here

            Appendable out, boolean useAsync, String applicationTag) throws AuraRuntimeException, QuickFixException, IOException {
        ContextService contextService = Aura.getContextService();
        AuraContext ctx = contextService.getCurrentContext();
        contextService.endContext();

        Integration integration = Aura.getIntegrationService().createIntegration(
                "", Mode.DEV, true, null, applicationTag, null);
        integration.injectComponent(tag, attributes, localId, locatorDomId, out, useAsync);

        // The only not-so-ideal part of this approach to testing
        // IntegrationService is that we have to start the
        // context for the rendering of the original stub component to continue.
        // IntegrationService sets up and tears down its context.
View Full Code Here

TOP

Related Classes of org.auraframework.integration.Integration

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.