Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/**
* Back 2 Browser Bytecode Translator
* Copyright (C) 2012 Jaroslav Tulach
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://opensource.org/licenses/GPL-2.0.
*/
package org.apidesign.bck2brwsr.vmtest.impl;
import java.lang.annotation.Annotation;
import org.apidesign.bck2brwsr.vmtest.*;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import org.apidesign.bck2brwsr.launcher.Launcher;
import org.testng.Assert;
import org.testng.ITest;
import org.testng.annotations.Factory;
import org.testng.annotations.Test;
/** A TestNG {@link Factory} that seeks for {@link Compare} annotations
* in provided class and builds set of tests that compare the computations
* in real as well as JavaScript virtual machines. Use as:
*
* @author Jaroslav Tulach
*/
public final class CompareCase implements ITest {
private final Bck2BrwsrCase first, second;
private final Method m;
private CompareCase(Method m, Bck2BrwsrCase first, Bck2BrwsrCase second) {
this.first = first;
this.second = second;
this.m = m;
}
/** Inspects clazz and for each {@lik Compare} method creates
* instances of tests. Each instance runs the test in different virtual
* machine and at the end they compare the results.
*
* @param clazz the class to inspect
* @return the set of created tests
*/
public static Object[] create(String[] brwsr, Class[] classes, Class extends Annotation> brwsrTest) {
List