use of com.android.tools.idea.gradle.project.model.AndroidModuleModel in project android by JetBrains.
the class LayoutRenderingIssueValidationStrategyTest method mockAndroidModel.
@NotNull
private static AndroidModuleModel mockAndroidModel(@NotNull GradleVersion version, boolean hasLayoutRenderingIssue) {
AndroidModelFeatures features = mock(AndroidModelFeatures.class);
when(features.isLayoutRenderingIssuePresent()).thenReturn(hasLayoutRenderingIssue);
AndroidModuleModel androidModel = mock(AndroidModuleModel.class);
when(androidModel.getFeatures()).thenReturn(features);
when(androidModel.getModelVersion()).thenReturn(version);
return androidModel;
}
use of com.android.tools.idea.gradle.project.model.AndroidModuleModel in project android by JetBrains.
the class AndroidModuleValidatorImplTest method validate.
@Test
public void validate() {
Module module = mock(Module.class);
AndroidModuleModel androidModel = mock(AndroidModuleModel.class);
myValidator.validate(module, androidModel);
verify(myStrategy1, times(1)).validate(module, androidModel);
verify(myStrategy2, times(1)).validate(module, androidModel);
}
use of com.android.tools.idea.gradle.project.model.AndroidModuleModel in project android by JetBrains.
the class BuildTools23Rc1ValidationStrategyTest method testValidateWithPlugin1Dot3.
public void testValidateWithPlugin1Dot3() {
AndroidModuleModel androidModel = mockAndroidModel("1.3", 3);
Module module = mock(Module.class);
myStrategy.validate(module, androidModel);
assertThat(myStrategy.getModules()).isEmpty();
verify(myBuildToolsVersionReader, never()).getBuildToolsVersion(module);
}
use of com.android.tools.idea.gradle.project.model.AndroidModuleModel in project android by JetBrains.
the class EncodingValidationStrategyTest method testValidate.
public void testValidate() {
String modelEncoding = "UTF-8";
AndroidModuleModel androidModel = mock(AndroidModuleModel.class);
when(androidModel.getModelVersion()).thenReturn(GradleVersion.parse("1.2.0"));
AndroidProjectStub androidProject = new AndroidProjectStub("app");
androidProject.getJavaCompileOptions().setEncoding(modelEncoding);
when(androidModel.getAndroidProject()).thenReturn(androidProject);
myStrategy.validate(mock(Module.class), androidModel);
assertEquals(modelEncoding, myStrategy.getMismatchingEncoding());
}
use of com.android.tools.idea.gradle.project.model.AndroidModuleModel in project android by JetBrains.
the class ExtraGeneratedFolderValidationStrategyTest method mockAndroidModel.
@NotNull
private static AndroidModuleModel mockAndroidModel(@NotNull File[] extraFolderPaths) {
AndroidModuleModel androidModel = mock(AndroidModuleModel.class);
when(androidModel.getExtraGeneratedSourceFolderPaths()).thenReturn(extraFolderPaths);
return androidModel;
}
Aggregations