hlship      2004/06/09 07:54:55

  Added:       framework/src/test/org/apache/hivemind/util TestIdUtils.java
  Log:
  Refactor some common utilities related to ids into a new class.
  
  Revision  Changes    Path
  1.1                  
jakarta-hivemind/framework/src/test/org/apache/hivemind/util/TestIdUtils.java
  
  Index: TestIdUtils.java
  ===================================================================
  //  Copyright 2004 The Apache Software Foundation
  //
  // Licensed under the Apache License, Version 2.0 (the "License");
  // you may not use this file except in compliance with the License.
  // You may obtain a copy of the License at
  //
  //     http://www.apache.org/licenses/LICENSE-2.0
  //
  // Unless required by applicable law or agreed to in writing, software
  // distributed under the License is distributed on an "AS IS" BASIS,
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  // See the License for the specific language governing permissions and
  // limitations under the License.
  
  package org.apache.hivemind.util;
  
  import org.apache.hivemind.test.HiveMindTestCase;
  
  import junit.framework.TestCase;
  
  /**
   * Tests for [EMAIL PROTECTED] org.apache.hivemind.util.IdUtils}.
   */
  public class TestIdUtils extends HiveMindTestCase
  {
      public void testQualifyId()
      {
          assertEquals("module.Fred", IdUtils.qualify("module", "Fred"));
      }
  
      public void testQualifiedId()
      {
          assertEquals("module.Fred", IdUtils.qualify("zaphod", "module.Fred"));
      }
  
      public void testQualifyList()
      {
          assertEquals(
              "module.Fred,othermodule.Barney,module.Wilma",
              IdUtils.qualifyList("module", 
"Fred,othermodule.Barney,module.Wilma"));
      }
  
      public void testQualifyListStar()
      {
          assertEquals("*", IdUtils.qualifyList("module", "*"));
      }
  
      public void testQualifyListNull()
      {
          assertNull(IdUtils.qualifyList("module", null));
  
          assertEquals("", IdUtils.qualifyList("module", ""));
      }
  }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to