json-tck/src/main/java/org/netbeans/html/json/tck/JavaScriptTCK.java
author Jaroslav Tulach <jtulach@netbeans.org>
Tue, 26 Aug 2014 18:13:30 +0200
changeset 838 bdc3d696dd4a
parent 790 json-tck/src/main/java/org/apidesign/html/json/tck/JavaScriptTCK.java@30f20d9c0986
child 873 d246e3fa98b7
permissions -rw-r--r--
During the API review process (bug 246133) the reviewers decided that in order to include html4j to NetBeans Platform, we need to stop using org.apidesign namespace and switch to NetBeans one. Repackaging all SPI packages into org.netbeans.html.smthng.spi.
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
 */
jtulach@838
    43
package org.netbeans.html.json.tck;
jaroslav@424
    44
jaroslav@424
    45
import net.java.html.js.tests.JavaScriptBodyTest;
jtulach@838
    46
import org.netbeans.html.boot.spi.Fn;
jtulach@838
    47
import org.netbeans.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
 *
jtulach@790
    55
 * @author Jaroslav Tulach
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 
jtulach@838
    62
     * invoke in a presenter context {@link Fn#activate(org.netbeans.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
}