/core/test/unit/src/jswat/test/MethodBreakpointTestCode.java

http://jswat.googlecode.com/ · Java · 81 lines · 40 code · 12 blank · 29 comment · 0 complexity · edf4b0e421b347aa76d3e46d5391272d MD5 · raw file

  1. /*
  2. * The contents of this file are subject to the terms of the Common Development
  3. * and Distribution License (the License). You may not use this file except in
  4. * compliance with the License.
  5. *
  6. * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
  7. * or http://www.netbeans.org/cddl.txt.
  8. *
  9. * When distributing Covered Code, include this CDDL Header Notice in each file
  10. * and include the License file at http://www.netbeans.org/cddl.txt.
  11. * If applicable, add the following below the CDDL Header, with the fields
  12. * enclosed by brackets [] replaced by your own identifying information:
  13. * "Portions Copyrighted [year] [name of copyright owner]"
  14. *
  15. * The Original Software is JSwat. The Initial Developer of the Original
  16. * Software is Nathan L. Fiedler. Portions created by Nathan L. Fiedler
  17. * are Copyright (C) 2004-2006. All Rights Reserved.
  18. *
  19. * Contributor(s): Nathan L. Fiedler.
  20. *
  21. * $Id: MethodBreakpointTestCode.java 40 2009-01-09 07:35:28Z nathanfiedler $
  22. */
  23. package jswat.test;
  24. /**
  25. * Test code for the MethodBreakpointTest.
  26. *
  27. * @author Nathan Fiedler
  28. */
  29. public class MethodBreakpointTestCode {
  30. private String value;
  31. private static void method_MBTC() {
  32. String s = "ABC".substring(0, 1);
  33. }
  34. public void method_params(String s, int i, boolean b) {
  35. value = s + String.valueOf(i) + String.valueOf(b);
  36. }
  37. public void method_params(char c, double d) {
  38. value = String.valueOf(c) + String.valueOf(d);
  39. }
  40. public static void main(String[] args) {
  41. method_MBTC();
  42. Inner inn = new Inner();
  43. inn.method_I();
  44. MBSecond.method_MBS();
  45. MethodBreakpointTestCode mbtc = new MethodBreakpointTestCode();
  46. mbtc.method_params("abc", 123, true);
  47. mbtc.method_params('c', 1.0d);
  48. }
  49. protected static class Inner {
  50. private String str;
  51. public Inner() {
  52. str = "abcdef";
  53. }
  54. // Breakpoint at this method.
  55. public void method_I() {
  56. str = str.substring(2, 4);
  57. }
  58. }
  59. }
  60. class MBSecond {
  61. private static String str;
  62. static {
  63. str = "12345";
  64. }
  65. // Breakpoint at this method.
  66. public static void method_MBS() {
  67. str = str.substring(0, 2);
  68. }
  69. }