Revision: 7043
http://languagetool.svn.sourceforge.net/languagetool/?rev=7043&view=rev
Author: milek_pl
Date: 2012-05-23 19:10:27 +0000 (Wed, 23 May 2012)
Log Message:
-----------
more tests to make sure it really works
Modified Paths:
--------------
trunk/JLanguageTool/src/test/org/languagetool/server/HTTPServerTest.java
Modified:
trunk/JLanguageTool/src/test/org/languagetool/server/HTTPServerTest.java
===================================================================
--- trunk/JLanguageTool/src/test/org/languagetool/server/HTTPServerTest.java
2012-05-23 18:46:48 UTC (rev 7042)
+++ trunk/JLanguageTool/src/test/org/languagetool/server/HTTPServerTest.java
2012-05-23 19:10:27 UTC (rev 7043)
@@ -112,7 +112,33 @@
assertTrue(!checkWithOptions(
Language.ENGLISH, Language.GERMAN, "We will berate you",
disableAvsAn, nothing).contains("BERATE"));
+ //test if two rules get enabled as well
+ String[] twoRules = new String[2];
+ twoRules[0] ="EN_A_VS_AN";
+ twoRules[1] = "BERATE";
+
+ String resultEn = checkWithOptions(
+ Language.ENGLISH, Language.GERMAN, "This is an test. We will
berate you.", twoRules, nothing);
+
+ assertTrue(resultEn.contains("EN_A_VS_AN"));
+ assertTrue(resultEn.contains("BERATE"));
+
+ //check two disabled options
+ resultEn = checkWithOptions(
+ Language.ENGLISH, Language.GERMAN, "This is an test. We will
berate you.", nothing, twoRules);
+
+ assertTrue(!resultEn.contains("EN_A_VS_AN"));
+ assertTrue(!resultEn.contains("BERATE"));
+
+ //two disabled, one enabled, so enabled wins
+
+ resultEn = checkWithOptions(
+ Language.ENGLISH, Language.GERMAN, "This is an test. We will
berate you.", disableAvsAn, twoRules);
+
+ assertTrue(resultEn.contains("EN_A_VS_AN"));
+ assertTrue(!resultEn.contains("BERATE"));
+
}
public void testAccessDenied() throws Exception {
@@ -204,7 +230,7 @@
if (s == null || s.length == 0 ) return "";
StringBuilder builder = new StringBuilder(s[0]);
for (int i = 1; i < s.length; i++) {
- builder.append(delimiter).append(s);
+ builder.append(delimiter).append(s[i]);
}
return builder.toString();
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Languagetool-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/languagetool-cvs