1 19 20 package com.izforge.izpack; 21 22 import java.io.File ; 23 import java.io.FileInputStream ; 24 import java.util.Iterator ; 25 26 import junit.framework.TestCase; 27 28 34 public class Bin_Langpacks_InstallerTest extends TestCase 35 { 36 private final static String referencePack = "eng.xml"; 37 private final static String basePath= "." + File.separator + 38 "bin" + File.separator + 39 "langpacks" + File.separator + 40 "installer" + File.separator; 41 private static LocaleDatabase reference; 42 private LocaleDatabase check; 43 44 50 public Bin_Langpacks_InstallerTest() throws Exception 51 { 52 this(""); 53 } 54 55 62 public Bin_Langpacks_InstallerTest(String arg0) throws Exception 63 { 64 super(arg0); 65 Bin_Langpacks_InstallerTest.reference = new LocaleDatabase(new FileInputStream (basePath + referencePack)); 66 } 67 68 private void checkLangpack(String langpack) throws Exception { 69 this.check = new LocaleDatabase(new FileInputStream (basePath + langpack)); 70 for (Iterator i = reference.keySet().iterator();i.hasNext();) { 72 String id = (String ) i.next(); 74 assertTrue("Missing translation for id:"+id,this.check.containsKey(id)); 75 } 76 for (Iterator i = this.check.keySet().iterator();i.hasNext();) { 79 String id = (String ) i.next(); 81 assertTrue("Superfluous translation for id:"+id,reference.containsKey(id)); 82 } 83 } 84 92 public void testCat() throws Exception { 93 this.checkLangpack("cat.xml"); 94 } 95 96 104 public void testChn() throws Exception { 105 this.checkLangpack("chn.xml"); 106 } 107 108 116 public void testCze() throws Exception { 117 this.checkLangpack("cze.xml"); 118 } 119 120 128 public void testDan() throws Exception { 129 this.checkLangpack("dan.xml"); 130 } 131 139 public void testDeu() throws Exception { 140 this.checkLangpack("deu.xml"); 141 } 142 150 public void testEll() throws Exception { 151 this.checkLangpack("ell.xml"); 152 } 153 154 163 public void testEng() throws Exception { 164 this.checkLangpack("eng.xml"); 165 } 166 174 public void testFin() throws Exception { 175 this.checkLangpack("fin.xml"); 176 } 177 185 public void testFra() throws Exception { 186 this.checkLangpack("fra.xml"); 187 } 188 196 public void testHun() throws Exception { 197 this.checkLangpack("hun.xml"); 198 } 199 207 public void testInd() throws Exception { 208 this.checkLangpack("ind.xml"); 209 } 210 218 public void testIta() throws Exception { 219 this.checkLangpack("ita.xml"); 220 } 221 229 public void testJpn() throws Exception { 230 this.checkLangpack("jpn.xml"); 231 } 232 240 public void testKor() throws Exception { 241 this.checkLangpack("kor.xml"); 242 } 243 251 public void testMys() throws Exception { 252 this.checkLangpack("mys.xml"); 253 } 254 262 public void testNed() throws Exception { 263 this.checkLangpack("ned.xml"); 264 } 265 273 public void testNor() throws Exception { 274 this.checkLangpack("nor.xml"); 275 } 276 284 public void testPol() throws Exception { 285 this.checkLangpack("pol.xml"); 286 } 287 295 public void testPor() throws Exception { 296 this.checkLangpack("por.xml"); 297 } 298 306 public void testRom() throws Exception { 307 this.checkLangpack("rom.xml"); 308 } 309 317 public void testRus() throws Exception { 318 this.checkLangpack("rus.xml"); 319 } 320 328 public void testScg() throws Exception { 329 this.checkLangpack("scg.xml"); 330 } 331 339 public void testSpa() throws Exception { 340 this.checkLangpack("spa.xml"); 341 } 342 350 public void testSvk() throws Exception { 351 this.checkLangpack("svk.xml"); 352 } 353 361 public void testSwe() throws Exception { 362 this.checkLangpack("swe.xml"); 363 } 364 372 public void testTur() throws Exception { 373 this.checkLangpack("tur.xml"); 374 } 375 383 public void testUkr() throws Exception { 384 this.checkLangpack("ukr.xml"); 385 } 386 } 387 | Popular Tags |