Search in sources :

Example 1 with JCenterDefaultRepositoryModel

use of com.android.tools.idea.gradle.dsl.model.repositories.JCenterDefaultRepositoryModel in project android by JetBrains.

the class BuildScriptModelTest method testParseRepositories.

public void testParseRepositories() throws IOException {
    String text = "buildscript {\n" + "  repositories {\n" + "    jcenter()\n" + "  }\n" + "}";
    writeToBuildFile(text);
    RepositoriesModel repositoriesModel = getGradleBuildModel().buildscript().repositories();
    List<RepositoryModel> repositories = repositoriesModel.repositories();
    assertThat(repositories).hasSize(1);
    RepositoryModel repositoryModel = repositories.get(0);
    assertTrue(repositoryModel instanceof JCenterDefaultRepositoryModel);
    JCenterDefaultRepositoryModel repository = (JCenterDefaultRepositoryModel) repositoryModel;
    assertEquals("name", "BintrayJCenter2", repository.name());
    assertEquals("url", "https://jcenter.bintray.com/", repository.url());
}
Also used : JCenterDefaultRepositoryModel(com.android.tools.idea.gradle.dsl.model.repositories.JCenterDefaultRepositoryModel) RepositoriesModel(com.android.tools.idea.gradle.dsl.model.repositories.RepositoriesModel) JCenterDefaultRepositoryModel(com.android.tools.idea.gradle.dsl.model.repositories.JCenterDefaultRepositoryModel) RepositoryModel(com.android.tools.idea.gradle.dsl.model.repositories.RepositoryModel)

Aggregations

JCenterDefaultRepositoryModel (com.android.tools.idea.gradle.dsl.model.repositories.JCenterDefaultRepositoryModel)1 RepositoriesModel (com.android.tools.idea.gradle.dsl.model.repositories.RepositoriesModel)1 RepositoryModel (com.android.tools.idea.gradle.dsl.model.repositories.RepositoryModel)1