Java Doc for ToStringBuilderTest.java in  » Library » Apache-common-lang » org » apache » commons » lang » builder » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Library » Apache common lang » org.apache.commons.lang.builder 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.commons.lang.builder.ToStringBuilderTest

ToStringBuilderTest
public class ToStringBuilderTest extends TestCase (Code)
Unit tests for org.apache.commons.lang.builder.ToStringBuilder .
author:
   Stephen Colebourne
author:
   Gary Gregory
author:
   Alex Chaffee
version:
   $Id: ToStringBuilderTest.java 500495 2007-01-27 07:11:08Z bayard $

Inner Class :static class ReflectionTestFixtureA
Inner Class :static class ReflectionTestFixtureB extends ReflectionTestFixtureA
Inner Class :static class Outer
Inner Class :static class ReflectionTestCycleA
Inner Class :static class ReflectionTestCycleB
Inner Class :static class SimpleReflectionTestFixture
Inner Class :static class ObjectCycle
Inner Class :class ReflectionStaticFieldsFixture
Inner Class :class SimpleReflectionStaticFieldsFixture
Inner Class :class InheritedReflectionStaticFieldsFixture extends SimpleReflectionStaticFieldsFixture


Constructor Summary
public  ToStringBuilderTest(String name)
    

Method Summary
public  voidassertReflectionArray(String expected, Object actual)
    
public static  voidmain(String[] args)
    
protected  voidsetUp()
    
public static  Testsuite()
    
protected  voidtearDown()
    
public  voidtestAppendSuper()
    
public  voidtestAppendToString()
    
public  voidtestBlank()
    
public  voidtestBoolean()
    
public  voidtestBooleanArray()
    
public  voidtestBooleanArrayArray()
    
public  voidtestByte()
    
public  voidtestByteArray()
    
public  voidtestByteArrayArray()
    
public  voidtestChar()
    
public  voidtestCharArray()
    
public  voidtestCharArrayArray()
    
public  voidtestConstructorEx1()
    
public  voidtestConstructorEx2()
    
public  voidtestConstructorEx3()
    
public  voidtestDouble()
    
public  voidtestDoubleArray()
    
public  voidtestDoubleArrayArray()
    
public  voidtestFloat()
    
public  voidtestFloatArray()
    
public  voidtestFloatArrayArray()
    
public  voidtestGetSetDefault()
    
public  voidtestInheritedReflectionStatics()
     Tests ReflectionToStringBuilder.toString() for statics.
public  voidtestInnerClassReflection()
    
public  voidtestInt()
    
public  voidtestIntArray()
    
public  voidtestIntArrayArray()
    
public  voidtestLong()
    
public  voidtestLongArray()
    
public  voidtestLongArrayArray()
    
public  voidtestObject()
    
public  voidtestObjectArray()
    
public  voidtestObjectCycle()
    
public  voidtestReflectionArrayAndObjectCycle()
     Test a nasty combination of arrays and Objects pointing to each other.
public  voidtestReflectionArrayArrayCycle()
    
public  voidtestReflectionArrayCycle()
     Test an array element pointing to its container.
public  voidtestReflectionArrayCycleLevel2()
     Test an array element pointing to its container.
public  voidtestReflectionBoolean()
     Test wrapper for char boolean.
public  voidtestReflectionBooleanArray()
    
public  voidtestReflectionBooleanArrayArray()
    
public  voidtestReflectionByteArrayArray()
    
public  voidtestReflectionCharArray()
    
public  voidtestReflectionCharArrayArray()
    
public  voidtestReflectionCharacter()
     Test wrapper for char primitive.
public  voidtestReflectionDoubleArray()
    
public  voidtestReflectionDoubleArrayArray()
    
public  voidtestReflectionFloatArray()
    
public  voidtestReflectionFloatArrayArray()
    
public  voidtestReflectionHierarchy()
    
public  voidtestReflectionHierarchyArrayList()
    
public  voidtestReflectionIntArray()
    
public  voidtestReflectionIntArrayArray()
    
public  voidtestReflectionInteger()
     Test wrapper for int primitive.
public  voidtestReflectionLongArray()
    
