[ 
https://issues.apache.org/jira/browse/TOMEE-1498?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Romain Manni-Bucau updated TOMEE-1498:
--------------------------------------
    Description: 
{code}
@EnableServices("http")
@WebResource("src/test/web")
@Classes // just to define a module
public class ResourcesTest {
    @Rule
    public final ApplicationComposerRule container = new 
ApplicationComposerRule(this);

    @RandomPort("http")
    private URL context;

    @Test
    public void classloader() throws IOException { // from classloader 
META-INF/resources/
        assertTrue(IO.slurp(new URL(context.toExternalForm() + 
"openejb/foo.txt")).contains("from classloader"));
        assertTrue(IO.slurp(new URL(context.toExternalForm() + 
"openejb/other/foo.txt")).contains("from classloader2"));
    }

    @Test
    public void folder() throws IOException { // from src/test/web/*
        assertTrue(IO.slurp(new URL(context.toExternalForm() + 
"openejb/bar.txt")).contains("from web"));
        assertTrue(IO.slurp(new URL(context.toExternalForm() + 
"openejb/sub/bar.txt")).contains("from web2"));
    }
}
{code}

> basic web resource support for openejb-http
> -------------------------------------------
>
>                 Key: TOMEE-1498
>                 URL: https://issues.apache.org/jira/browse/TOMEE-1498
>             Project: TomEE
>          Issue Type: New Feature
>            Reporter: Romain Manni-Bucau
>            Assignee: Romain Manni-Bucau
>             Fix For: 2.0.0-Milestone-1
>
>
> {code}
> @EnableServices("http")
> @WebResource("src/test/web")
> @Classes // just to define a module
> public class ResourcesTest {
>     @Rule
>     public final ApplicationComposerRule container = new 
> ApplicationComposerRule(this);
>     @RandomPort("http")
>     private URL context;
>     @Test
>     public void classloader() throws IOException { // from classloader 
> META-INF/resources/
>         assertTrue(IO.slurp(new URL(context.toExternalForm() + 
> "openejb/foo.txt")).contains("from classloader"));
>         assertTrue(IO.slurp(new URL(context.toExternalForm() + 
> "openejb/other/foo.txt")).contains("from classloader2"));
>     }
>     @Test
>     public void folder() throws IOException { // from src/test/web/*
>         assertTrue(IO.slurp(new URL(context.toExternalForm() + 
> "openejb/bar.txt")).contains("from web"));
>         assertTrue(IO.slurp(new URL(context.toExternalForm() + 
> "openejb/sub/bar.txt")).contains("from web2"));
>     }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to