当前位置: 首页>>代码示例>>Java>>正文


Java Gist.setDescription方法代码示例

本文整理汇总了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));
}
 
开发者ID:vromero,项目名称:gist-maven-plugin,代码行数:18,代码来源:GistContentComparatorTest.java

示例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));
}
 
开发者ID:vromero,项目名称:gist-maven-plugin,代码行数:21,代码来源:GistContentComparatorTest.java

示例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));
}
 
开发者ID:vromero,项目名称:gist-maven-plugin,代码行数:23,代码来源:GistContentComparatorTest.java

示例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));
}
 
开发者ID:vromero,项目名称:gist-maven-plugin,代码行数:23,代码来源:GistContentComparatorTest.java

示例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()));
}
 
开发者ID:vromero,项目名称:gist-maven-plugin,代码行数:24,代码来源:DescriptionGistCorrelationStrategyTest.java

示例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);
}
 
开发者ID:huibinfeng0810,项目名称:github-v2,代码行数:14,代码来源:CreateGistTask.java

示例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;
    }
}
 
开发者ID:huibinfeng0810,项目名称:github-v2,代码行数:21,代码来源:GistStore.java

示例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));
}
 
开发者ID:vromero,项目名称:gist-maven-plugin,代码行数:11,代码来源:GistContentComparatorTest.java

示例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));
}
 
开发者ID:vromero,项目名称:gist-maven-plugin,代码行数:11,代码来源:NoneGistCorrelationStrategyTest.java

示例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);
}
 
开发者ID:vromero,项目名称:gist-maven-plugin,代码行数:12,代码来源:GistUploaderTest.java

示例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);
}
 
开发者ID:vromero,项目名称:gist-maven-plugin,代码行数:16,代码来源:GistUploaderTest.java

示例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);
}
 
开发者ID:vromero,项目名称:gist-maven-plugin,代码行数:16,代码来源:GistUploaderTest.java


注:本文中的org.eclipse.egit.github.core.Gist.setDescription方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。