1   /*
2    * $Id: ObjectUtilsTestCase.java 7976 2007-08-21 14:26:13Z dirk.olmes $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.util;
12  
13  import org.mule.tck.AbstractMuleTestCase;
14  
15  public class ObjectUtilsTestCase extends AbstractMuleTestCase
16  {
17  
18      public void testIdentityToShortString()
19      {
20          assertEquals("null", ObjectUtils.identityToShortString(null));
21  
22          String source = "foo";
23          String description = ObjectUtils.identityToShortString(source);
24          String[] components = StringUtils.split(description, '@');
25  
26          assertNotNull(components);
27          assertEquals(2, components.length);
28          assertEquals("String", components[0]);
29          assertEquals(Integer.toHexString(System.identityHashCode(source)), components[1]);
30      }
31  
32  }