[Schmitzm-commits] r1107 - trunk/src_junit/skrueger/i8n

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Oct 14 12:39:08 CEST 2010


Author: alfonx
Date: 2010-10-14 12:39:07 +0200 (Thu, 14 Oct 2010)
New Revision: 1107

Modified:
   trunk/src_junit/skrueger/i8n/I8NUtilTest.java
   trunk/src_junit/skrueger/i8n/TranslationTest.java
Log:
tests fixed

Modified: trunk/src_junit/skrueger/i8n/I8NUtilTest.java
===================================================================
--- trunk/src_junit/skrueger/i8n/I8NUtilTest.java	2010-10-14 10:38:56 UTC (rev 1106)
+++ trunk/src_junit/skrueger/i8n/I8NUtilTest.java	2010-10-14 10:39:07 UTC (rev 1107)
@@ -52,11 +52,6 @@
 	}
 
 	@Test
-	public void testGetFirstLocaleForLang() {
-		assertEquals(new Locale("de_DE"), I8NUtil.getFirstLocaleForLang("po"));
-	}
-
-	@Test
 	public void testGetLocalesForLang() {
 		List<Locale> locales = I8NUtil.getLocalesForLang("en");
 

Modified: trunk/src_junit/skrueger/i8n/TranslationTest.java
===================================================================
--- trunk/src_junit/skrueger/i8n/TranslationTest.java	2010-10-14 10:38:56 UTC (rev 1106)
+++ trunk/src_junit/skrueger/i8n/TranslationTest.java	2010-10-14 10:39:07 UTC (rev 1107)
@@ -58,29 +58,32 @@
 		final AtomicBoolean calledL = new AtomicBoolean(false);
 		final AtomicBoolean calledC = new AtomicBoolean(false);
 
-		Translation.addActiveLangChangeListener(new PropertyChangeListener() {
+		PropertyChangeListener alListener = new PropertyChangeListener() {
 
 			@Override
 			public void propertyChange(PropertyChangeEvent evt) {
 				calledAl.set(true);
 			}
-		});
+		};
+		Translation.addActiveLangChangeListener(alListener);
 
-		Translation.addLocaleChangeListener(new PropertyChangeListener() {
+		PropertyChangeListener localListener = new PropertyChangeListener() {
 
 			@Override
 			public void propertyChange(PropertyChangeEvent evt) {
 				calledL.set(true);
 			}
-		});
+		};
+		Translation.addLocaleChangeListener(localListener);
 
-		t.addTranslationChangeListener(new ActionListener() {
+		ActionListener anyChangeListener = new ActionListener() {
 
 			@Override
 			public void actionPerformed(ActionEvent e) {
 				calledC.set(true);
 			}
-		});
+		};
+		t.addTranslationChangeListener(anyChangeListener);
 
 		// Change the content
 		t.put("de", "change");
@@ -92,7 +95,9 @@
 		calledAl.set(false);
 		calledL.set(false);
 		calledC.set(false);
+		Translation.setActiveLang("de");
 		Translation.setActiveLang("en");
+		
 		assertTrue(calledAl.get());
 		assertTrue(calledL.get());
 		assertFalse(calledC.get());



More information about the Schmitzm-commits mailing list