use of com.android.tools.idea.gradle.structure.model.PsPath in project android by JetBrains.
the class PsAndroidModuleAnalyzerTest method createIssueFrom.
@Test
public void createIssueFrom() {
SyncIssue syncIssue = mock(SyncIssue.class);
when(syncIssue.getMessage()).thenReturn("Conflict with dependency 'com.google.guava:guava'. Resolved versions for app (16.0) " + "and test app (16.0.1) differ. See http://g.co/androidstudio/app-test-app-conflict for " + "details.");
when(syncIssue.getSeverity()).thenReturn(SEVERITY_ERROR);
PsPath path = mock(PsPath.class);
PsIssue issue = PsAndroidModuleAnalyzer.createIssueFrom(syncIssue, path, null);
assertThat(issue.getText()).isEqualTo("Conflict with dependency 'com.google.guava:guava'. Resolved versions for app (16.0) " + "and test app (16.0.1) differ. See " + "<a href='http://g.co/androidstudio/app-test-app-conflict'>http://g.co/androidstudio/app-test-app-conflict</a> " + "for details.");
assertThat(issue.getSeverity()).isEqualTo(ERROR);
}
use of com.android.tools.idea.gradle.structure.model.PsPath in project android by JetBrains.
the class IssuesRenderer method render.
@NotNull
public String render(@NotNull Collection<PsIssue> issues) {
StringBuilder buffer = new StringBuilder();
buffer.append("<html><body><ol>");
for (PsIssue issue : issues) {
buffer.append("<li>").append(issue.getPath().toText(HTML)).append(": ").append(issue.getText());
PsPath quickFixPath = issue.getQuickFixPath();
if (quickFixPath != null) {
buffer.append(" ").append(quickFixPath.toText(HTML));
}
buffer.append("</li>");
}
buffer.append("</ul></body></html>");
return buffer.toString();
}
use of com.android.tools.idea.gradle.structure.model.PsPath in project android by JetBrains.
the class SingleModuleIssuesRenderer method render.
@Override
@NotNull
public String render(@NotNull Collection<PsIssue> issues) {
StringBuilder buffer = new StringBuilder();
buffer.append("<html><body><ol>");
for (PsIssue issue : issues) {
buffer.append("<li>").append(issue.getText());
PsPath quickFixPath = issue.getQuickFixPath();
if (quickFixPath != null) {
buffer.append(" ").append(quickFixPath.toText(HTML));
}
String description = issue.getDescription();
if (isNotEmpty(description)) {
buffer.append("<br/><br/>").append(description);
}
buffer.append("</li>");
}
buffer.append("</ol></body></html>");
return buffer.toString();
}