summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2011-01-02 14:30:55 -0800
committerShawn O. Pearce <spearce@spearce.org>2011-01-02 14:32:02 -0800
commite026cfab3841141b05640bffb0e59af4ce28816d (patch)
tree181386d55c5302693cbab82073a2a10d8263b720 /org.eclipse.jgit.test
parent117d081f44f8c9f99f60c27cedf5298199b8e8f6 (diff)
downloadjgit-e026cfab3841141b05640bffb0e59af4ce28816d.tar.gz
jgit-e026cfab3841141b05640bffb0e59af4ce28816d.zip
Fix NLSTest and RootLocalTest for JUnit 4
These test classes needed new @Test annotations to be found by the JUnit 4 test runner. Change-Id: I61b6a8ebd468fa2d13fad5bf9cbd8f81a6f67e41 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/nls/NLSTest.java (renamed from org.eclipse.jgit.test/tst/org/eclipse/jgit/nls/TestNLS.java)8
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/nls/RootLocaleTest.java (renamed from org.eclipse.jgit.test/tst/org/eclipse/jgit/stringext/TestStringExternalization.java)53
2 files changed, 42 insertions, 19 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/nls/TestNLS.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/nls/NLSTest.java
index 0ce73c3540..6d81f867ee 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/nls/TestNLS.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/nls/NLSTest.java
@@ -51,8 +51,11 @@ import java.util.Locale;
import java.util.concurrent.BrokenBarrierException;
import java.util.concurrent.CyclicBarrier;
-public class TestNLS {
+import org.junit.Test;
+public class NLSTest {
+
+ @Test
public void testNLSLocale() {
NLS.setLocale(NLS.ROOT_LOCALE);
GermanTranslatedBundle bundle = GermanTranslatedBundle.get();
@@ -63,6 +66,7 @@ public class TestNLS {
assertEquals(Locale.GERMAN, bundle.effectiveLocale());
}
+ @Test
public void testJVMDefaultLocale() {
Locale.setDefault(NLS.ROOT_LOCALE);
NLS.useJVMDefaultLocale();
@@ -75,6 +79,7 @@ public class TestNLS {
assertEquals(Locale.GERMAN, bundle.effectiveLocale());
}
+ @Test
public void testThreadTranslationBundleInheritance() throws InterruptedException {
class T extends Thread {
@@ -100,6 +105,7 @@ public class TestNLS {
assertSame(mainThreadsBundle, t.bundle);
}
+ @Test
public void testParallelThreadsWithDifferentLocales() throws InterruptedException {
final CyclicBarrier barrier = new CyclicBarrier(2);
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/stringext/TestStringExternalization.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/nls/RootLocaleTest.java
index cd2d630466..201f03beb9 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/stringext/TestStringExternalization.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/nls/RootLocaleTest.java
@@ -41,33 +41,50 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-package org.eclipse.jgit.stringext;
+package org.eclipse.jgit.nls;
import org.eclipse.jgit.JGitText;
import org.eclipse.jgit.awtui.UIText;
import org.eclipse.jgit.console.ConsoleText;
import org.eclipse.jgit.http.server.HttpServerText;
import org.eclipse.jgit.iplog.IpLogText;
-import org.eclipse.jgit.nls.NLS;
import org.eclipse.jgit.pgm.CLIText;
+import org.junit.Before;
+import org.junit.Test;
-public class TestStringExternalization {
+public class RootLocaleTest {
+ @Before
+ public void setUp() {
+ NLS.setLocale(NLS.ROOT_LOCALE);
+ }
+
+ @Test
+ public void testJGitText() {
+ NLS.getBundleFor(JGitText.class);
+ }
- private static Class[] translationBundleClasses = new Class[] {
- ConsoleText.class, HttpServerText.class, IpLogText.class, CLIText.class,
- UIText.class, JGitText.class,
- };
+ @Test
+ public void testHttpServerText() {
+ NLS.getBundleFor(HttpServerText.class);
+ }
- /**
- * Verifies that all translation keys are defined in the root resource bundle.
- * <p>
- * This makes sure that all translation bundles will get all strings populated
- * since the string will be found at last in the root resource bundle.
- */
- public void testAllTranslationKeysDefinedInRoot() {
- NLS.setLocale(NLS.ROOT_LOCALE);
- for (Class c : translationBundleClasses) {
- NLS.getBundleFor(c);
- }
+ @Test
+ public void testConsoleText() {
+ NLS.getBundleFor(ConsoleText.class);
+ }
+
+ @Test
+ public void testCLIText() {
+ NLS.getBundleFor(CLIText.class);
+ }
+
+ @Test
+ public void testUIText() {
+ NLS.getBundleFor(UIText.class);
+ }
+
+ @Test
+ public void testIpLogText() {
+ NLS.getBundleFor(IpLogText.class);
}
}