Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbvosburgh2011-07-08 11:55:33 -0400
committerbvosburgh2011-07-08 11:55:33 -0400
commitef8eeb973be9971fabfd7fe692137d64928f35ad (patch)
tree451fa48cff1c4b9dd17cad6e469f5e9b1121f904 /common/tests/org.eclipse.jpt.common.utility.tests
parentcb4c8d3f431c4378723e33339b5f7321b2962348 (diff)
downloadwebtools.dali-ef8eeb973be9971fabfd7fe692137d64928f35ad.tar.gz
webtools.dali-ef8eeb973be9971fabfd7fe692137d64928f35ad.tar.xz
webtools.dali-ef8eeb973be9971fabfd7fe692137d64928f35ad.zip
singleton toString()s
Diffstat (limited to 'common/tests/org.eclipse.jpt.common.utility.tests')
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/StringToolsTests.java23
1 files changed, 22 insertions, 1 deletions
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/StringToolsTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/StringToolsTests.java
index 137b55249a..b34bab2474 100644
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/StringToolsTests.java
+++ b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/StringToolsTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2010 Oracle. All rights reserved.
+ * Copyright (c) 2005, 2011 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -1045,6 +1045,27 @@ public class StringToolsTests extends TestCase {
assertEquals("Object", StringTools.buildToStringClassName(o.getClass()));
}
+ public void testBuildToStringClassName_member() {
+ assertEquals("Map.Entry", StringTools.buildToStringClassName(java.util.Map.Entry.class));
+ }
+
+ public void testBuildToStringClassName_local() {
+ class Foo {
+ Bar bar = new Bar();
+ class Bar {
+ Bar() {
+ super();
+ }
+ }
+ Foo() {
+ super();
+ }
+ }
+ Foo foo = new Foo();
+ assertEquals("StringToolsTests.Foo", StringTools.buildToStringClassName(foo.getClass()));
+ assertEquals("StringToolsTests.Foo.Bar", StringTools.buildToStringClassName(foo.bar.getClass()));
+ }
+
// ********** queries **********
public void testStringIsEmptyString() {

Back to the top