Search in sources :

Example 1 with JarWarResourceSet

use of org.apache.catalina.webresources.JarWarResourceSet in project joinfaces by joinfaces.

the class JsfTomcatApplicationListenerIT method embeddedJarWithoutAppResources.

@Test
public void embeddedJarWithoutAppResources() throws LifecycleException {
    ContextMock contextMock = new ContextMock();
    File file = new File(TARGET + File.separator + TEST_CLASSES + File.separator + "test.jar");
    JarWarResourceSet jarWarResourceSet = new JarWarResourceSet(contextMock.getWebResourceRoot(), "/", file.getAbsolutePath(), INTERNAL_JAR, METAINF_RESOURCES);
    jarWarResourceSet.init();
    DirResourceSet dirResourceSet = new DirResourceSet(contextMock.getWebResourceRoot(), TEST, TEST, TEST);
    contextMock.init(jarWarResourceSet, dirResourceSet);
    callApplicationEvent(contextMock);
    assertThat(contextMock.getWebResourceRoot().getCreateWebResourceSetCalls()).isEqualTo(2);
}
Also used : JarWarResourceSet(org.apache.catalina.webresources.JarWarResourceSet) DirResourceSet(org.apache.catalina.webresources.DirResourceSet) File(java.io.File) Test(org.junit.Test)

Example 2 with JarWarResourceSet

use of org.apache.catalina.webresources.JarWarResourceSet in project joinfaces by joinfaces.

the class JsfTomcatApplicationListenerIT method embeddedJarWithoutAppResources2.

@Test
public void embeddedJarWithoutAppResources2() throws LifecycleException {
    ContextMock contextMock = new ContextMock();
    File file = new File(TARGET + File.separator + TEST_CLASSES + File.separator + "test.jar");
    JarWarResourceSet jarWarResourceSet = new JarWarResourceSet(contextMock.getWebResourceRoot(), "/", file.getAbsolutePath(), INTERNAL_JAR, METAINF_RESOURCES);
    jarWarResourceSet.init();
    DirResourceSet dirResourceSet = new DirResourceSet(contextMock.getWebResourceRoot(), TEST, TEST, TEST);
    contextMock.init(dirResourceSet, jarWarResourceSet);
    callApplicationEvent(contextMock);
    assertThat(contextMock.getWebResourceRoot().getCreateWebResourceSetCalls()).isEqualTo(2);
}
Also used : JarWarResourceSet(org.apache.catalina.webresources.JarWarResourceSet) DirResourceSet(org.apache.catalina.webresources.DirResourceSet) File(java.io.File) Test(org.junit.Test)

Example 3 with JarWarResourceSet

use of org.apache.catalina.webresources.JarWarResourceSet in project joinfaces by joinfaces.

the class JsfTomcatApplicationListenerIT method embeddedWarWithoutAppResources.

@Test
public void embeddedWarWithoutAppResources() throws LifecycleException {
    ContextMock contextMock = new ContextMock();
    File file = new File(TARGET + File.separator + TEST_CLASSES + File.separator + "test.war");
    JarWarResourceSet jarWarResourceSet = new JarWarResourceSet(contextMock.getWebResourceRoot(), "/", file.getAbsolutePath(), INTERNAL_JAR, METAINF_RESOURCES);
    jarWarResourceSet.init();
    DirResourceSet dirResourceSet = new DirResourceSet(contextMock.getWebResourceRoot(), TEST, TEST, TEST);
    contextMock.init(jarWarResourceSet, dirResourceSet);
    callApplicationEvent(contextMock);
    assertThat(contextMock.getWebResourceRoot().getCreateWebResourceSetCalls()).isEqualTo(0);
}
Also used : JarWarResourceSet(org.apache.catalina.webresources.JarWarResourceSet) DirResourceSet(org.apache.catalina.webresources.DirResourceSet) File(java.io.File) Test(org.junit.Test)

Example 4 with JarWarResourceSet

use of org.apache.catalina.webresources.JarWarResourceSet in project joinfaces by joinfaces.

the class JsfTomcatApplicationListenerIT method embeddedJarWithAppResources.

@Test
public void embeddedJarWithAppResources() throws LifecycleException {
    ContextMock contextMock = new ContextMock();
    File file = new File(TARGET + File.separator + TEST_CLASSES + File.separator + "test.jar");
    JarWarResourceSet jarWarResourceSet = new JarWarResourceSet(contextMock.getWebResourceRoot(), "/", file.getAbsolutePath(), INTERNAL_JAR, METAINF_RESOURCES);
    jarWarResourceSet.init();
    JarResourceSet jarResourceSet = new JarResourceSet(contextMock.getWebResourceRoot(), "/", file.getAbsolutePath(), METAINF_RESOURCES);
    contextMock.init(jarWarResourceSet, jarResourceSet);
    callApplicationEvent(contextMock);
    assertThat(contextMock.getWebResourceRoot().getCreateWebResourceSetCalls()).isEqualTo(2);
}
Also used : JarWarResourceSet(org.apache.catalina.webresources.JarWarResourceSet) JarResourceSet(org.apache.catalina.webresources.JarResourceSet) File(java.io.File) Test(org.junit.Test)

Example 5 with JarWarResourceSet

use of org.apache.catalina.webresources.JarWarResourceSet in project joinfaces by joinfaces.

the class JsfTomcatApplicationListenerIT method embeddedWarWithAppResources.

@Test
public void embeddedWarWithAppResources() throws LifecycleException {
    ContextMock contextMock = new ContextMock();
    File file = new File(TARGET + File.separator + TEST_CLASSES + File.separator + "test.war");
    JarWarResourceSet jarWarResourceSet = new JarWarResourceSet(contextMock.getWebResourceRoot(), "/", file.getAbsolutePath(), INTERNAL_JAR, METAINF_RESOURCES);
    jarWarResourceSet.init();
    JarResourceSet jarResourceSet = new JarResourceSet(contextMock.getWebResourceRoot(), "/", file.getAbsolutePath(), METAINF_RESOURCES);
    contextMock.init(jarWarResourceSet, jarResourceSet);
    callApplicationEvent(contextMock);
    assertThat(contextMock.getWebResourceRoot().getCreateWebResourceSetCalls()).isEqualTo(0);
}
Also used : JarWarResourceSet(org.apache.catalina.webresources.JarWarResourceSet) JarResourceSet(org.apache.catalina.webresources.JarResourceSet) File(java.io.File) Test(org.junit.Test)

Aggregations

File (java.io.File)5 JarWarResourceSet (org.apache.catalina.webresources.JarWarResourceSet)5 Test (org.junit.Test)5 DirResourceSet (org.apache.catalina.webresources.DirResourceSet)3 JarResourceSet (org.apache.catalina.webresources.JarResourceSet)2