boot-fx/src/test/java/org/netbeans/html/boot/fx/TestingProvider.java
author Jaroslav Tulach <jtulach@netbeans.org>
Tue, 26 Aug 2014 18:13:30 +0200
changeset 838 bdc3d696dd4a
parent 790 30f20d9c0986
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.
jtulach@569
     1
/**
jtulach@569
     2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
jtulach@569
     3
 *
jtulach@569
     4
 * Copyright 2013-2014 Oracle and/or its affiliates. All rights reserved.
jtulach@569
     5
 *
jtulach@569
     6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
jtulach@569
     7
 * Other names may be trademarks of their respective owners.
jtulach@569
     8
 *
jtulach@569
     9
 * The contents of this file are subject to the terms of either the GNU
jtulach@569
    10
 * General Public License Version 2 only ("GPL") or the Common
jtulach@569
    11
 * Development and Distribution License("CDDL") (collectively, the
jtulach@569
    12
 * "License"). You may not use this file except in compliance with the
jtulach@569
    13
 * License. You can obtain a copy of the License at
jtulach@569
    14
 * http://www.netbeans.org/cddl-gplv2.html
jtulach@569
    15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
jtulach@569
    16
 * specific language governing permissions and limitations under the
jtulach@569
    17
 * License.  When distributing the software, include this License Header
jtulach@569
    18
 * Notice in each file and include the License file at
jtulach@569
    19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
jtulach@569
    20
 * particular file as subject to the "Classpath" exception as provided
jtulach@569
    21
 * by Oracle in the GPL Version 2 section of the License file that
jtulach@569
    22
 * accompanied this code. If applicable, add the following below the
jtulach@569
    23
 * License Header, with the fields enclosed by brackets [] replaced by
jtulach@569
    24
 * your own identifying information:
jtulach@569
    25
 * "Portions Copyrighted [year] [name of copyright owner]"
jtulach@569
    26
 *
jtulach@569
    27
 * Contributor(s):
jtulach@569
    28
 *
jtulach@569
    29
 * The Original Software is NetBeans. The Initial Developer of the Original
jtulach@569
    30
 * Software is Oracle. Portions Copyright 2013-2014 Oracle. All Rights Reserved.
jtulach@569
    31
 *
jtulach@569
    32
 * If you wish your version of this file to be governed by only the CDDL
jtulach@569
    33
 * or only the GPL Version 2, indicate your decision by adding
jtulach@569
    34
 * "[Contributor] elects to include this software in this distribution
jtulach@569
    35
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
jtulach@569
    36
 * single choice of license, a recipient has the option to distribute
jtulach@569
    37
 * your version of this file under either the CDDL, the GPL Version 2 or
jtulach@569
    38
 * to extend the choice of license to its licensees as provided above.
jtulach@569
    39
 * However, if you add GPL Version 2 code and therefore, elected the GPL
jtulach@569
    40
 * Version 2 license, then the option applies only if the new code is
jtulach@569
    41
 * made subject to such option by the copyright holder.
jtulach@569
    42
 */
jtulach@569
    43
package org.netbeans.html.boot.fx;
jtulach@569
    44
jtulach@838
    45
import org.netbeans.html.context.spi.Contexts;
jtulach@569
    46
import org.openide.util.lookup.ServiceProvider;
jtulach@569
    47
import static org.testng.Assert.assertTrue;
jtulach@569
    48
jtulach@569
    49
/**
jtulach@569
    50
 *
jtulach@790
    51
 * @author Jaroslav Tulach
jtulach@569
    52
 */
jtulach@569
    53
@ServiceProvider(service = Contexts.Provider.class)
jtulach@569
    54
public final class TestingProvider implements Contexts.Provider {
jtulach@569
    55
    
jtulach@569
    56
    static void assertCalled(String msg) {
jtulach@569
    57
        assertTrue(Boolean.getBoolean(TestingProvider.class.getName()), msg);
jtulach@569
    58
    }
jtulach@569
    59
jtulach@569
    60
    @Override
jtulach@569
    61
    public void fillContext(Contexts.Builder context, Class<?> requestor) {
jtulach@569
    62
        System.setProperty(TestingProvider.class.getName(), "true");
jtulach@569
    63
    }
jtulach@569
    64
    
jtulach@569
    65
}