Search in sources :

Example 1 with AppEngineStandardLibraryPanel

use of com.google.cloud.tools.intellij.appengine.facet.standard.AppEngineStandardLibraryPanel in project google-cloud-intellij by GoogleCloudPlatform.

the class AppEngineStandardSupportProviderTest method testAppEngine_defaultManagedLibrariesSelected.

public void testAppEngine_defaultManagedLibrariesSelected() {
    AppEngineStandardLibraryPanel libraryPanel = new AppEngineStandardLibraryPanel(true);
    LibraryEx library = mock(LibraryEx.class);
    when(library.getTable()).thenReturn(ProjectLibraryTable.getInstance(myModule.getProject()));
    when(library.getExcludedRoots()).thenReturn(new VirtualFile[0]);
    when(library.getName()).thenReturn("javax.servlet:servlet-api:2.5");
    setupAppEngine(libraryPanel, library);
    addSupport();
    assertNull(FacetManager.getInstance(myModule).getFacetByType(WebFacet.ID));
    final String moduleName = myModule.getName();
    ArtifactsTestUtil.assertLayout(myProject, moduleName, "<root>\n" + " WEB-INF/\n" + "  classes/\n" + "   module:" + moduleName + "\n" + "  lib/\n" + "   lib:javax.servlet:servlet-api:2.5(project)\n");
}
Also used : AppEngineStandardLibraryPanel(com.google.cloud.tools.intellij.appengine.facet.standard.AppEngineStandardLibraryPanel) LibraryEx(com.intellij.openapi.roots.impl.libraries.LibraryEx)

Example 2 with AppEngineStandardLibraryPanel

use of com.google.cloud.tools.intellij.appengine.facet.standard.AppEngineStandardLibraryPanel in project google-cloud-intellij by GoogleCloudPlatform.

the class AppEngineStandardSupportProviderTest method testAppEngine_noManagedLibrariesSelected.

public void testAppEngine_noManagedLibrariesSelected() {
    setupAppEngine(new AppEngineStandardLibraryPanel(false), null);
    addSupport();
    assertNull(FacetManager.getInstance(myModule).getFacetByType(WebFacet.ID));
    final String moduleName = myModule.getName();
    ArtifactsTestUtil.assertLayout(myProject, moduleName, "<root>\n" + " WEB-INF/\n" + "  classes/\n" + "   module:" + moduleName + "\n");
}
Also used : AppEngineStandardLibraryPanel(com.google.cloud.tools.intellij.appengine.facet.standard.AppEngineStandardLibraryPanel)

Example 3 with AppEngineStandardLibraryPanel

use of com.google.cloud.tools.intellij.appengine.facet.standard.AppEngineStandardLibraryPanel in project google-cloud-intellij by GoogleCloudPlatform.

the class AppEngineStandardSupportProviderTest method testAppEngineWithWeb_noManagedLibrariesSelected.

public void testAppEngineWithWeb_noManagedLibrariesSelected() {
    setupAppEngine(new AppEngineStandardLibraryPanel(false), null);
    selectFramework(WebFacet.ID);
    selectVersion(WebFrameworkType.getInstance(), new WebFrameworkVersion(WebAppVersion.WebAppVersion_2_5));
    addSupport();
    getFacet(AppEngineStandardFacetType.ID);
    assertFileExist("web/WEB-INF/web.xml");
    assertFileExist("web/WEB-INF/appengine-web.xml");
    final String moduleName = myModule.getName();
    Artifact artifact = ArtifactsTestUtil.findArtifact(myProject, moduleName + ":war exploded");
    ArtifactsTestUtil.assertLayout(artifact.getRootElement(), "<root>\n" + " javaee-resources:Web(" + moduleName + ")\n" + " WEB-INF/\n" + "  classes/\n" + "   module:" + moduleName + "\n");
    assertRunConfigurationCreated(artifact);
}
Also used : AppEngineStandardLibraryPanel(com.google.cloud.tools.intellij.appengine.facet.standard.AppEngineStandardLibraryPanel) WebFrameworkVersion(com.intellij.javaee.web.framework.WebFrameworkVersion) Artifact(com.intellij.packaging.artifacts.Artifact)

Aggregations

AppEngineStandardLibraryPanel (com.google.cloud.tools.intellij.appengine.facet.standard.AppEngineStandardLibraryPanel)3 WebFrameworkVersion (com.intellij.javaee.web.framework.WebFrameworkVersion)1 LibraryEx (com.intellij.openapi.roots.impl.libraries.LibraryEx)1 Artifact (com.intellij.packaging.artifacts.Artifact)1