jaroslav@939: /** jaroslav@939: * Back 2 Browser Bytecode Translator jaroslav@939: * Copyright (C) 2012 Jaroslav Tulach jaroslav@939: * jaroslav@939: * This program is free software: you can redistribute it and/or modify jaroslav@939: * it under the terms of the GNU General Public License as published by jaroslav@939: * the Free Software Foundation, version 2 of the License. jaroslav@939: * jaroslav@939: * This program is distributed in the hope that it will be useful, jaroslav@939: * but WITHOUT ANY WARRANTY; without even the implied warranty of jaroslav@939: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the jaroslav@939: * GNU General Public License for more details. jaroslav@939: * jaroslav@939: * You should have received a copy of the GNU General Public License jaroslav@939: * along with this program. Look for COPYING file in the top folder. jaroslav@939: * If not, see http://opensource.org/licenses/GPL-2.0. jaroslav@939: */ jaroslav@939: package org.apidesign.bck2brwsr.vmtest.impl; jaroslav@939: jaroslav@939: import org.apidesign.bck2brwsr.vmtest.BrwsrTest; jaroslav@939: import org.apidesign.bck2brwsr.vmtest.VMTest; jaroslav@939: import org.testng.annotations.Factory; jaroslav@939: jaroslav@939: /** jaroslav@939: * jaroslav@939: * @author Jaroslav Tulach jaroslav@939: */ jaroslav@939: public class CallMeTwiceTest { jaroslav@939: int cnt; jaroslav@939: jaroslav@939: @BrwsrTest public void callMeTwice() throws InterruptedException { jaroslav@939: if (cnt++ == 0) { jaroslav@939: throw new InterruptedException(); jaroslav@939: } jaroslav@939: int prevCnt = cnt; jaroslav@939: cnt = 0; jaroslav@939: assert prevCnt == 2 : "We need to receive two calls " + prevCnt; jaroslav@939: } jaroslav@939: jaroslav@939: @Factory public static Object[] create() { jaroslav@939: return VMTest.create(CallMeTwiceTest.class); jaroslav@939: } jaroslav@939: }