~raginggoblin/infolog/infolog

« back to all changes in this revision

Viewing changes to InfologServer/lib/hibernate-distribution-3.3.2.GA/project/core/src/test/java/org/hibernate/util/StringHelperTest.java

  • Committer: Raging Goblin
  • Date: 2013-11-16 16:51:32 UTC
  • Revision ID: raging_goblin-20131116165132-weujnptzc88uy4ah
Mavenized the project, now using shared project InfologSync

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
3
 
 * indicated by the @author tags or express copyright attribution
4
 
 * statements applied by the authors.  All third-party contributions are
5
 
 * distributed under license by Red Hat Middleware LLC.
6
 
 *
7
 
 * This copyrighted material is made available to anyone wishing to use, modify,
8
 
 * copy, or redistribute it subject to the terms and conditions of the GNU
9
 
 * Lesser General Public License, as published by the Free Software Foundation.
10
 
 *
11
 
 * This program is distributed in the hope that it will be useful,
12
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13
 
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
14
 
 * for more details.
15
 
 *
16
 
 * You should have received a copy of the GNU Lesser General Public License
17
 
 * along with this distribution; if not, write to:
18
 
 * Free Software Foundation, Inc.
19
 
 * 51 Franklin Street, Fifth Floor
20
 
 * Boston, MA  02110-1301  USA
21
 
 */
22
 
package org.hibernate.util;
23
 
 
24
 
import junit.framework.TestCase;
25
 
 
26
 
/**
27
 
 * TODO : javadoc
28
 
 *
29
 
 * @author Steve Ebersole
30
 
 */
31
 
public class StringHelperTest extends TestCase {
32
 
        private static final String BASE_PACKAGE = "org.hibernate";
33
 
        private static final String STRING_HELPER_FQN = "org.hibernate.util.StringHelper";
34
 
        private static final String STRING_HELPER_NAME = StringHelper.unqualify( STRING_HELPER_FQN );
35
 
 
36
 
        public void testNameCollapsing() {
37
 
                assertNull( StringHelper.collapse( null ) );
38
 
                assertEquals( STRING_HELPER_NAME, StringHelper.collapse( STRING_HELPER_NAME ) );
39
 
                assertEquals( "o.h.u.StringHelper", StringHelper.collapse( STRING_HELPER_FQN ) );
40
 
        }
41
 
 
42
 
        public void testPartialNameUnqualification() {
43
 
                assertNull( StringHelper.partiallyUnqualify( null, BASE_PACKAGE ) );
44
 
                assertEquals( STRING_HELPER_NAME, StringHelper.partiallyUnqualify( STRING_HELPER_NAME, BASE_PACKAGE ) );
45
 
                assertEquals( "util.StringHelper", StringHelper.partiallyUnqualify( STRING_HELPER_FQN, BASE_PACKAGE ) );
46
 
        }
47
 
 
48
 
        public void testBasePackageCollapsing() {
49
 
                assertNull( StringHelper.collapseQualifierBase( null, BASE_PACKAGE ) );
50
 
                assertEquals( STRING_HELPER_NAME, StringHelper.collapseQualifierBase( STRING_HELPER_NAME, BASE_PACKAGE ) );
51
 
                assertEquals( "o.h.util.StringHelper", StringHelper.collapseQualifierBase( STRING_HELPER_FQN, BASE_PACKAGE ) );
52
 
        }
53
 
}