/light_logs/light_logs/test/OctaneProjectsTest/src/com/octane/util/xml/WSGarbageCollectionLogBuilderTest.java

http://lighttexteditor.googlecode.com/ · Java · 144 lines · 63 code · 9 blank · 72 comment · 6 complexity · 696c53b22bcb76d5275f6163ad02308d MD5 · raw file

  1. package com.octane.util.xml;
  2. import java.util.regex.Matcher;
  3. import junit.framework.*;
  4. /**
  5. * The class <code>WSGarbageCollectionLogBuilderTest</code> contains tests for the class <code>{@link WSGarbageCollectionLogBuilder}</code>.
  6. *
  7. * @generatedBy CodePro at 6/25/09 10:16 AM
  8. * @author Berlin
  9. * @version $Revision: 1.0 $
  10. */
  11. public class WSGarbageCollectionLogBuilderTest extends TestCase {
  12. /**
  13. * An instance of the class being tested.
  14. *
  15. * @see WSGarbageCollectionLogBuilder
  16. *
  17. * @generatedBy CodePro at 6/25/09 10:16 AM
  18. */
  19. private WSGarbageCollectionLogBuilder fixture;
  20. /**
  21. * Return an instance of the class being tested.
  22. *
  23. * @return an instance of the class being tested
  24. *
  25. * @see WSGarbageCollectionLogBuilder
  26. *
  27. * @generatedBy CodePro at 6/25/09 10:16 AM
  28. */
  29. public WSGarbageCollectionLogBuilder getFixture()
  30. throws Exception {
  31. if (fixture == null) {
  32. fixture = new WSGarbageCollectionLogBuilder("1");
  33. }
  34. return fixture;
  35. }
  36. /**
  37. * Run the WSGarbageCollectionLogBuilder(String) constructor test.
  38. *
  39. * @generatedBy CodePro at 6/25/09 10:16 AM
  40. */
  41. public void testWSGarbageCollectionLogBuilder_1()
  42. throws Exception {
  43. String indoc = "1";
  44. WSGarbageCollectionLogBuilder result = new WSGarbageCollectionLogBuilder(indoc);
  45. // add additional test code here
  46. assertNotNull(result);
  47. }
  48. /**
  49. * Run the WSGarbageCollectionLogBuilder(String) constructor test.
  50. *
  51. * @generatedBy CodePro at 6/25/09 10:16 AM
  52. */
  53. public void testWSGarbageCollectionLogBuilder_2()
  54. throws Exception {
  55. String indoc = null;
  56. WSGarbageCollectionLogBuilder result = new WSGarbageCollectionLogBuilder(indoc);
  57. // add additional test code here
  58. assertNotNull(result);
  59. }
  60. /**
  61. * Run the Matcher matchHeader() method test.
  62. *
  63. * @generatedBy CodePro at 6/25/09 10:16 AM
  64. */
  65. public void testMatchHeader_fixture_1()
  66. throws Exception {
  67. WSGarbageCollectionLogBuilder fixture2 = getFixture();
  68. Matcher result = fixture2.matchHeader();
  69. // add additional test code here
  70. assertNotNull(result);
  71. assertEquals(false, result.find());
  72. assertEquals(1, result.groupCount());
  73. assertEquals(true, result.hasAnchoringBounds());
  74. assertEquals(false, result.hasTransparentBounds());
  75. assertEquals(false, result.hitEnd());
  76. assertEquals(false, result.lookingAt());
  77. assertEquals(false, result.matches());
  78. assertEquals(1, result.regionEnd());
  79. assertEquals(0, result.regionStart());
  80. assertEquals(false, result.requireEnd());
  81. assertEquals("java.util.regex.Matcher[pattern=<\\?xml version(.*?)\\?> region=0,1 lastmatch=]", result.toString());
  82. }
  83. /**
  84. * Perform pre-test initialization.
  85. *
  86. * @throws Exception
  87. * if the initialization fails for some reason
  88. *
  89. * @see TestCase#setUp()
  90. *
  91. * @generatedBy CodePro at 6/25/09 10:16 AM
  92. */
  93. protected void setUp()
  94. throws Exception {
  95. super.setUp();
  96. // add additional set up code here
  97. }
  98. /**
  99. * Perform post-test clean-up.
  100. *
  101. * @throws Exception
  102. * if the clean-up fails for some reason
  103. *
  104. * @see TestCase#tearDown()
  105. *
  106. * @generatedBy CodePro at 6/25/09 10:16 AM
  107. */
  108. protected void tearDown()
  109. throws Exception {
  110. super.tearDown();
  111. // Add additional tear down code here
  112. }
  113. /**
  114. * Launch the test.
  115. *
  116. * @param args the command line arguments
  117. *
  118. * @generatedBy CodePro at 6/25/09 10:16 AM
  119. */
  120. public static void main(String[] args) {
  121. if (args.length == 0) {
  122. // Run all of the tests
  123. junit.textui.TestRunner.run(WSGarbageCollectionLogBuilderTest.class);
  124. } else {
  125. // Run only the named tests
  126. TestSuite suite = new TestSuite("Selected tests");
  127. for (int i = 0; i < args.length; i++) {
  128. TestCase test = new WSGarbageCollectionLogBuilderTest();
  129. test.setName(args[i]);
  130. suite.addTest(test);
  131. }
  132. junit.textui.TestRunner.run(suite);
  133. }
  134. }
  135. }