本文整理汇总了Java中org.eclipse.egit.github.core.Gist.setDescription方法的典型用法代码示例。如果您正苦于以下问题:Java Gist.setDescription方法的具体用法?Java Gist.setDescription怎么用?Java Gist.setDescription使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.egit.github.core.Gist
的用法示例。
在下文中一共展示了Gist.setDescription方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fileSizeDifferTest
import org.eclipse.egit.github.core.Gist; //导入方法依赖的package包/类
@Test
public void fileSizeDifferTest() {
org.eclipse.egit.github.core.Gist original = new org.eclipse.egit.github.core.Gist();
Gist candidate = new Gist();
original.setDescription("QWERTY");
candidate.setDescription("QWERTY");
GistFile originalFile = new GistFile();
Map<String, GistFile> originalFiles = new HashMap<String, GistFile>();
originalFiles.put("asdf.txt", originalFile);
original.setFiles(originalFiles);
candidate.setFiles(new HashMap<String, GistFile>());
Assert.assertTrue(comparator.isUpdateNeeded(original, candidate));
}
示例2: fileNameDifferTest
import org.eclipse.egit.github.core.Gist; //导入方法依赖的package包/类
@Test
public void fileNameDifferTest() {
org.eclipse.egit.github.core.Gist original = new org.eclipse.egit.github.core.Gist();
Gist candidate = new Gist();
original.setDescription("QWERTY");
candidate.setDescription("QWERTY");
GistFile originalFile = new GistFile();
Map<String, GistFile> originalFiles = new HashMap<String, GistFile>();
originalFiles.put("asdf.txt", originalFile);
original.setFiles(originalFiles);
GistFile candidateFile = new GistFile();
Map<String, GistFile> candidateFiles = new HashMap<String, GistFile>();
candidateFiles.put("zxcv.txt", candidateFile);
candidate.setFiles(candidateFiles);
Assert.assertTrue(comparator.isUpdateNeeded(original, candidate));
}
示例3: fileContentDifferTest
import org.eclipse.egit.github.core.Gist; //导入方法依赖的package包/类
@Test
public void fileContentDifferTest() {
org.eclipse.egit.github.core.Gist original = new org.eclipse.egit.github.core.Gist();
Gist candidate = new Gist();
original.setDescription("QWERTY");
candidate.setDescription("QWERTY");
GistFile originalFile = new GistFile();
originalFile.setContent("asdf");
Map<String, GistFile> originalFiles = new HashMap<String, GistFile>();
originalFiles.put("asdf.txt", originalFile);
original.setFiles(originalFiles);
GistFile candidateFile = new GistFile();
candidateFile.setContent("zxcv");
Map<String, GistFile> candidateFiles = new HashMap<String, GistFile>();
candidateFiles.put("asdf.txt", candidateFile);
candidate.setFiles(candidateFiles);
Assert.assertTrue(comparator.isUpdateNeeded(original, candidate));
}
示例4: nothingDiffersTest
import org.eclipse.egit.github.core.Gist; //导入方法依赖的package包/类
@Test
public void nothingDiffersTest() {
org.eclipse.egit.github.core.Gist original = new org.eclipse.egit.github.core.Gist();
Gist candidate = new Gist();
original.setDescription("QWERTY");
candidate.setDescription("QWERTY");
GistFile originalFile = new GistFile();
originalFile.setContent("asdf");
Map<String, GistFile> originalFiles = new HashMap<String, GistFile>();
originalFiles.put("asdf.txt", originalFile);
original.setFiles(originalFiles);
GistFile candidateFile = new GistFile();
candidateFile.setContent("asdf");
Map<String, GistFile> candidateFiles = new HashMap<String, GistFile>();
candidateFiles.put("asdf.txt", candidateFile);
candidate.setFiles(candidateFiles);
Assert.assertFalse(comparator.isUpdateNeeded(original, candidate));
}
示例5: testGistOnValidCorrelation
import org.eclipse.egit.github.core.Gist; //导入方法依赖的package包/类
@Test
public void testGistOnValidCorrelation() {
Gist candidate = new Gist();
candidate.setDescription("valid description");
Gist element1 = new Gist();
element1.setId("element1");
element1.setDescription("different description");
Gist element2 = new Gist();
element2.setId("element2");
element2.setDescription("valid description");
List<Gist> userGists = new ArrayList<Gist>();
userGists.add(element1);
userGists.add(element2);
Gist correlated = strategy.correlate(candidate, userGists);
Assert.assertNotNull(correlated);
assertThat(correlated, instanceOf(Gist.class));
assertThat(correlated.getId(), is(element2.getId()));
}
示例6: run
import org.eclipse.egit.github.core.Gist; //导入方法依赖的package包/类
@Override
public Gist run(Account account) throws Exception {
Gist gist = new Gist();
gist.setDescription(description);
gist.setPublic(isPublic);
GistFile file = new GistFile();
file.setContent(content);
file.setFilename(name);
gist.setFiles(Collections.singletonMap(name, file));
return service.createGist(gist);
}
示例7: addGist
import org.eclipse.egit.github.core.Gist; //导入方法依赖的package包/类
/**
* Add gist to store
*
* @param gist
* @return gist
*/
public Gist addGist(Gist gist) {
Gist current = getGist(gist.getId());
if (current != null) {
current.setComments(gist.getComments());
current.setDescription(gist.getDescription());
current.setFiles(sortFiles(gist));
current.setUpdatedAt(gist.getUpdatedAt());
return current;
} else {
gist.setFiles(sortFiles(gist));
gists.put(gist.getId(), gist);
return gist;
}
}
示例8: descriptionDifferTest
import org.eclipse.egit.github.core.Gist; //导入方法依赖的package包/类
@Test
public void descriptionDifferTest() {
Gist original = new Gist();
Gist candidate = new Gist();
original.setDescription("QWERTY");
candidate.setDescription("ZXCVB");
Assert.assertTrue(comparator.isUpdateNeeded(original, candidate));
}
示例9: testNullValidCorrelation
import org.eclipse.egit.github.core.Gist; //导入方法依赖的package包/类
@Test
public void testNullValidCorrelation() {
Gist candidate = new Gist();
candidate.setDescription("valid description");
List<Gist> userGists = new ArrayList<Gist>();
userGists.add(candidate);
Assert.assertNull(strategy.correlate(candidate, userGists));
}
示例10: uploadGistNoCorrelatedTest
import org.eclipse.egit.github.core.Gist; //导入方法依赖的package包/类
@Test
public void uploadGistNoCorrelatedTest() throws IOException {
when(correlationStrategy.correlate(any(Gist.class), any(List.class))).thenReturn(null);
Gist gist = new Gist();
gist.setDescription("QWERTY");
uploader.uploadGist(gist, correlationStrategy );
verify(service, atLeastOnce()).createGist(gist);
}
示例11: uploadGistCorrelatedTestWithUpdate
import org.eclipse.egit.github.core.Gist; //导入方法依赖的package包/类
@Test
public void uploadGistCorrelatedTestWithUpdate() throws IOException {
Gist gistCorrelated = new Gist();
gistCorrelated.setDescription("QWERTY");
when(correlationStrategy.correlate(any(Gist.class), any(List.class))).thenReturn(gistCorrelated);
when(comparator.isUpdateNeeded(any(Gist.class), any(Gist.class))).thenReturn(true);
uploader.setComparator(comparator);
Gist gist = new Gist();
gist.setDescription("QWERTY");
uploader.uploadGist(gist, correlationStrategy );
verify(service, atLeastOnce()).updateGist(gist);
}
示例12: uploadGistCorrelatedTestWithoutUpdate
import org.eclipse.egit.github.core.Gist; //导入方法依赖的package包/类
@Test
public void uploadGistCorrelatedTestWithoutUpdate() throws IOException {
Gist gistCorrelated = new Gist();
gistCorrelated.setDescription("QWERTY");
when(correlationStrategy.correlate(any(Gist.class), any(List.class))).thenReturn(gistCorrelated);
when(comparator.isUpdateNeeded(any(Gist.class), any(Gist.class))).thenReturn(false);
uploader.setComparator(comparator);
Gist gist = new Gist();
gist.setDescription("QWERTY");
uploader.uploadGist(gist, correlationStrategy );
verify(service, never()).updateGist(gist);
}