package net.northking.cctp.element.basic;

import net.northking.cctp.element.core.IExecuteContext;
import net.northking.cctp.element.core.Library;
import net.northking.cctp.element.scanner.JarLibraryScanner;
import net.northking.cctp.element.test.SampleExecuteContext;

/**
 * ScanTest
 *
 * @author fengxiang.zhang
 * @since 1.0
 */
public class ScanTest {

    public static void main(String[] args) throws Exception {
        Library library = JarLibraryScanner.scan("C:\\IdeaWorkspace\\三端合一\\cctp-test-element\\cctp-test-element-library\\cctp-test-element-basic\\target\\cctp-test-element-basic-3.0-SNAPSHOT-jar-with-dependencies.jar");
        IExecuteContext context = new SampleExecuteContext.Builder()
                .putVariable("var", "1", "number")
                .putGlobalVariable("var", "2", "number")
                .putVariable("var1", "1abc", "string")
                .putStepArg("object", "#{var} + 1 + ${var}")
                .putOutPut("result", "result")
                .build();
        Object result = library.runKeyword("assign", context);
        System.out.println(result);

    }
}
