mx4j/src/test/test/mx4j/util WildcardMatchTest.java,NONE,1.1

Jeremy Boynes <[email protected]> Mon, 14 Feb 2005 06:10:32 +0000
Newsgroups gmane.comp.java.mx4j.cvs
Message-ID <[email protected]>
Update of /cvsroot/mx4j/mx4j/src/test/test/mx4j/util
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9983/src/test/test/mx4j/util

Added Files:
	WildcardMatchTest.java 
Log Message:
Fix for [ 1122172 ] Timer must increment seq number

--- NEW FILE: WildcardMatchTest.java ---
/*
 * Copyright (C) The MX4J Contributors.
 * All rights reserved.
 *
 * This software is distributed under the terms of the MX4J License version 1.0.
 * See the terms of the MX4J License in the documentation provided with this software.
 */
package test.mx4j.util;

import junit.framework.TestCase;
import mx4j.util.Utils;

/**
 * @version $Revision: 1.1 $
 */
public class WildcardMatchTest extends TestCase
{
   public void testSingleWildcard()
   {
      assertTrue(Utils.wildcardMatch("*", ""));
      assertTrue(Utils.wildcardMatch("*", "A"));
      assertTrue(Utils.wildcardMatch("*", "ABC"));
   }

   public void testTwoWildcards()
   {
      assertFalse(Utils.wildcardMatch("*D*", ""));
      assertTrue(Utils.wildcardMatch("*D*", "aaaaDbbb"));
      assertTrue(Utils.wildcardMatch("*D*", "aaaaD"));
      assertTrue(Utils.wildcardMatch("*D*", "Dbbb"));
      assertFalse(Utils.wildcardMatch("*D*", "aaabbb"));
   }
}



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click