use of com.android.tools.idea.gradle.project.sync.messages.SyncMessage in project android by JetBrains.
the class LayoutRenderingIssueValidationStrategyTest method testFixAndReportFoundIssues.
// See https://code.google.com/p/android/issues/detail?id=170841
public void testFixAndReportFoundIssues() {
SyncMessagesStub syncMessages = SyncMessagesStub.replaceSyncMessagesService(getProject());
myStrategy.setModelVersion(GradleVersion.parse("1.2.0"));
myStrategy.fixAndReportFoundIssues();
SyncMessage message = syncMessages.getFirstReportedMessage();
assertNotNull(message);
String[] text = message.getText();
assertThat(text).isNotEmpty();
assertThat(text[0]).startsWith("Using an obsolete version of the Gradle plugin (1.2.0)");
}
use of com.android.tools.idea.gradle.project.sync.messages.SyncMessage in project android by JetBrains.
the class LayoutRenderingIssueValidationStrategyTest method testFixAndReportFoundIssuesWithNoIssues.
public void testFixAndReportFoundIssuesWithNoIssues() {
SyncMessagesStub syncMessages = SyncMessagesStub.replaceSyncMessagesService(getProject());
myStrategy.setModelVersion(null);
myStrategy.fixAndReportFoundIssues();
SyncMessage message = syncMessages.getFirstReportedMessage();
assertNull(message);
}
use of com.android.tools.idea.gradle.project.sync.messages.SyncMessage in project android by JetBrains.
the class BuildTools23Rc1ValidationStrategyTest method testFixAndReportFoundIssues.
public void testFixAndReportFoundIssues() {
Project project = getProject();
SyncMessagesStub syncMessages = SyncMessagesStub.replaceSyncMessagesService(project);
myStrategy.getModules().add("app");
myStrategy.fixAndReportFoundIssues();
SyncMessage message = syncMessages.getFirstReportedMessage();
assertNotNull(message);
String[] text = message.getText();
assertThat(text).isNotEmpty();
assertThat(text[0]).startsWith("Build Tools 23.0.0 rc1 is <b>deprecated</b>");
}
use of com.android.tools.idea.gradle.project.sync.messages.SyncMessage in project android by JetBrains.
the class BuildTools23Rc1ValidationStrategyTest method testFixAndReportFoundIssuesWithNoIssues.
public void testFixAndReportFoundIssuesWithNoIssues() {
Project project = getProject();
SyncMessagesStub syncMessages = SyncMessagesStub.replaceSyncMessagesService(project);
myStrategy.getModules().clear();
myStrategy.fixAndReportFoundIssues();
SyncMessage message = syncMessages.getFirstReportedMessage();
assertNull(message);
}
use of com.android.tools.idea.gradle.project.sync.messages.SyncMessage in project android by JetBrains.
the class UniquePathModuleValidatorStrategyTest method testFixAndReportFoundIssuesWithUniquePaths.
public void testFixAndReportFoundIssuesWithUniquePaths() throws Exception {
Project project = getProject();
SyncMessagesStub syncMessages = SyncMessagesStub.replaceSyncMessagesService(project);
ProjectSubset projectSubset = IdeComponents.replaceServiceWithMock(project, ProjectSubset.class);
when(projectSubset.isFeatureEnabled()).thenReturn(false);
Multimap<String, Module> modulesByPath = myStrategy.getModulesByPath();
modulesByPath.putAll("path1", Lists.newArrayList(myModule1));
modulesByPath.putAll("path2", Lists.newArrayList(myModule2));
myStrategy.fixAndReportFoundIssues();
SyncMessage message = syncMessages.getFirstReportedMessage();
assertNull(message);
}
Aggregations