Search in sources :

Example 1 with Language

use of com.jcabi.github.Language in project jcabi-github by jcabi.

the class MkRepo method languages.

@Override
public Iterable<Language> languages() {
    final List<Language> languages = new ArrayList<Language>(0);
    final int java = 999;
    languages.add(new RtLanguage("Java", java));
    final int php = 888;
    languages.add(new RtLanguage("PHP", php));
    final int ruby = 777;
    languages.add(new RtLanguage("Ruby", ruby));
    return languages;
}
Also used : Language(com.jcabi.github.Language) RtLanguage(com.jcabi.github.RtLanguage) ArrayList(java.util.ArrayList) RtLanguage(com.jcabi.github.RtLanguage)

Example 2 with Language

use of com.jcabi.github.Language in project jcabi-github by jcabi.

the class MkRepoTest method fetchLanguages.

/**
 * Repo can return Languages iterable.
 * @throws IOException if some problem inside
 */
@Test
public void fetchLanguages() throws IOException {
    final String user = "testuser4";
    final Repo repo = new MkRepo(new MkStorage.InFile(), user, new Coordinates.Simple(user, "testrepo4"));
    final Iterable<Language> languages = repo.languages();
    MatcherAssert.assertThat(languages, Matchers.notNullValue());
    MatcherAssert.assertThat(Lists.newArrayList(languages), Matchers.hasSize(Tv.THREE));
}
Also used : Repo(com.jcabi.github.Repo) Language(com.jcabi.github.Language) Coordinates(com.jcabi.github.Coordinates) Test(org.junit.Test)

Aggregations

Language (com.jcabi.github.Language)2 Coordinates (com.jcabi.github.Coordinates)1 Repo (com.jcabi.github.Repo)1 RtLanguage (com.jcabi.github.RtLanguage)1 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1