json-tck/src/main/java/org/apidesign/html/json/tck/JavaScriptTCK.java
author Jaroslav Tulach <jaroslav.tulach@netbeans.org>
Fri, 07 Feb 2014 07:44:34 +0100
changeset 551 7ca2253fa86d
parent 546 3658bc686677
child 790 30f20d9c0986
permissions -rw-r--r--
Updating copyright headers to mention current year
jaroslav@424
     1
/**
jaroslav@424
     2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
jaroslav@424
     3
 *
jaroslav@551
     4
 * Copyright 2013-2014 Oracle and/or its affiliates. All rights reserved.
jaroslav@424
     5
 *
jaroslav@424
     6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
jaroslav@424
     7
 * Other names may be trademarks of their respective owners.
jaroslav@424
     8
 *
jaroslav@424
     9
 * The contents of this file are subject to the terms of either the GNU
jaroslav@424
    10
 * General Public License Version 2 only ("GPL") or the Common
jaroslav@424
    11
 * Development and Distribution License("CDDL") (collectively, the
jaroslav@424
    12
 * "License"). You may not use this file except in compliance with the
jaroslav@424
    13
 * License. You can obtain a copy of the License at
jaroslav@424
    14
 * http://www.netbeans.org/cddl-gplv2.html
jaroslav@424
    15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
jaroslav@424
    16
 * specific language governing permissions and limitations under the
jaroslav@424
    17
 * License.  When distributing the software, include this License Header
jaroslav@424
    18
 * Notice in each file and include the License file at
jaroslav@424
    19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
jaroslav@424
    20
 * particular file as subject to the "Classpath" exception as provided
jaroslav@424
    21
 * by Oracle in the GPL Version 2 section of the License file that
jaroslav@424
    22
 * accompanied this code. If applicable, add the following below the
jaroslav@424
    23
 * License Header, with the fields enclosed by brackets [] replaced by
jaroslav@424
    24
 * your own identifying information:
jaroslav@424
    25
 * "Portions Copyrighted [year] [name of copyright owner]"
jaroslav@424
    26
 *
jaroslav@424
    27
 * Contributor(s):
jaroslav@424
    28
 *
jaroslav@424
    29
 * The Original Software is NetBeans. The Initial Developer of the Original
jaroslav@551
    30
 * Software is Oracle. Portions Copyright 2013-2014 Oracle. All Rights Reserved.
jaroslav@424
    31
 *
jaroslav@424
    32
 * If you wish your version of this file to be governed by only the CDDL
jaroslav@424
    33
 * or only the GPL Version 2, indicate your decision by adding
jaroslav@424
    34
 * "[Contributor] elects to include this software in this distribution
jaroslav@424
    35
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
jaroslav@424
    36
 * single choice of license, a recipient has the option to distribute
jaroslav@424
    37
 * your version of this file under either the CDDL, the GPL Version 2 or
jaroslav@424
    38
 * to extend the choice of license to its licensees as provided above.
jaroslav@424
    39
 * However, if you add GPL Version 2 code and therefore, elected the GPL
jaroslav@424
    40
 * Version 2 license, then the option applies only if the new code is
jaroslav@424
    41
 * made subject to such option by the copyright holder.
jaroslav@424
    42
 */
jaroslav@424
    43
package org.apidesign.html.json.tck;
jaroslav@424
    44
jaroslav@424
    45
import net.java.html.js.tests.JavaScriptBodyTest;
jaroslav@424
    46
import org.apidesign.html.boot.spi.Fn;
jaroslav@546
    47
import org.apidesign.html.boot.spi.Fn.Presenter;
jaroslav@424
    48
jaroslav@546
    49
/** Entry point for those who want to verify that their implementation of
jaroslav@546
    50
 * {@link Presenter} is good enough to support existing Java/JavaScript 
jaroslav@546
    51
 * communication use-cases. Subclass this class, get list of {@link #testClasses() classes}
jaroslav@546
    52
 * find methods annotated by {@link KOTest} annotation and execute them.
jaroslav@546
    53
 * <p>
jaroslav@424
    54
 *
jaroslav@424
    55
 * @author Jaroslav Tulach <jtulach@netbeans.org>
jaroslav@534
    56
 * @since 0.7
jaroslav@424
    57
 */
jaroslav@424
    58
public abstract class JavaScriptTCK {
jaroslav@424
    59
    /** Gives you list of classes included in the TCK. Their test methods
jaroslav@424
    60
     * are annotated by {@link KOTest} annotation. The methods are public
jaroslav@424
    61
     * instance methods that take no arguments. The method should be 
jaroslav@424
    62
     * invoke in a presenter context {@link Fn#activate(org.apidesign.html.boot.spi.Fn.Presenter)}.
jaroslav@424
    63
     * 
jaroslav@424
    64
     * @return classes with methods annotated by {@link KOTest} annotation
jaroslav@424
    65
     */
jaroslav@424
    66
    protected static Class<?>[] testClasses() {
jaroslav@424
    67
        return new Class[] { 
jaroslav@424
    68
            JavaScriptBodyTest.class
jaroslav@424
    69
        };
jaroslav@424
    70
    }
jaroslav@424
    71
    
jaroslav@424
    72
}