Package com.asakusafw.windgate.core.process

Examples of com.asakusafw.windgate.core.process.ProcessProfile


     * Attempts to convert profile with invalid component provider class.
     * @throws Exception if failed
     */
    @Test
    public void convert_component_unknown() throws Exception {
        ProcessProfile profile = profile(
                KEY_RETRY_COUNT, "1",
                KEY_COMPONENT, "__UNKNOWN__");
        try {
            RetryableProcessProfile.convert(profile);
            fail();
View Full Code Here


     * Attempts to convert profile with invalid component provider class.
     * @throws Exception if failed
     */
    @Test
    public void convert_component_invalid() throws Exception {
        ProcessProfile profile = profile(
                KEY_RETRY_COUNT, "1",
                KEY_COMPONENT, String.class.getName());
        try {
            RetryableProcessProfile.convert(profile);
            fail();
View Full Code Here

     * Attempts to convert profile with invalid component provider class.
     * @throws Exception if failed
     */
    @Test
    public void convert_component_failed() throws Exception {
        ProcessProfile profile = profile(
                KEY_RETRY_COUNT, "1",
                KEY_COMPONENT, InvalidProcess.class.getName());
        try {
            RetryableProcessProfile.convert(profile);
            fail();
View Full Code Here

            // ok.
        }
    }

    private ProcessProfile profile(String... conf) {
        ProcessProfile profile = new ProcessProfile(
                "dummy",
                RetryableProcessProvider.class,
                ProfileContext.system(getClass().getClassLoader()),
                map(conf));
        return profile;
View Full Code Here

     * normal run.
     * @throws Exception if failed
     */
    @Test
    public void execute_simple() throws Exception {
        ProcessProfile profile = profile(2, Action.SUCCESS);
        ProcessProvider provider = profile.createProvider();
        provider.execute(factory(), script());
    }
View Full Code Here

     * retry once.
     * @throws Exception if failed
     */
    @Test
    public void execute_retry1() throws Exception {
        ProcessProfile profile = profile(2, Action.EXCEPTION, Action.SUCCESS);
        ProcessProvider provider = profile.createProvider();
        provider.execute(factory(), script());
    }
View Full Code Here

     * retry twice.
     * @throws Exception if failed
     */
    @Test
    public void execute_retry2() throws Exception {
        ProcessProfile profile = profile(2, Action.EXCEPTION, Action.EXCEPTION, Action.SUCCESS);
        ProcessProvider provider = profile.createProvider();
        provider.execute(factory(), script());
    }
View Full Code Here

     * retry over.
     * @throws Exception if failed
     */
    @Test
    public void execute_retry_over() throws Exception {
        ProcessProfile profile = profile(2, Action.EXCEPTION, Action.EXCEPTION, Action.EXCEPTION, Action.SUCCESS);
        ProcessProvider provider = profile.createProvider();
        try {
            provider.execute(factory(), script());
            fail();
        } catch (IOException e) {
            // ok.
View Full Code Here

     * interrupted.
     * @throws Exception if failed
     */
    @Test
    public void execute_interrupted() throws Exception {
        ProcessProfile profile = profile(2, Action.INTERRUPT, Action.SUCCESS);
        ProcessProvider provider = profile.createProvider();
        try {
            provider.execute(factory(), script());
            fail();
        } catch (IOException e) {
            // ok.
View Full Code Here

     * retry with interval.
     * @throws Exception if failed
     */
    @Test
    public void execute_retry_interval() throws Exception {
        ProcessProfile profile = profile(2, 1, Action.EXCEPTION, Action.EXCEPTION, Action.SUCCESS);
        ProcessProvider provider = profile.createProvider();

        long start = System.currentTimeMillis();
        provider.execute(factory(), script());
        long end = System.currentTimeMillis();

View Full Code Here

TOP

Related Classes of com.asakusafw.windgate.core.process.ProcessProfile

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.