class Application {

    public static void main(String[] args) {
        Integer serverPort = PORT;
        try {
            if (args.length > 0) {
                serverPort = Integer.valueOf(args[0]);
            }
        } catch (NumberFormatException e) {
            LOGGER.error("Error in input parameters");
        }
        // 初始化采集器配置文件
        EngineContext.applicationInitialization();
        // 采集器内置解析规则等初始化
        EngineContext.componentsInitialization();
        // 生成source、channel、sink，
        // 持有所有组件生命周期
        AgentComponent.init();
        // 启动Server
        HttpServerManager.start(serverPort);

    }

}

class ApplicationTest {

    @Test
    public void applicationTest() throws InterruptedException {

        String[] args = new String[]{"F:\\github\\dcsec-collector-engine\\engine-bootstrap\\src\\test\\resources\\application.properties"};

        Application.main(args);
        Thread.sleep(1000000000);
    }

}