Examples of ScriptUtil


Examples of org.rhq.bindings.util.ScriptUtil

public class ScriptUtilTest {

    @Test
    public void getFileBytes() {
        ScriptUtil scriptUtil = new ScriptUtil(null);

        try {
            String fileContents = "the rain in spain falls mainly on the plain";
            String tempDir = System.getProperty("java.io.tmpdir");
            File testFile = new File(tempDir, "getFileBytesTest.txt");
            byte[] contentBytes = fileContents.getBytes();
            FileOutputStream writer = new FileOutputStream(testFile);
            writer.write(contentBytes);
            writer.close();
            System.out.println("Test data written to " + testFile.getAbsolutePath());

            byte[] fileBytes = scriptUtil.getFileBytes(testFile.getAbsolutePath());
            String results = new String(fileBytes);

            System.out.println("Wrote: \"" + fileContents + "\"\nRead:  \"" + results + "\"");
            assert fileContents.equals(results) : "Wrote: \"" + fileContents + "\"\nRead:  \"" + results + "\"";
        } catch (IOException ioe) {
View Full Code Here

Examples of org.rhq.bindings.util.ScriptUtil

            }
            managers.clear();
        }

        //script utils can handle a null facade
        put(SCRIPT_UTIL, new ScriptUtil(rhqFacade));

        if (rhqFacade != null) {
            managers = rhqFacade.getScriptingAPI();

            put(SUBJECT, rhqFacade.getSubject());
View Full Code Here

Examples of org.uengine.kernel.ScriptUtil

      instance = ProcessInstance.create((ProcessDefinition)pd.getProcessDefinitionDesigner().getActivity(), "test instance", null);
         
      org.apache.bsf.BSFManager manager = super.createBSFManager();
      manager.declareBean("instance", instance, ProcessInstance.class);
      manager.declareBean("activity", new ScriptActivity(), Activity.class);
      manager.declareBean("util", new ScriptUtil(), ScriptUtil.class);
         
      return manager;
   
View Full Code Here

Examples of org.uengine.kernel.ScriptUtil

    instance = ProcessInstance.create(pd, "test instance", null);
         
    org.apache.bsf.BSFManager manager = super.createBSFManager();
    manager.declareBean("instance", instance, ProcessInstance.class);
    manager.declareBean("activity", new DefaultActivity(), Activity.class);
    manager.declareBean("util", new ScriptUtil(), ScriptUtil.class);
         
    return manager;
 
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.