Revision: 9262
          
http://languagetool.svn.sourceforge.net/languagetool/?rev=9262&view=rev
Author:   dnaber
Date:     2013-01-29 22:33:34 +0000 (Tue, 29 Jan 2013)
Log Message:
-----------
adding test for JLanguageTool - needs to be in standalone module as core 
doesn't know about the languages

Modified Paths:
--------------
    
trunk/languagetool/languagetool-core/src/main/java/org/languagetool/JLanguageTool.java

Added Paths:
-----------
    trunk/languagetool/languagetool-standalone/src/test/
    trunk/languagetool/languagetool-standalone/src/test/java/
    trunk/languagetool/languagetool-standalone/src/test/java/org/
    trunk/languagetool/languagetool-standalone/src/test/java/org/languagetool/
    
trunk/languagetool/languagetool-standalone/src/test/java/org/languagetool/JLanguageToolTest.java

Modified: 
trunk/languagetool/languagetool-core/src/main/java/org/languagetool/JLanguageTool.java
===================================================================
--- 
trunk/languagetool/languagetool-core/src/main/java/org/languagetool/JLanguageTool.java
      2013-01-29 22:29:55 UTC (rev 9261)
+++ 
trunk/languagetool/languagetool-core/src/main/java/org/languagetool/JLanguageTool.java
      2013-01-29 22:33:34 UTC (rev 9262)
@@ -260,7 +260,7 @@
   /**
    * Gets the ResourceBundle for the given user interface language.
    */
-  private static ResourceBundle getMessageBundle(final Language lang) {
+  static ResourceBundle getMessageBundle(final Language lang) {
     try {
       ResourceBundle bundle = ResourceBundle.getBundle(MESSAGE_BUNDLE, 
lang.getLocaleWithCountry());
       if (!isValidBundleFor(lang, bundle)) {

Added: 
trunk/languagetool/languagetool-standalone/src/test/java/org/languagetool/JLanguageToolTest.java
===================================================================
--- 
trunk/languagetool/languagetool-standalone/src/test/java/org/languagetool/JLanguageToolTest.java
                            (rev 0)
+++ 
trunk/languagetool/languagetool-standalone/src/test/java/org/languagetool/JLanguageToolTest.java
    2013-01-29 22:33:34 UTC (rev 9262)
@@ -0,0 +1,45 @@
+/* LanguageTool, a natural language style checker 
+ * Copyright (C) 2012 Daniel Naber (http://www.danielnaber.de)
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
+ * USA
+ */
+package org.languagetool;
+
+import org.junit.Test;
+import org.languagetool.language.AmericanEnglish;
+import org.languagetool.language.English;
+import org.languagetool.language.German;
+
+import java.util.ResourceBundle;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class JLanguageToolTest {
+
+  @Test
+  public void testGetMessageBundle() throws Exception {
+    final ResourceBundle bundle1 = JLanguageTool.getMessageBundle(new 
German());
+    assertThat(bundle1.getString("de"), is("Deutsch"));
+
+    final ResourceBundle bundle2 = JLanguageTool.getMessageBundle(new 
English());
+    assertThat(bundle2.getString("de"), is("German"));
+
+    final ResourceBundle bundle3 = JLanguageTool.getMessageBundle(new 
AmericanEnglish());
+    assertThat(bundle3.getString("de"), is("German"));
+  }
+
+}

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
Languagetool-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/languagetool-commits

Reply via email to