jaroslav@623: /** jaroslav@623: * Back 2 Browser Bytecode Translator jaroslav@623: * Copyright (C) 2012 Jaroslav Tulach jaroslav@623: * jaroslav@623: * This program is free software: you can redistribute it and/or modify jaroslav@623: * it under the terms of the GNU General Public License as published by jaroslav@623: * the Free Software Foundation, version 2 of the License. jaroslav@623: * jaroslav@623: * This program is distributed in the hope that it will be useful, jaroslav@623: * but WITHOUT ANY WARRANTY; without even the implied warranty of jaroslav@623: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the jaroslav@623: * GNU General Public License for more details. jaroslav@623: * jaroslav@623: * You should have received a copy of the GNU General Public License jaroslav@623: * along with this program. Look for COPYING file in the top folder. jaroslav@623: * If not, see http://opensource.org/licenses/GPL-2.0. jaroslav@623: */ jaroslav@623: package org.apidesign.bck2brwsr.vmtest; jaroslav@623: jaroslav@623: import java.lang.annotation.ElementType; jaroslav@623: import java.lang.annotation.Retention; jaroslav@623: import java.lang.annotation.RetentionPolicy; jaroslav@623: import java.lang.annotation.Target; jaroslav@623: jaroslav@667: /** jaroslav@667: * Exposes HTTP page or pages to the running {@link BrwsrTest}, so it can access under jaroslav@667: * the relative path. jaroslav@623: * jaroslav@623: * @author Jaroslav Tulach jaroslav@623: */ jaroslav@623: @Retention(RetentionPolicy.RUNTIME) jaroslav@667: @Target({ElementType.METHOD, ElementType.TYPE}) jaroslav@667: public @interface Http { jaroslav@667: /** Set of pages to make available */ jaroslav@667: public Resource[] value(); jaroslav@667: jaroslav@667: /** Exposes an HTTP page to the running {@link BrwsrTest}, so it can access jaroslav@667: * under the relative path. jaroslav@667: * jaroslav@667: * @author Jaroslav Tulach jaroslav@626: */ jaroslav@667: @Retention(RetentionPolicy.RUNTIME) jaroslav@667: @Target({}) jaroslav@667: public @interface Resource { jaroslav@667: /** path on the server that the test can use to access the exposed resource */ jaroslav@667: String path(); jaroslav@667: /** the content of the HttpResource */ jaroslav@667: String content(); jaroslav@667: /** resource relative to the class that should be used instead of content. jaroslav@667: * Leave content equal to empty string. jaroslav@667: */ jaroslav@667: String resource() default ""; jaroslav@667: /** mime type of the resource */ jaroslav@667: String mimeType(); jaroslav@667: } jaroslav@623: }