public  voidtestReflectionLongArrayArray()
    
public  voidtestReflectionNull()
    
public  voidtestReflectionObjectArray()
    
public  voidtestReflectionObjectCycle()
     Test Objects pointing to each other.
public  voidtestReflectionShortArray()
    
public  voidtestReflectionStatics()
     Tests ReflectionToStringBuilder.toString() for statics.
public  voidtestReflectionhortArrayArray()
    
public  voidtestReflectionyteArray()
    
public  voidtestSelfInstanceTwoVarsReflectionObjectCycle()
     Test a class that defines an ivar pointing to itself.
public  voidtestSelfInstanceVarReflectionObjectCycle()
     Test a class that defines an ivar pointing to itself.
public  voidtestSetDefaultEx()
    
public  voidtestShort()
    
public  voidtestShortArray()
    
public  voidtestShortArrayArray()
    
public  voidtestSimpleReflectionObjectCycle()
     Test an Object pointing to itself, the simplest test.
public  voidtestSimpleReflectionStatics()
    
public  ObjecttoStringWithStatics(Object object, ToStringStyle style, Class reflectUpToClass)
    

This method uses reflection to build a suitable toString value which includes static fields.

It uses AccessibleObject.setAccessible to gain access to private fields.

 voidvalidateEmptyToStringStyleRegistry()
    


Constructor Detail
ToStringBuilderTest
public ToStringBuilderTest(String name)(Code)




Method Detail
assertReflectionArray
public void assertReflectionArray(String expected, Object actual)(Code)



main
public static void main(String[] args)(Code)



setUp
protected void setUp() throws Exception(Code)



suite
public static Test suite()(Code)



tearDown
protected void tearDown() throws Exception(Code)



testAppendSuper
public void testAppendSuper()(Code)



testAppendToString
public void testAppendToString()(Code)



testBlank
public void testBlank()(Code)



testBoolean
public void testBoolean()(Code)



testBooleanArray
public void testBooleanArray()(Code)



testBooleanArrayArray
public void testBooleanArrayArray()(Code)



testByte
public void testByte()(Code)



testByteArray
public void testByteArray()(Code)



testByteArrayArray
public void testByteArrayArray()(Code)



testChar
public void testChar()(Code)



testCharArray
public void testCharArray()(Code)



testCharArrayArray
public void testCharArrayArray()(Code)



testConstructorEx1
public void testConstructorEx1()(Code)



testConstructorEx2
public void testConstructorEx2()(Code)



testConstructorEx3
public void testConstructorEx3()(Code)



testDouble
public void testDouble()(Code)



testDoubleArray
public void testDoubleArray()(Code)



testDoubleArrayArray
public void testDoubleArrayArray()(Code)



testFloat
public void testFloat()(Code)



testFloatArray
public void testFloatArray()(Code)



testFloatArrayArray
public void testFloatArrayArray()(Code)



testGetSetDefault
public void testGetSetDefault()(Code)



testInheritedReflectionStatics
public void testInheritedReflectionStatics()(Code)
Tests ReflectionToStringBuilder.toString() for statics.



testInnerClassReflection
public void testInnerClassReflection()(Code)



testInt
public void testInt()(Code)



testIntArray
public void testIntArray()(Code)



testIntArrayArray
public void testIntArrayArray()(Code)



testLong
public void testLong()(Code)



testLongArray
public void testLongArray()(Code)



testLongArrayArray
public void testLongArrayArray()(Code)



testObject
public void testObject()(Code)



testObjectArray
public void testObjectArray()(Code)



testObjectCycle
public void testObjectCycle()(Code)



testReflectionArrayAndObjectCycle
public void testReflectionArrayAndObjectCycle() throws Exception(Code)
Test a nasty combination of arrays and Objects pointing to each other. objects[0] -> SimpleReflectionTestFixture[ o -> objects ]
throws:
  Exception -



testReflectionArrayArrayCycle
public void testReflectionArrayArrayCycle() throws Exception(Code)



testReflectionArrayCycle
public void testReflectionArrayCycle() throws Exception(Code)
Test an array element pointing to its container.



