rt/vmtest/src/main/java/org/apidesign/bck2brwsr/vmtest/Http.java
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Tue, 26 Feb 2013 16:54:16 +0100
changeset 772 d382dacfd73f
parent 667 vmtest/src/main/java/org/apidesign/bck2brwsr/vmtest/Http.java@5866e89ef568
child 797 7b5a053c6763
permissions -rw-r--r--
Moving modules around so the runtime is under one master pom and can be built without building other modules that are in the repository
jaroslav@623
     1
/**
jaroslav@623
     2
 * Back 2 Browser Bytecode Translator
jaroslav@623
     3
 * Copyright (C) 2012 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
jaroslav@623
     4
 *
jaroslav@623
     5
 * This program is free software: you can redistribute it and/or modify
jaroslav@623
     6
 * it under the terms of the GNU General Public License as published by
jaroslav@623
     7
 * the Free Software Foundation, version 2 of the License.
jaroslav@623
     8
 *
jaroslav@623
     9
 * This program is distributed in the hope that it will be useful,
jaroslav@623
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
jaroslav@623
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
jaroslav@623
    12
 * GNU General Public License for more details.
jaroslav@623
    13
 *
jaroslav@623
    14
 * You should have received a copy of the GNU General Public License
jaroslav@623
    15
 * along with this program. Look for COPYING file in the top folder.
jaroslav@623
    16
 * If not, see http://opensource.org/licenses/GPL-2.0.
jaroslav@623
    17
 */
jaroslav@623
    18
package org.apidesign.bck2brwsr.vmtest;
jaroslav@623
    19
jaroslav@623
    20
import java.lang.annotation.ElementType;
jaroslav@623
    21
import java.lang.annotation.Retention;
jaroslav@623
    22
import java.lang.annotation.RetentionPolicy;
jaroslav@623
    23
import java.lang.annotation.Target;
jaroslav@623
    24
jaroslav@667
    25
/**
jaroslav@667
    26
 * Exposes HTTP page or pages to the running {@link BrwsrTest}, so it can access under
jaroslav@667
    27
 * the relative path.
jaroslav@623
    28
 *
jaroslav@623
    29
 * @author Jaroslav Tulach <jtulach@netbeans.org>
jaroslav@623
    30
 */
jaroslav@623
    31
@Retention(RetentionPolicy.RUNTIME)
jaroslav@667
    32
@Target({ElementType.METHOD, ElementType.TYPE})
jaroslav@667
    33
public @interface Http {
jaroslav@667
    34
    /** Set of pages to make available */
jaroslav@667
    35
    public Resource[] value();
jaroslav@667
    36
    
jaroslav@667
    37
    /** Exposes an HTTP page to the running {@link BrwsrTest}, so it can access
jaroslav@667
    38
     * under the relative path.
jaroslav@667
    39
     *
jaroslav@667
    40
     * @author Jaroslav Tulach <jtulach@netbeans.org>
jaroslav@626
    41
     */
jaroslav@667
    42
    @Retention(RetentionPolicy.RUNTIME)
jaroslav@667
    43
    @Target({})
jaroslav@667
    44
    public @interface Resource {
jaroslav@667
    45
        /** path on the server that the test can use to access the exposed resource */
jaroslav@667
    46
        String path();
jaroslav@667
    47
        /** the content of the HttpResource */
jaroslav@667
    48
        String content();
jaroslav@667
    49
        /** resource relative to the class that should be used instead of <code>content</code>.
jaroslav@667
    50
         * Leave content equal to empty string.
jaroslav@667
    51
         */
jaroslav@667
    52
        String resource() default "";
jaroslav@667
    53
        /** mime type of the resource */
jaroslav@667
    54
        String mimeType();
jaroslav@667
    55
    }
jaroslav@623
    56
}