jaroslav@273: /** jaroslav@273: * Back 2 Browser Bytecode Translator jaroslav@273: * Copyright (C) 2012 Jaroslav Tulach jaroslav@273: * jaroslav@273: * This program is free software: you can redistribute it and/or modify jaroslav@273: * it under the terms of the GNU General Public License as published by jaroslav@273: * the Free Software Foundation, version 2 of the License. jaroslav@273: * jaroslav@273: * This program is distributed in the hope that it will be useful, jaroslav@273: * but WITHOUT ANY WARRANTY; without even the implied warranty of jaroslav@273: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the jaroslav@273: * GNU General Public License for more details. jaroslav@273: * jaroslav@273: * You should have received a copy of the GNU General Public License jaroslav@273: * along with this program. Look for COPYING file in the top folder. jaroslav@273: * If not, see http://opensource.org/licenses/GPL-2.0. jaroslav@273: */ jaroslav@346: package org.apidesign.bck2brwsr.vmtest; jaroslav@273: jaroslav@372: import org.apidesign.bck2brwsr.vmtest.impl.CompareCase; jaroslav@273: import org.testng.annotations.Factory; jaroslav@273: jaroslav@273: /** A TestNG {@link Factory} that seeks for {@link Compare} annotations jaroslav@273: * in provided class and builds set of tests that compare the computations jaroslav@273: * in real as well as JavaScript virtual machines. Use as:
jaroslav@273:  * {@code @}{@link Factory} public static create() {
jaroslav@346:  *   return @{link VMTest}.{@link #create(YourClass.class);
jaroslav@273:  * }
jaroslav@273: * jaroslav@273: * @author Jaroslav Tulach jaroslav@273: */ jaroslav@372: public final class VMTest { jaroslav@346: /** Inspects clazz and for each {@lik Compare} method creates jaroslav@347: * instances of tests. Each instance runs the test in different virtual jaroslav@346: * machine and at the end they compare the results. jaroslav@346: * jaroslav@346: * @param clazz the class to inspect jaroslav@346: * @return the set of created tests jaroslav@346: */ jaroslav@273: public static Object[] create(Class clazz) { jaroslav@372: return CompareCase.create(clazz); jaroslav@346: } jaroslav@273: }