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

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

Introduction

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

Prototype

public void setProperty(String key, String value) 

Source Link

Document

Set a property

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);//from w w  w .  j  a v  a2 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);
}