Package org.auraframework.integration

Examples of org.auraframework.integration.Integration


     *
     * @throws Exception
     */
    @Ignore("W-1495981")
    public void testNullsForIntegrationService() throws Exception {
        Integration integration = null;
        assertNotNull("Failed to locate integration service implementation.", service);
        // All Nulls
        integration = service.createIntegration(null, null, true, null, null, null);
        assertException(integration);
        // No Context Path
View Full Code Here


     *
     * @throws Exception
     */
    @Ignore("W-1495981")
    public void testNullsForCreateIntegration() throws Exception {
        Integration integration = createIntegration();
        Map<String, Object> attributes = Maps.newHashMap();
        attributes.put("label", "Click Me");
        Appendable out = new StringBuffer();
        // No component tag
        assertException(integration, null, attributes, "", "", out);
        // No attributes. TODO: Should be okay?
        assertException(integration, simpleComponentTag, null, "", "", out);
        // No locatorDomId
        assertException(integration, simpleComponentTag, attributes, "", null, out);
        // 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

     * Integration Service throws exception when used with an unsupported client.
     * @throws Exception
     */
    public void testThrowsOnUnsupportedBrowsers() throws Exception{
        String ie6UserAgent = "Mozilla/4.0 (compatible; MSIE 6.1; Windows XP; .NET CLR 1.1.4322; .NET CLR 2.0.50727)";
        Integration integration = service.createIntegration("", Mode.DEV, true, ie6UserAgent, null, null);
        try{
            injectSimpleComponent(integration);
            fail("Integration service should throw exception when used with unsupported browsers.");
        }catch(UnsupportedUserAgentException e){
            //expected
View Full Code Here

    public void testSanityCheck() throws Exception {
        assertNotNull("Failed to locate implementation of IntegrationService.", service);

        Mode[] testModes = new Mode[] { Mode.UTEST, Mode.PROD, Mode.FTEST, Mode.JSTEST, Mode.JSTESTDEBUG, Mode.PRODDEBUG, Mode.PTEST, Mode.SELENIUM, Mode.STATS };
        for (Mode m : testModes) {
            Integration integration = service.createIntegration("", m, true, null, getNoDefaultPreloadsApp().getQualifiedName(), null);
            assertNotNull(String.format(
                    "Failed to create an integration object using IntegrationService in %s mode. Returned null.", m),
                    integration);
            try {
                injectSimpleComponent(integration);
View Full Code Here

                String.format(baseComponentTag, "", ""));
        DefDescriptor<ComponentDef> cmp2 = addSourceAutoCleanup(ComponentDef.class,
                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
        assertNotNull(out);
View Full Code Here

        attributes.put("strList", Lists.newArrayList("food", "bared"));
        attributes.put("booleanList", new Boolean[] { true, false });
        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("press", "function(e){alert('press')}");
        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

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

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

    @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

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.