testReflectionArrayCycleLevel2
public void testReflectionArrayCycleLevel2() throws Exception(Code)
Test an array element pointing to its container.



testReflectionBoolean
public void testReflectionBoolean()(Code)
Test wrapper for char boolean.



testReflectionBooleanArray
public void testReflectionBooleanArray()(Code)



testReflectionBooleanArrayArray
public void testReflectionBooleanArrayArray()(Code)



testReflectionByteArrayArray
public void testReflectionByteArrayArray()(Code)



testReflectionCharArray
public void testReflectionCharArray()(Code)



testReflectionCharArrayArray
public void testReflectionCharArrayArray()(Code)



testReflectionCharacter
public void testReflectionCharacter()(Code)
Test wrapper for char primitive.



testReflectionDoubleArray
public void testReflectionDoubleArray()(Code)



testReflectionDoubleArrayArray
public void testReflectionDoubleArrayArray()(Code)



testReflectionFloatArray
public void testReflectionFloatArray()(Code)



testReflectionFloatArrayArray
public void testReflectionFloatArrayArray()(Code)



testReflectionHierarchy
public void testReflectionHierarchy()(Code)



testReflectionHierarchyArrayList
public void testReflectionHierarchyArrayList()(Code)



testReflectionIntArray
public void testReflectionIntArray()(Code)



testReflectionIntArrayArray
public void testReflectionIntArrayArray()(Code)



testReflectionInteger
public void testReflectionInteger()(Code)
Test wrapper for int primitive.



testReflectionLongArray
public void testReflectionLongArray()(Code)



testReflectionLongArrayArray
public void testReflectionLongArrayArray()(Code)



testReflectionNull
public void testReflectionNull()(Code)



testReflectionObjectArray
public void testReflectionObjectArray()(Code)



testReflectionObjectCycle
public void testReflectionObjectCycle() throws Exception(Code)
Test Objects pointing to each other.
throws:
  Exception -



testReflectionShortArray
public void testReflectionShortArray()(Code)



testReflectionStatics
public void testReflectionStatics()(Code)
Tests ReflectionToStringBuilder.toString() for statics.



testReflectionhortArrayArray
public void testReflectionhortArrayArray()(Code)



testReflectionyteArray
public void testReflectionyteArray()(Code)



testSelfInstanceTwoVarsReflectionObjectCycle
public void testSelfInstanceTwoVarsReflectionObjectCycle() throws Exception(Code)
Test a class that defines an ivar pointing to itself. This test was created to show that handling cyclical object resulted in a missing endFieldSeparator call.
throws:
  Exception -



testSelfInstanceVarReflectionObjectCycle
public void testSelfInstanceVarReflectionObjectCycle() throws Exception(Code)
Test a class that defines an ivar pointing to itself.
throws:
  Exception -



testSetDefaultEx
public void testSetDefaultEx()(Code)



testShort
public void testShort()(Code)



testShortArray
public void testShortArray()(Code)



testShortArrayArray
public void testShortArrayArray()(Code)



testSimpleReflectionObjectCycle
public void testSimpleReflectionObjectCycle() throws Exception(Code)
Test an Object pointing to itself, the simplest test.
throws:
  Exception -



testSimpleReflectionStatics
public void testSimpleReflectionStatics()(Code)



toStringWithStatics
public Object toStringWithStatics(Object object, ToStringStyle style, Class reflectUpToClass)(Code)

This method uses reflection to build a suitable toString value which includes static fields.

It uses AccessibleObject.setAccessible to gain access to private fields. This means that it will throw a security exception if run under a security manager, if the permissions are not set up correctly. It is also not as efficient as testing explicitly.

Transient fields are not output.

Superclass fields will be appended up to and including the specified superclass. A null superclass is treated as java.lang.Object.

If the style is null, the default ToStringStyle is used.


Parameters:
  object - the Object to be output
Parameters:
  style - the style of the toString to create,may be null
Parameters:
  reflectUpToClass - the superclass to reflect up to (inclusive),may be null the String result
throws:
  IllegalArgumentException - if the Object is null



validateEmptyToStringStyleRegistry
void validateEmptyToStringStyleRegistry()(Code)



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.