package net.sf.commonclipse;

import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;

import java.util.regex.Pattern;

/**
 * Tests for CCPluginPreferences.
 * @author fgiust
 * @version $Revision$ ($Author$)
 */
public class CCPluginPreferencesTest
{

    /**
     * test the conversion from an array of strings to a regexp.
     */
    public void testRegexpConversion()
    {
        Pattern regexp = CCPluginPreferences.generateRegExp("log;test?u?;done*");
        assertThat(regexp.pattern(), equalTo("(^log$)|(^test.u.$)|(^done*$)"));
    }

    /**
     * test the conversion from an array of strings to a regexp.
     */
    public void testEmptyRegexpConversion()
    {
        Pattern regexp = CCPluginPreferences.generateRegExp("");
        assertFalse(regexp.matcher("").matches());
        assertFalse(regexp.matcher("a").matches());

    }

    /**
     * test the conversion from an array of strings to a regexp.
     */
    public void testNullRegexpConversion()
    {
        Pattern regexp = CCPluginPreferences.generateRegExp(null);
        assertFalse(regexp.matcher("").matches());
        assertFalse(regexp.matcher("a").matches());
    }

}

@@ -189,16 +189,40 @@
 ttern;%0A%0A
+import org.junit.Test;%0A%0A
 /**%0A * T
@@ -420,32 +420,42 @@
 regexp.%0A     */%0A
+    @Test%0A
     public void 
@@ -725,32 +725,42 @@
 regexp.%0A     */%0A
+    @Test%0A
     public void 
@@ -1038,32 +1038,32 @@
 o a regexp.%0A
-
      */%0A
     public v
@@ -1046,24 +1046,34 @@
 xp.%0A     */%0A
+    @Test%0A
     public v

Fix missing @Test annotations for JUnit tests.