1 19 20 package org.netbeans.core.startup; 21 22 import java.io.File ; 23 import java.util.Collections ; 24 import java.util.Locale ; 25 import org.netbeans.Module; 26 import org.netbeans.junit.*; 27 import junit.textui.TestRunner; 28 import org.openide.filesystems.Repository; 29 30 34 public class NbInstallerTest2 extends SetupHid { 35 36 public NbInstallerTest2(String name) { 37 super(name); 38 } 39 40 protected void setUp() throws Exception { 41 super.setUp(); 42 System.setProperty("org.netbeans.core.modules.NbInstaller.noAutoDeps", "true"); 43 } 44 45 46 public void testLocLayerOverrides() throws Exception { 47 Main.getModuleSystem (); final FakeEvents ev = new FakeEvents(); 49 org.netbeans.core.startup.NbInstaller installer = new org.netbeans.core.startup.NbInstaller(ev); 50 org.netbeans.ModuleManager mgr = new org.netbeans.ModuleManager(installer, ev); 51 installer.registerManager(mgr); 52 mgr.mutexPrivileged().enterWriteAccess(); 53 try { 54 Locale orig = Locale.getDefault(); 55 Locale.setDefault(new Locale ("cs", "CZ")); 56 try { 57 Module m1 = mgr.create(new File (jars, "base-layer-mod.jar"), null, false, false, false); 58 assertEquals(Collections.EMPTY_SET, m1.getProblems()); 59 assertEquals(null, slurp("foo/file1.txt")); 60 mgr.enable(m1); 61 assertEquals("prekladany obsah", slurp("foo/file1.txt")); 62 assertEquals("base contents", slurp("foo/file2.txt")); 63 assertEquals("someval", Repository.getDefault().getDefaultFileSystem().findResource("foo/file5.txt").getAttribute("myattr")); 64 mgr.disable(m1); 65 mgr.delete(m1); 66 } finally { 67 Locale.setDefault(orig); 68 } 69 } finally { 70 mgr.mutexPrivileged().exitWriteAccess(); 71 } 72 } 73 74 } 75 | Popular Tags |