author | Jaroslav Tulach <jaroslav.tulach@apidesign.org> |
Sat, 15 Dec 2012 07:10:58 +0100 | |
changeset 321 | 1848c77df886 |
parent 296 | fbf8eb98a8ef |
child 322 | 3884815c0629 |
permissions | -rw-r--r-- |
jaroslav@296 | 1 |
/** |
jaroslav@296 | 2 |
* Back 2 Browser Bytecode Translator |
jaroslav@296 | 3 |
* Copyright (C) 2012 Jaroslav Tulach <jaroslav.tulach@apidesign.org> |
jaroslav@296 | 4 |
* |
jaroslav@296 | 5 |
* This program is free software: you can redistribute it and/or modify |
jaroslav@296 | 6 |
* it under the terms of the GNU General Public License as published by |
jaroslav@296 | 7 |
* the Free Software Foundation, version 2 of the License. |
jaroslav@296 | 8 |
* |
jaroslav@296 | 9 |
* This program is distributed in the hope that it will be useful, |
jaroslav@296 | 10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
jaroslav@296 | 11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
jaroslav@296 | 12 |
* GNU General Public License for more details. |
jaroslav@296 | 13 |
* |
jaroslav@296 | 14 |
* You should have received a copy of the GNU General Public License |
jaroslav@296 | 15 |
* along with this program. Look for COPYING file in the top folder. |
jaroslav@296 | 16 |
* If not, see http://opensource.org/licenses/GPL-2.0. |
jaroslav@296 | 17 |
*/ |
jaroslav@296 | 18 |
package org.apidesign.vm4brwsr.tck; |
jaroslav@296 | 19 |
|
jaroslav@296 | 20 |
import org.apidesign.vm4brwsr.Compare; |
jaroslav@296 | 21 |
import org.apidesign.vm4brwsr.CompareVMs; |
jaroslav@296 | 22 |
import org.testng.annotations.Factory; |
jaroslav@296 | 23 |
|
jaroslav@296 | 24 |
/** |
jaroslav@296 | 25 |
* |
jaroslav@296 | 26 |
* @author Jaroslav Tulach <jtulach@netbeans.org> |
jaroslav@296 | 27 |
*/ |
jaroslav@296 | 28 |
public class CompareStringsTest { |
jaroslav@296 | 29 |
@Compare public String deleteLastTwoCharacters() { |
jaroslav@296 | 30 |
StringBuilder sb = new StringBuilder(); |
jaroslav@296 | 31 |
sb.append("453.0"); |
jaroslav@296 | 32 |
if (sb.toString().endsWith(".0")) { |
jaroslav@296 | 33 |
final int l = sb.length(); |
jaroslav@296 | 34 |
sb.delete(l - 2, l); |
jaroslav@296 | 35 |
} |
jaroslav@296 | 36 |
return sb.toString().toString(); |
jaroslav@296 | 37 |
} |
jaroslav@296 | 38 |
|
jaroslav@321 | 39 |
@Compare public String nameOfStringClass() throws Exception { |
jaroslav@321 | 40 |
return Class.forName("java.lang.String").getName(); |
jaroslav@321 | 41 |
} |
jaroslav@321 | 42 |
|
jaroslav@296 | 43 |
@Factory |
jaroslav@296 | 44 |
public static Object[] create() { |
jaroslav@296 | 45 |
return CompareVMs.create(CompareStringsTest.class); |
jaroslav@296 | 46 |
} |
jaroslav@296 | 47 |
} |