author | Jaroslav Tulach <jaroslav.tulach@apidesign.org> |
Wed, 19 Nov 2014 19:32:00 +0100 | |
changeset 1723 | 3a1f262311cf |
parent 1363 | rt/emul/compact/src/test/java/org/apidesign/bck2brwsr/tck/ResourceBundleTest.java@63714859ea5d |
child 1787 | ea12a3bb4b33 |
permissions | -rw-r--r-- |
jaroslav@1337 | 1 |
/** |
jaroslav@1337 | 2 |
* Back 2 Browser Bytecode Translator |
jaroslav@1337 | 3 |
* Copyright (C) 2012 Jaroslav Tulach <jaroslav.tulach@apidesign.org> |
jaroslav@1337 | 4 |
* |
jaroslav@1337 | 5 |
* This program is free software: you can redistribute it and/or modify |
jaroslav@1337 | 6 |
* it under the terms of the GNU General Public License as published by |
jaroslav@1337 | 7 |
* the Free Software Foundation, version 2 of the License. |
jaroslav@1337 | 8 |
* |
jaroslav@1337 | 9 |
* This program is distributed in the hope that it will be useful, |
jaroslav@1337 | 10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
jaroslav@1337 | 11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
jaroslav@1337 | 12 |
* GNU General Public License for more details. |
jaroslav@1337 | 13 |
* |
jaroslav@1337 | 14 |
* You should have received a copy of the GNU General Public License |
jaroslav@1337 | 15 |
* along with this program. Look for COPYING file in the top folder. |
jaroslav@1337 | 16 |
* If not, see http://opensource.org/licenses/GPL-2.0. |
jaroslav@1337 | 17 |
*/ |
jaroslav@1337 | 18 |
package org.apidesign.bck2brwsr.tck; |
jaroslav@1337 | 19 |
|
jaroslav@1337 | 20 |
import java.net.URL; |
jaroslav@1337 | 21 |
import java.util.ResourceBundle; |
jaroslav@1337 | 22 |
import org.apidesign.bck2brwsr.vmtest.Compare; |
jaroslav@1337 | 23 |
import org.apidesign.bck2brwsr.vmtest.VMTest; |
jaroslav@1337 | 24 |
import org.testng.annotations.Factory; |
jaroslav@1337 | 25 |
|
jaroslav@1337 | 26 |
/** |
jaroslav@1337 | 27 |
* |
jaroslav@1337 | 28 |
* @author Jaroslav Tulach <jtulach@netbeans.org> |
jaroslav@1337 | 29 |
*/ |
jaroslav@1337 | 30 |
public class ResourceBundleTest { |
jaroslav@1337 | 31 |
|
jaroslav@1337 | 32 |
@Compare public String readFromBundle() throws Exception { |
jaroslav@1337 | 33 |
ResourceBundle b = ResourceBundle.getBundle("org/apidesign/bck2brwsr/tck/Bundle"); |
jaroslav@1337 | 34 |
return b.getString("KEY"); |
jaroslav@1337 | 35 |
} |
jaroslav@1337 | 36 |
|
jaroslav@1337 | 37 |
@Compare public String toURIFromURL() throws Exception { |
jaroslav@1337 | 38 |
URL u = new URL("http://apidesign.org"); |
jaroslav@1337 | 39 |
return u.toURI().toString(); |
jaroslav@1337 | 40 |
} |
jaroslav@1337 | 41 |
|
jaroslav@1337 | 42 |
@Factory public static Object[] create() { |
jaroslav@1337 | 43 |
return VMTest.create(ResourceBundleTest.class); |
jaroslav@1337 | 44 |
} |
jaroslav@1337 | 45 |
} |