Example usage for org.eclipse.jgit.junit MockSystemReader MockSystemReader

List of usage examples for org.eclipse.jgit.junit MockSystemReader MockSystemReader

Introduction

In this page you can find the example usage for org.eclipse.jgit.junit MockSystemReader MockSystemReader.

Prototype

public MockSystemReader() 

Source Link

Document

Constructor for MockSystemReader

Usage

From source file:org.eclipse.egit.core.GitMoveDeleteHookTest.java

License:Open Source License

@Before
public void setUp() throws Exception {
    Activator.getDefault().getRepositoryCache().clear();
    MockSystemReader mockSystemReader = new MockSystemReader();
    SystemReader.setInstance(mockSystemReader);
    mockSystemReader.setProperty(Constants.GIT_CEILING_DIRECTORIES_KEY,
            ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile().getAbsoluteFile().toString());
    workspaceSupplement = testUtils.createTempDir("wssupplement");
    workspace = ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile().getAbsoluteFile();
}

From source file:org.eclipse.egit.core.test.GitTestCase.java

License:Open Source License

@Before
public void setUp() throws Exception {
    // ensure there are no shared Repository instances left
    // when starting a new test
    Activator.getDefault().getRepositoryCache().clear();
    MockSystemReader mockSystemReader = new MockSystemReader();
    SystemReader.setInstance(mockSystemReader);
    mockSystemReader.setProperty(Constants.GIT_CEILING_DIRECTORIES_KEY,
            ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile().getAbsoluteFile().toString());
    project = new TestProject(true);
    gitDir = new File(project.getProject().getWorkspace().getRoot().getRawLocation().toFile(),
            Constants.DOT_GIT);/*  w  w  w  .j ava2  s .  c  o m*/
    if (gitDir.exists())
        FileUtils.delete(gitDir, FileUtils.RECURSIVE | FileUtils.RETRY);
}

From source file:org.eclipse.egit.ui.wizards.share.SharingWizardTest.java

License:Open Source License

@BeforeClass
public static void beforeClass() throws Exception {

    MockSystemReader mockSystemReader = new MockSystemReader();
    SystemReader.setInstance(mockSystemReader);
    mockSystemReader.setProperty(Constants.GIT_CEILING_DIRECTORIES_KEY,
            ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile().getAbsoluteFile().toString());

    if (bot.activeView().getTitle().equals("Welcome"))
        bot.viewByTitle("Welcome").close();
    bot.perspectiveById("org.eclipse.jdt.ui.JavaPerspective").activate();
    bot.viewByTitle("Package Explorer").show();

    bot.menu("File").menu("New").menu("Project...").click();
    bot.tree().getTreeItem("General").expand().getNode("Project").select();
    bot.button("Next >").click();

    bot.textWithLabel("Project name:").setText(projectName);

    bot.button("Finish").click();
    ResourcesPlugin.getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE, null);
}

From source file:org.springframework.cloud.config.server.BootstrapConfigServerIntegrationTests.java

License:Apache License

@BeforeClass
public static void init() throws IOException {
    // mock Git configuration to make tests independent of local Git configuration
    SystemReader.setInstance(new MockSystemReader());

    ConfigServerTestUtils.prepareLocalRepo("encrypt-repo");
}

From source file:org.springframework.cloud.config.server.ConfigClientOffIntegrationTests.java

License:Apache License

@BeforeClass
public static void init() throws IOException {
    // mock Git configuration to make tests independent of local Git configuration
    SystemReader.setInstance(new MockSystemReader());

    ConfigServerTestUtils.prepareLocalRepo();
}

From source file:org.springframework.cloud.config.server.ConfigClientOnIntegrationTests.java

License:Apache License

@BeforeClass
public static void init() throws IOException {
    // mock Git configuration to make tests independent of local Git configuration
    SystemReader.setInstance(new MockSystemReader());

    localRepo = ConfigServerTestUtils.prepareLocalRepo();
}

From source file:org.springframework.cloud.config.server.environment.MultipleJGitEnvironmentApplicationPlaceholderRepositoryTests.java

License:Apache License

@BeforeClass
public static void initClass() {
    // mock Git configuration to make tests independent of local Git configuration
    SystemReader.setInstance(new MockSystemReader());
}