use of com.android.tools.idea.gradle.project.sync.messages.SyncMessagesStub in project android by JetBrains.
the class ExtraGeneratedFolderValidationStrategyTest method testFixAndReportFoundIssues.
public void testFixAndReportFoundIssues() {
List<File> paths = myStrategy.getExtraGeneratedSourceFolderPaths();
paths.add(new File("z"));
paths.add(new File("a"));
SyncMessagesStub syncMessages = SyncMessagesStub.replaceSyncMessagesService(getProject());
myStrategy.fixAndReportFoundIssues();
List<SyncMessage> messages = syncMessages.getReportedMessages();
assertThat(messages).hasSize(3);
// @formatter:off
assertAbout(syncMessage()).that(messages.get(0)).hasType(WARNING).hasMessageLine("Folder a", 0);
assertAbout(syncMessage()).that(messages.get(1)).hasType(WARNING).hasMessageLine("Folder z", 0);
assertAbout(syncMessage()).that(messages.get(2)).hasType(INFO).hasMessageLine("3rd-party Gradle plug-ins may be the cause", 0);
// @formatter:on
}
use of com.android.tools.idea.gradle.project.sync.messages.SyncMessagesStub 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.SyncMessagesStub 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.SyncMessagesStub 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.SyncMessagesStub 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);
}
Aggregations