Package org.openquark.cal.runtime

Examples of org.openquark.cal.runtime.ExecutionContextProperties$Builder


   
    private void help_testGetProperty(BasicCALServices calServices, String propKey, Object propValue) throws CALExecutorException, GemCompilationException {
       
        ExecutionContextProperties.Builder propBuilder = new ExecutionContextProperties.Builder();
        propBuilder.setProperty(propKey, propValue);
        ExecutionContextProperties properties = propBuilder.toProperties();
        ExecutionContext ec = calServices.getWorkspaceManager().makeExecutionContext(properties);
       
        assertSame(propValue, calServices.runFunction(EntryPointSpec.make(CAL_System.Functions.getProperty), ec, new Object[] { propKey }));
       
        assertEquals(Boolean.TRUE, calServices.runFunction(EntryPointSpec.make(CAL_System.Functions.hasProperty), ec, new Object[] { propKey }));
View Full Code Here


    }
   
    private void help_testCurrentLocale(BasicCALServices calServices, Locale locale) throws CALExecutorException, GemCompilationException {
        ExecutionContextProperties.Builder propBuilder = new ExecutionContextProperties.Builder();
        propBuilder.setLocale(locale);
        ExecutionContextProperties properties = propBuilder.toProperties();
        ExecutionContext ec = calServices.getWorkspaceManager().makeExecutionContext(properties);
       
        assertSame(locale, calServices.runFunction(EntryPointSpec.make(CAL_System.Functions.getProperty), ec, new Object[] { ExecutionContextProperties.SYS_PROP_KEY_LOCALE }));
    }
View Full Code Here

    }
   
    private void help_testCurrentTimeZone(BasicCALServices calServices, TimeZone timeZone) throws CALExecutorException, GemCompilationException {       
        ExecutionContextProperties.Builder propBuilder = new ExecutionContextProperties.Builder();
        propBuilder.setTimeZone(timeZone.getID());
        ExecutionContextProperties properties = propBuilder.toProperties();
        ExecutionContext ec = calServices.getWorkspaceManager().makeExecutionContext(properties);
       
        final java.util.TimeZone propertyValue = (java.util.TimeZone)calServices.runFunction(EntryPointSpec.make(CAL_System.Functions.getProperty), ec, new Object[] {ExecutionContextProperties.SYS_PROP_KEY_TIMEZONE});
        assertEquals(timeZone, TimeZone.getInstance(propertyValue.getID()));
    }
View Full Code Here

       
        TestCleanable hook = new TestCleanable();
       
        ExecutionContextProperties.Builder propBuilder = new ExecutionContextProperties.Builder();
        propBuilder.setProperty("hook", hook);
        ExecutionContextProperties properties = propBuilder.toProperties();
        ExecutionContext executionContext = calServices.getWorkspaceManager().makeExecutionContext(properties);
       
        EntryPoint entryPoint = calServices.getCompiler().getEntryPoint(
            new AdjunctSource.FromText("private tempFunc = System.registerCleanable ((input (System.getProperty \"hook\")) :: Cleanable);"),
            EntryPointSpec.make(QualifiedName.make(CAL_System.MODULE_NAME, "tempFunc")),
View Full Code Here

    /**
     * @return a ExecutionContextProperties instance encapsulating the default values for the execution context's properties.
     */
    private ExecutionContextProperties makeDefaultExectionContextProperties() {
        ExecutionContextProperties.Builder propertiesBuilder = new ExecutionContextProperties.Builder();
        ExecutionContextProperties defaultProperties = propertiesBuilder.toProperties();
        return defaultProperties;
    }
View Full Code Here

TOP

Related Classes of org.openquark.cal.runtime.ExecutionContextProperties$Builder

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.