use of com.android.tools.idea.gradle.project.sync.messages.SyncMessagesStub in project android by JetBrains.
the class EncodingValidationStrategyTest method testFixAndReportFoundIssuesWithNoMismatch.
public void testFixAndReportFoundIssuesWithNoMismatch() {
SyncMessagesStub syncMessages = SyncMessagesStub.replaceSyncMessagesService(getProject());
myStrategy.setMismatchingEncoding(null);
myStrategy.fixAndReportFoundIssues();
SyncMessage message = syncMessages.getFirstReportedMessage();
assertNull(message);
verify(myEncodings, never()).setDefaultCharsetName(anyString());
}
use of com.android.tools.idea.gradle.project.sync.messages.SyncMessagesStub in project android by JetBrains.
the class UniquePathModuleValidatorStrategyTest method testFixAndReportFoundIssues.
public void testFixAndReportFoundIssues() 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("path", Lists.newArrayList(myModule1, myModule2));
when(myModule1.getName()).thenReturn("module1");
when(myModule2.getName()).thenReturn("module2");
myStrategy.fixAndReportFoundIssues();
SyncMessage message = syncMessages.getFirstReportedMessage();
assertNotNull(message);
assertAbout(syncMessage()).that(message).hasMessageLine("The modules ['module1', 'module2'] point to same directory in the file system.", 0);
}
Aggregations