Examples of Integration


Examples of org.auraframework.integration.Integration

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

Examples of org.auraframework.integration.Integration

    @Ignore("W-1505382")
    public void testNonStringAttributeValuesForEvents() throws Exception {
        // Non String attribute for functions
        Map<String, Object> attributes = Maps.newHashMap();
        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

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

Examples of org.auraframework.integration.Integration

     */
    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

Examples of org.auraframework.integration.Integration

    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

Examples of org.auraframework.integration.Integration

     * @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

Examples of org.auraframework.integration.Integration

        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

Examples of org.auraframework.integration.Integration

            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

Examples of org.nxplanner.domain.Integration

        if (StringUtils.isEmpty(personId) || personId.equals("0")) {
            saveError(request, "integrations.error.noperson");
            return actionMapping.findForward("error");
        }
        Integration integration = new Integration();
        integration.setProjectId(Integer.parseInt(request.getParameter("projectId")));
        integration.setPersonId(Integer.parseInt(personId));
        integration.setComment(comment);
        integration.setState(Integration.PENDING);
        integration.setWhenRequested(new Date());

        List pendingIntegrations = getIntegrationsInState(session, Integration.PENDING, projectId);
        if (pendingIntegrations.size() == 0) {
            Integration activeIntegration = getFirstIntegrationInState(session, Integration.ACTIVE, projectId);
            if (activeIntegration == null) {
                startIntegration(integration);
            }
        }
View Full Code Here

Examples of org.nxplanner.domain.Integration

    private void onLeaveRequest(Session session, HttpServletRequest request, int projectId) throws Exception {
        Integer oid = getLeaveOid(request);

        List pendingIntegrations = getIntegrationsInState(session, Integration.PENDING, projectId);
        Integration firstPendingIntegration = (Integration)pendingIntegrations.get(0);

        Integration leavingIntegration = (Integration)session.load(Integration.class, oid);
        session.delete(leavingIntegration);

        if (isNotificationEnabled(request) &&
                leavingIntegration.getId() == firstPendingIntegration.getId() &&
                pendingIntegrations.size() > 1) {
            fireIntegrationEvent(IntegrationListener.INTEGRATION_READY_EVENT,
                    (Integration)pendingIntegrations.get(1), request);
        }
    }
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.