Package org.auraframework.test

Examples of org.auraframework.test.TestContext


        tcds = filterTestCases(test);

        TestContextAdapter contextAdapter = Aura.get(TestContextAdapter.class);
        if (contextAdapter != null) {
            for (TestCaseDef tcd : tcds) {
                TestContext testContext = contextAdapter.getTestContext(tcd.getDescriptor().getQualifiedName());
                testContext.getLocalDefs().clear();
                testContext.getLocalDefs().addAll(tcd.getLocalDefs());
            }
        }
    }
View Full Code Here


                json.writeMap(loadedStrings);
            }

            TestContextAdapter testContextAdapter = Aura.get(TestContextAdapter.class);
            if (testContextAdapter != null) {
                TestContext testContext = testContextAdapter.getTestContext();
                if (testContext != null) {
                    json.writeMapEntry("test", testContext.getName());
                }
            }

            if (ctx.getFrameworkUID() != null) {
                json.writeMapEntry("fwuid", ctx.getFrameworkUID());
View Full Code Here

     */
    public <D extends Definition> void mockDef(@SuppressWarnings("unchecked") D... mockDefs) throws Exception {
        if (mockDefs != null && mockDefs.length > 0) {
            TestContextAdapter testContextAdapter = Aura
                    .get(TestContextAdapter.class);
            TestContext testContext = testContextAdapter.getTestContext();
            if (testContext == null) {
                throw new IllegalStateException(
                        "TestContext not established; use TestContextAdapter.getTestContext(String).");
            }
            Set<Definition> mocks = testContext.getLocalDefs();
            if (mocks != null) {
                mocks.addAll(Arrays.asList(mockDefs));
                AuraTestingUtil.clearCachedDefs(mocks);
            }
        }
View Full Code Here

    private static Map<TestContext, Integer> counters = Maps.newHashMap();

    public TestReinitializeModelWithCount() throws QuickFixException {
        super();
        //increase the corresponding counter by 1 if it exist, if not, create it
        TestContext testContext = getContextAdapter();
        Integer c = counters.get(testContext);
        if(c!=null && c>=0) {
            c = c+1;
            counters.put(testContext, c);
        } else {
View Full Code Here

        TestContextAdapter testContextAdapter = Aura.get(TestContextAdapter.class);
        return testContextAdapter.getTestContext();
    }
   
    public static int getCount() {
        TestContext testContext = getContextAdapter();
        Integer c = counters.get(testContext);
        if(c!=null && c>=0) {
            return c;
        } else {
            return -1;
View Full Code Here

            return -1;
        }
    }
   
    public static void clearCount() {
        TestContext testContext = getContextAdapter();
        counters.put(testContext, 0);
    }
View Full Code Here

        // Check for any local defs with this namespace and consider that as an indicator that we have a privileged
        // namespace
        if (namespace != null) {
            TestContextAdapter testContextAdapter = Aura.get(TestContextAdapter.class);
            if (testContextAdapter != null) {
                TestContext testContext = testContextAdapter.getTestContext();
                if (testContext != null) {
                    Set<Definition> localDefs = testContext.getLocalDefs();
                    for (Definition def : localDefs) {
                      DefDescriptor<? extends Definition> defDescriptor = def.getDescriptor();
                      if(defDescriptor!=null) {
                          String ns = defDescriptor.getNamespace();
                          if (namespace.equalsIgnoreCase(ns)) {
View Full Code Here

                }
                if (testName == null) {
                    testName = test.get(request);
                }
                if (testName != null) {
                    TestContext testContext = testContextAdapter.getTestContext(testName);
                    if (testContext != null) {
                        MasterDefRegistry registry = context.getDefRegistry();
                        Set<Definition> mocks = testContext.getLocalDefs();
                        if (mocks != null) {
                            boolean doReset = testReset.get(request);
                            for (Definition def : mocks) {
                                if (doReset && def instanceof Resettable) {
                                    ((Resettable) def).reset();
View Full Code Here

TOP

Related Classes of org.auraframework.test.TestContext

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.