Package org.auraframework.service

Examples of org.auraframework.service.ContextService.startContext()


    // provide a test component with TOKENs for replacement to trigger lastMod updates
    private ComponentDef getTargetComponent() throws Exception {
        ContextService service = Aura.getContextService();
        AuraContext context = service.getCurrentContext();
        if (context == null) {
            context = service.startContext(Mode.SELENIUM, Format.HTML, Authentication.AUTHENTICATED);
        }
        return Aura.getDefinitionService().getDefinition(
                String.format("%s:%s", namespace, cmpName), ComponentDef.class);
    }
View Full Code Here


    private void replaceToken(DefDescriptor<?> descriptor, String replacement) throws Exception {
        assertNotNull("Missing descriptor for source replacement!", descriptor);
        ContextService service = Aura.getContextService();
        AuraContext context = service.getCurrentContext();
        if (context == null) {
            context = service.startContext(Mode.SELENIUM, Format.HTML,
                    Authentication.AUTHENTICATED);
        }
        Source<?> source = context.getDefRegistry().getSource(descriptor);
        String originalContent = source.getContents();
        assert originalContent.contains(TOKEN);
View Full Code Here

     * Start a context and set up default values.
     */
    protected AuraContext setupContext(Mode mode, Format format, DefDescriptor<? extends BaseComponentDef> desc)
            throws QuickFixException {
        ContextService contextService = Aura.getContextService();
        AuraContext ctxt = contextService.startContext(mode, format, Authentication.AUTHENTICATED, desc);
        ctxt.setFrameworkUID(Aura.getConfigAdapter().getAuraFrameworkNonce());
        String uid = ctxt.getDefRegistry().getUid(null, desc);
        ctxt.addLoaded(desc, uid);
        return ctxt;
    }
View Full Code Here

            return;
        }
        if (current != null) {
            service.endContext();
        }
        service.startContext(context.getMode(), context.getFormat(), context.getAccess(),
                context.getApplicationDescriptor());
    }

    /**
     * Check to ensure that an exception exactly matches both message and location.
View Full Code Here

            DefinitionService definitionService = Aura.getDefinitionService();

            boolean contextStarted = false;
            if (!contextService.isEstablished()) {
                contextStarted = true;
                contextService.startContext(Mode.JSTEST, Format.JSON, Authentication.AUTHENTICATED);
            }

            Map<String, TestSuite> subSuites = new HashMap<>();
            try {
                DescriptorFilter filter = new DescriptorFilter("js://"+namespace, DefType.TESTSUITE.toString());
View Full Code Here

         */
        public String getCode() throws QuickFixException {
            ContextService contextService = Aura.getContextService();
            boolean isEstablished = contextService.isEstablished();
            if (!isEstablished) {
                contextService.startContext(Mode.AUTOJSTEST, Format.JSON, Authentication.AUTHENTICATED);
            }
            try {
                return descriptor.getDef().getCode();
            } finally {
                if (!isEstablished) {
View Full Code Here

        // 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.
        contextService.startContext(ctx.getMode(), ctx.getFormat(), ctx.getAccess(),
                ctx.getApplicationDescriptor());
    }
   
    protected void injectComponent(String tag, Map<String, Object> attributes, String localId, String locatorDomId,
            Appendable out, boolean useAsync) throws AuraRuntimeException, QuickFixException, IOException {
View Full Code Here

        ContextService contextService = Aura.getContextService();
    if (testAuraContext != null) {
            contextService.endContext();
        }
       
        testAuraContext = contextService.startContext(Mode.UTEST, Format.JSON, Authentication.AUTHENTICATED);
    }

    public void testEqualsWhenSame() throws Exception {
        VarDef def1 = buildDefinition();
        assertEquals(def1, def1);
View Full Code Here

    public void testTestContext() {
        // can only test the test context
        ContextService contextService = Aura.getContextService();
        ContextAdapter p = AuraImpl.getContextAdapter();
        assertFalse(p.isEstablished());
        contextService.startContext(Mode.DEV, Format.JSON, Authentication.AUTHENTICATED);
        assertTrue(p.isEstablished());
        assertNotNull(p.getCurrentContext());

        contextService.endContext();
        assertFalse(p.isEstablished());
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.