use of org.eclipse.che.api.git.GitConnection in project che by eclipse.
the class TagListTest method testTagList.
@Test(dataProvider = "GitConnectionFactory", dataProviderClass = org.eclipse.che.git.impl.GitConnectionFactoryProvider.class)
public void testTagList(GitConnectionFactory connectionFactory) throws GitException, IOException {
GitConnection connection = connectToGitRepositoryWithContent(connectionFactory, repository);
connection.tagCreate(TagCreateParams.create("first-tag"));
connection.tagCreate(TagCreateParams.create("first-tag-other"));
connection.tagCreate(TagCreateParams.create("second-tag"));
assertTags(connection.tagList(null), "first-tag", "first-tag-other", "second-tag");
}
use of org.eclipse.che.api.git.GitConnection in project che by eclipse.
the class StatusTest method testAdded.
@Test(dataProvider = "GitConnectionFactory", dataProviderClass = org.eclipse.che.git.impl.GitConnectionFactoryProvider.class)
public void testAdded(GitConnectionFactory connectionFactory) throws Exception {
//given
GitConnection connection = connectToInitializedGitRepository(connectionFactory, repository);
addFile(connection, "a", "a content");
addFile(connection, "b", "b content");
addFile(connection, "c", "c content");
//add "a" and "b" files
connection.add(AddParams.create(ImmutableList.of("a", "b")));
//when
final Status status = connection.status(StatusFormat.SHORT);
//then
assertEquals(status.getAdded(), ImmutableList.of("a", "b"));
assertEquals(status.getUntracked(), ImmutableList.of("c"));
assertTrue(status.getChanged().isEmpty());
assertTrue(status.getConflicting().isEmpty());
assertTrue(status.getMissing().isEmpty());
assertTrue(status.getRemoved().isEmpty());
assertTrue(status.getUntrackedFolders().isEmpty());
}
use of org.eclipse.che.api.git.GitConnection in project che by eclipse.
the class StatusTest method testMissing.
@Test(dataProvider = "GitConnectionFactory", dataProviderClass = org.eclipse.che.git.impl.GitConnectionFactoryProvider.class)
public void testMissing(GitConnectionFactory connectionFactory) throws Exception {
//given
GitConnection connection = connectToInitializedGitRepository(connectionFactory, repository);
addFile(connection, "a", "content of a");
//add "a"
connection.add(AddParams.create(ImmutableList.of("a")));
//delete "a"
deleteFile(connection, "a");
//when
final Status status = connection.status(StatusFormat.SHORT);
//then
assertEquals(status.getMissing(), ImmutableList.of("a"));
assertEquals(status.getAdded(), ImmutableList.of("a"));
assertTrue(status.getChanged().isEmpty());
assertTrue(status.getConflicting().isEmpty());
assertTrue(status.getRemoved().isEmpty());
assertTrue(status.getUntracked().isEmpty());
assertTrue(status.getUntrackedFolders().isEmpty());
}
use of org.eclipse.che.api.git.GitConnection in project che by eclipse.
the class TagDeleteTest method testDeleteTag.
@Test(dataProvider = "GitConnectionFactory", dataProviderClass = org.eclipse.che.git.impl.GitConnectionFactoryProvider.class)
public void testDeleteTag(GitConnectionFactory connectionFactory) throws GitException, IOException {
//given
//create tags
GitConnection connection = connectToGitRepositoryWithContent(connectionFactory, repository);
connection.tagCreate(TagCreateParams.create("first-tag"));
connection.tagCreate(TagCreateParams.create("second-tag"));
List<Tag> tags = connection.tagList(null);
assertTrue(tagExists(tags, "first-tag"));
assertTrue(tagExists(tags, "second-tag"));
//when
//delete first-tag
connection.tagDelete("first-tag");
//then
//check not exists more
tags = connection.tagList(null);
assertFalse(tagExists(tags, "first-tag"));
assertTrue(tagExists(tags, "second-tag"));
}
use of org.eclipse.che.api.git.GitConnection in project che by eclipse.
the class TagListTest method testTagListPattern.
@Test(dataProvider = "GitConnectionFactory", dataProviderClass = org.eclipse.che.git.impl.GitConnectionFactoryProvider.class)
public void testTagListPattern(GitConnectionFactory connectionFactory) throws GitException, IOException {
GitConnection connection = connectToGitRepositoryWithContent(connectionFactory, repository);
connection.tagCreate(TagCreateParams.create("first-tag"));
connection.tagCreate(TagCreateParams.create("first-tag-other"));
connection.tagCreate(TagCreateParams.create("second-tag"));
assertTags(connection.tagList("first*"), "first-tag", "first-tag-other");
}
Aggregations