Package org.intellij.vcs.mks.sicommands

Source Code of org.intellij.vcs.mks.sicommands.APISandboxesCommandTest

package org.intellij.vcs.mks.sicommands;

import com.intellij.openapi.vcs.VcsException;
import junit.framework.TestCase;
import org.intellij.vcs.mks.CommandExecutionListener;
import org.intellij.vcs.mks.MKSAPIHelper;
import org.intellij.vcs.mks.MksCLIConfiguration;
import org.intellij.vcs.mks.sicommands.api.SandboxesCommandAPI;
import org.jetbrains.annotations.NotNull;

import java.util.ArrayList;
import java.util.List;

public class APISandboxesCommandTest extends TestCase {
    private SandboxesCommandAPI createCommand(final List<VcsException> errors, final MKSAPIHelper helper) {

        MksCLIConfiguration mksCLIConfiguration = new MksCLIConfiguration() {
            @NotNull
            public String getMksSiEncoding(final String command) {
                return null;
            }

            @NotNull
            public String getDatePattern() {
                return "MMM dd, yyyy - hh:mm a";
            }

            public CommandExecutionListener getCommandExecutionListener() {
                return CommandExecutionListener.IDLE;
            }

            public boolean isMks2007() {
                return false;
            }
        };
        return new SandboxesCommandAPI(errors, mksCLIConfiguration) {
            protected MKSAPIHelper getAPIHelper() {
                return helper;
            }
        };
    }

    @Override
    protected void setUp() throws Exception {
        super.setUp();
    }

    public void testIt() {
        ArrayList<VcsException> errors = new ArrayList<VcsException>();

        MKSAPIHelper helper = new MKSAPIHelper();
        helper.initComponent();
        SandboxesCommandAPI command;
        try {
            command = createCommand(errors, helper);
            command.execute();
        } finally {
            helper.disposeComponent();
        }
        for (SandboxInfo sandboxInfo : command.result) {
            System.out.println(sandboxInfo);
        }
    }
}
TOP

Related Classes of org.intellij.vcs.mks.sicommands.APISandboxesCommandTest

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.