jaroslav@296: /** jaroslav@296: * Back 2 Browser Bytecode Translator jaroslav@296: * Copyright (C) 2012 Jaroslav Tulach jaroslav@296: * jaroslav@296: * This program is free software: you can redistribute it and/or modify jaroslav@296: * it under the terms of the GNU General Public License as published by jaroslav@296: * the Free Software Foundation, version 2 of the License. jaroslav@296: * jaroslav@296: * This program is distributed in the hope that it will be useful, jaroslav@296: * but WITHOUT ANY WARRANTY; without even the implied warranty of jaroslav@296: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the jaroslav@296: * GNU General Public License for more details. jaroslav@296: * jaroslav@296: * You should have received a copy of the GNU General Public License jaroslav@296: * along with this program. Look for COPYING file in the top folder. jaroslav@296: * If not, see http://opensource.org/licenses/GPL-2.0. jaroslav@296: */ jaroslav@296: package org.apidesign.vm4brwsr.tck; jaroslav@296: jaroslav@296: import org.apidesign.vm4brwsr.Compare; jaroslav@296: import org.apidesign.vm4brwsr.CompareVMs; jaroslav@296: import org.testng.annotations.Factory; jaroslav@296: jaroslav@296: /** jaroslav@296: * jaroslav@296: * @author Jaroslav Tulach jaroslav@296: */ jaroslav@296: public class CompareStringsTest { jaroslav@296: @Compare public String deleteLastTwoCharacters() { jaroslav@296: StringBuilder sb = new StringBuilder(); jaroslav@296: sb.append("453.0"); jaroslav@296: if (sb.toString().endsWith(".0")) { jaroslav@296: final int l = sb.length(); jaroslav@296: sb.delete(l - 2, l); jaroslav@296: } jaroslav@296: return sb.toString().toString(); jaroslav@296: } jaroslav@296: jaroslav@321: @Compare public String nameOfStringClass() throws Exception { jaroslav@321: return Class.forName("java.lang.String").getName(); jaroslav@321: } jaroslav@321: jaroslav@296: @Factory jaroslav@296: public static Object[] create() { jaroslav@296: return CompareVMs.create(CompareStringsTest.class); jaroslav@296: } jaroslav@296: }