use of org.eclipse.egit.ui.wizards.clone.SampleTestRepository in project egit by eclipse.
the class PushTest method setup.
@Before
public void setup() throws Exception {
TestUtil.disableProxy();
remoteRepository = new SampleTestRepository(NUMBER_RANDOM_COMMITS, true);
localRepoPath = new File(ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile(), "test" + System.nanoTime());
String branch = Constants.R_HEADS + SampleTestRepository.FIX;
CloneOperation cloneOperation = new CloneOperation(new URIish(remoteRepository.getUri()), true, null, localRepoPath, branch, "origin", 30);
cloneOperation.setCredentialsProvider(new UsernamePasswordCredentialsProvider("agitter", "letmein"));
cloneOperation.run(new NullProgressMonitor());
file = new File(localRepoPath, SampleTestRepository.A_txt_name);
assertTrue(file.exists());
localRepository = Activator.getDefault().getRepositoryCache().lookupRepository(new File(localRepoPath, ".git"));
assertNotNull(localRepository);
}
Aggregations