CVS: Tapestry/junit/src/net/sf/tapestry/junit/utils TestLocalizedNameGenerator.java,1.1.2.2,1.1.2.3

Howard Lewis Ship <[email protected]>
Newsgroups gmane.comp.java.tapestry.cvs
Message-ID <[email protected]>
Update of /cvsroot/tapestry/Tapestry/junit/src/net/sf/tapestry/junit/utils
In directory sc8-pr-cvs1:/tmp/cvs-serv28564/junit/src/net/sf/tapestry/junit/utils

Modified Files:
      Tag: hship-2-3
	TestLocalizedNameGenerator.java 
Log Message:
Fix some of the test cases to work properly under JDK 1.3.

Index: TestLocalizedNameGenerator.java
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/junit/src/net/sf/tapestry/junit/utils/Attic/TestLocalizedNameGenerator.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -d -r1.1.2.2 -r1.1.2.3
*** TestLocalizedNameGenerator.java	5 Dec 2002 11:54:01 -0000	1.1.2.2
--- TestLocalizedNameGenerator.java	5 Jan 2003 00:24:52 -0000	1.1.2.3
***************
*** 52,118 ****
          assertEquals("noCountry.zap", g.next());
  
!         assertTrue(!g.more());        
      }
!     
      public void testVariantWithoutCountry()
      {
!         LocalizedNameGenerator g = new
!             LocalizedNameGenerator(
!             "fred",
!             new Locale("en", "", "Geek"),
!             ".foo");
!             
!     assertTrue(g.more());
!     
!     // The double-underscore is correct, it's a kind
!     // of placeholder for the null country.
!     
!     assertEquals("fred_en__Geek.foo", g.next());
!     
!     assertTrue(g.more());
!     assertEquals("fred_en.foo", g.next());
!     
!     assertTrue(    g.more());
!     assertEquals("fred.foo", g.next());
!     
!     assertTrue(!g.more());   
!     }   
!     
      public void testNullLocale()
      {
!          LocalizedNameGenerator g = new LocalizedNameGenerator("nullLocale", null, ".bar");
!          
!          assertTrue(g.more());
!          assertEquals("nullLocale.bar", g.next());
!          
!          assertTrue(!g.more());
      }
!     
      public void testNullSuffix()
      {
!           LocalizedNameGenerator g = new LocalizedNameGenerator("nullSuffix", null, null);
!           
!           assertTrue(g.more());
!           assertEquals("nullSuffix", g.next());
!           
!           assertTrue(!g.more());
      }
!        
!       
!     
      public void testForException()
      {
          LocalizedNameGenerator g = new LocalizedNameGenerator("bob", null, ".foo");
!         
          assertTrue(g.more());
          assertEquals("bob.foo", g.next());
!         
          assertTrue(!g.more());
!         
          try
          {
              g.next();
!             
!          throw new AssertionFailedError("Unreachable.");
          }
          catch (NoSuchElementException ex)
--- 52,115 ----
          assertEquals("noCountry.zap", g.next());
  
!         assertTrue(!g.more());
      }
! 
      public void testVariantWithoutCountry()
      {
!         LocalizedNameGenerator g = new LocalizedNameGenerator("fred", new Locale("en", "", "GEEK"), ".foo");
! 
!         assertTrue(g.more());
! 
!         // The double-underscore is correct, it's a kind
!         // of placeholder for the null country.
!         // JDK1.3 always converts the locale to upper case.  JDK 1.4
!         // does not.  To keep this test happyt, we selected an all-uppercase
!         // locale.
! 
!         assertEquals("fred_en__GEEK.foo", g.next());
! 
!         assertTrue(g.more());
!         assertEquals("fred_en.foo", g.next());
! 
!         assertTrue(g.more());
!         assertEquals("fred.foo", g.next());
! 
!         assertTrue(!g.more());
!     }
! 
      public void testNullLocale()
      {
!         LocalizedNameGenerator g = new LocalizedNameGenerator("nullLocale", null, ".bar");
! 
!         assertTrue(g.more());
!         assertEquals("nullLocale.bar", g.next());
! 
!         assertTrue(!g.more());
      }
! 
      public void testNullSuffix()
      {
!         LocalizedNameGenerator g = new LocalizedNameGenerator("nullSuffix", null, null);
! 
!         assertTrue(g.more());
!         assertEquals("nullSuffix", g.next());
! 
!         assertTrue(!g.more());
      }
! 
      public void testForException()
      {
          LocalizedNameGenerator g = new LocalizedNameGenerator("bob", null, ".foo");
! 
          assertTrue(g.more());
          assertEquals("bob.foo", g.next());
! 
          assertTrue(!g.more());
! 
          try
          {
              g.next();
! 
!             throw new AssertionFailedError("Unreachable.");
          }
          catch (NoSuchElementException ex)



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.