Index: /FCKeditor.Java/branches/2.4/src/test/java/net/fckeditor/tool/CompatibilityTest.java
===================================================================
--- /FCKeditor.Java/branches/2.4/src/test/java/net/fckeditor/tool/CompatibilityTest.java (revision 1547)
+++ /FCKeditor.Java/branches/2.4/src/test/java/net/fckeditor/tool/CompatibilityTest.java (revision 1547)
@@ -0,0 +1,89 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2008 Frederico Caldeira Knabben
+ *
+ * == BEGIN LICENSE ==
+ *
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ *
+ * - GNU General Public License Version 2 or later (the "GPL")
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * - Mozilla Public License Version 1.1 or later (the "MPL")
+ * http://www.mozilla.org/MPL/MPL-1.1.html
+ *
+ * == END LICENSE ==
+ */
+package net.fckeditor.tool;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+/**
+ * Tests for {@link Compatibility}.
+ * User-Agent-Strings are taken from: http://www.useragentstring.com/pages/useragentstring.php
+ * TODO Add gecko based browser checks, if #1875 is fixed!
+ *
+ * @version $Id$
+ */
+public class CompatibilityTest {
+
+ @Test
+ public void testIE4Win() throws Exception {
+ assertFalse(Compatibility.check("Mozilla/4.0 (compatible; MSIE 4.01; Windows NT 5.0)"));
+ }
+
+ @Test
+ public void testIE522Mac() throws Exception {
+ assertFalse(Compatibility.check("Mozilla/4.0 (compatible; MSIE 5.22; Mac_PowerPC)"));
+ }
+
+ @Test
+ public void testIE55Win98() throws Exception {
+ assertTrue(Compatibility.check("Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)"));
+ }
+
+ @Test
+ public void testIE60WinNT() throws Exception {
+ assertTrue(Compatibility.check("Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows NT 5.1)"));
+ }
+
+ @Test
+ public void testIE70WinVista() throws Exception {
+ assertTrue(Compatibility.check("Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0;)"));
+ }
+
+ @Test
+ public void testIE70bWinVista() throws Exception {
+ assertTrue(Compatibility.check("Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0)"));
+ }
+
+ @Test
+ public void testSafari204OSX() throws Exception {
+ assertFalse(Compatibility.check("Mozilla/5.0 (Macintosh; U; PPC Mac OS X; sv-se) AppleWebKit/419 (KHTML, like Gecko) Safari/419.3"));
+ }
+
+ @Test
+ public void testSafari30WinXP() throws Exception {
+ assertTrue(Compatibility.check("Mozilla/5.0 (Windows; U; Windows NT 5.2; pt) AppleWebKit/522.11.3 (KHTML, like Gecko) Version/3.0 Safari/522.11.3"));
+ }
+
+ @Test
+ public void testSafari302OSX() throws Exception {
+ assertTrue(Compatibility.check("Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en) AppleWebKit/522+ (KHTML, like Gecko) Version/3.0.2 Safari/522.12"));
+ }
+
+ @Test
+ public void testSafari31OSX() throws Exception {
+ assertTrue(Compatibility.check("Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_2; en-au) AppleWebKit/525.8+ (KHTML, like Gecko) Version/3.1 Safari/525.6"));
+ }
+
+// @Test
+// public void testFirefox141Linux() throws Exception {
+// assertFalse(Compatibility.check("Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8b5) Gecko/20051008 Fedora/1.5-0.5.0.beta2 Firefox/1.4.1"));
+// }
+}