use of com.android.tools.idea.rendering.errors.ui.RenderErrorModel in project intellij by bazelbuild.
the class BlazeRenderErrorContributorTest method testReportGeneratedResources.
@Test
public void testReportGeneratedResources() {
createTargetMapWithGeneratedResources();
RenderErrorModel errorModel = createRenderErrorModelWithBrokenClasses();
RenderErrorModel.Issue generatedResourcesIssue = Iterables.getOnlyElement(errorModel.getIssues().stream().filter(issue -> issue.getSummary().equals(GENERATED_RESOURCES_ERROR)).collect(Collectors.toList()));
assertThat(generatedResourcesIssue.getHtmlContent()).isEqualTo("Generated resources will not be discovered by the IDE:" + "<DL>" + "<DD>-&NBSP;" + "com/google/example/dependency/generated/res " + "from <A HREF=\"file:///src/com/google/example/dependency/BUILD\">" + "//com/google/example:generated</A>" + "<DD>-&NBSP;" + "com/google/example/main/generated/res " + "from <A HREF=\"file:///src/com/google/example/main/BUILD\">" + "//com/google/example:main</A>" + "<DD>-&NBSP;" + "com/google/example/transitive/generated/one/res " + "from <A HREF=\"file:///src/com/google/example/transitive/BUILD\">" + "//com/google/example/transitive:generated</A>" + "<DD>-&NBSP;" + "com/google/example/transitive/generated/two/res " + "from <A HREF=\"file:///src/com/google/example/transitive/BUILD\">" + "//com/google/example/transitive:generated</A>" + "</DL>" + "Please avoid using generated resources, then " + "<A HREF=\"action:sync\">sync the project</A> and " + "<A HREF=\"refreshRender\">refresh the layout</A>.");
}
use of com.android.tools.idea.rendering.errors.ui.RenderErrorModel in project intellij by bazelbuild.
the class BlazeRenderErrorContributorTest method testNoReportMissingClassDependenciesIfClassInDependency.
@Test
public void testNoReportMissingClassDependenciesIfClassInDependency() {
createTargetMapWithMissingClassDependency();
RenderErrorModel errorModel = createRenderErrorModelWithMissingClasses("com.google.example.dependent.LibraryView");
errorModel.getIssues().forEach(issue -> assertThat(issue.getSummary()).isNotEqualTo(MISSING_CLASS_DEPENDENCIES_ERROR));
}
use of com.android.tools.idea.rendering.errors.ui.RenderErrorModel in project intellij by bazelbuild.
the class BlazeRenderErrorContributorTest method testNoReportNonStandardAndroidManifestNameInDependency.
@Test
public void testNoReportNonStandardAndroidManifestNameInDependency() {
createTargetMapWithNonStandardAndroidManifestNameInDependency();
RenderErrorModel errorModel = createRenderErrorModelWithBrokenClasses();
errorModel.getIssues().forEach(issue -> assertThat(issue.getSummary()).isNotEqualTo(NON_STANDARD_MANIFEST_NAME_ERROR));
}
use of com.android.tools.idea.rendering.errors.ui.RenderErrorModel in project intellij by bazelbuild.
the class BlazeRenderErrorContributorTest method testNoBlazeIssuesIfNoRelatedErrors.
@Test
public void testNoBlazeIssuesIfNoRelatedErrors() {
RenderErrorModel errorModel = createRenderErrorModelWithBrokenClasses();
errorModel.getIssues().forEach(issue -> assertThat(issue.getSummary()).isNoneOf(GENERATED_RESOURCES_ERROR, NON_STANDARD_MANIFEST_NAME_ERROR, MISSING_CLASS_DEPENDENCIES_ERROR));
}
use of com.android.tools.idea.rendering.errors.ui.RenderErrorModel in project intellij by bazelbuild.
the class BlazeRenderErrorContributorTest method testNoReportMissingClassDependenciesIfClassInSameTarget.
@Test
public void testNoReportMissingClassDependenciesIfClassInSameTarget() {
createTargetMapWithMissingClassDependency();
RenderErrorModel errorModel = createRenderErrorModelWithMissingClasses("com.google.example.ResourceView");
errorModel.getIssues().forEach(issue -> assertThat(issue.getSummary()).isNotEqualTo(MISSING_CLASS_DEPENDENCIES_ERROR));
}
Aggregations