PageRenderTime 32ms CodeModel.GetById 22ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/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
Possible License(s): MPL-2.0-no-copyleft-exception
 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
24package jswat.test;
25
26/**
27 * Test code for the MethodBreakpointTest.
28 *
29 * @author  Nathan Fiedler
30 */
31public class MethodBreakpointTestCode {
32    private String value;
33
34    private static void method_MBTC() {
35        String s = "ABC".substring(0, 1);
36    }
37
38    public void method_params(String s, int i, boolean b) {
39        value = s + String.valueOf(i) + String.valueOf(b);
40    }
41
42    public void method_params(char c, double d) {
43        value = String.valueOf(c) + String.valueOf(d);
44    }
45
46    public static void main(String[] args) {
47        method_MBTC();
48        Inner inn = new Inner();
49        inn.method_I();
50        MBSecond.method_MBS();
51        MethodBreakpointTestCode mbtc = new MethodBreakpointTestCode();
52        mbtc.method_params("abc", 123, true);
53        mbtc.method_params('c', 1.0d);
54    }
55
56    protected static class Inner {
57        private String str;
58        
59        public Inner() {
60            str = "abcdef";
61        }
62
63        // Breakpoint at this method.
64        public void method_I() {
65            str = str.substring(2, 4);
66        }
67    }
68}
69
70class MBSecond {
71    private static String str;
72
73    static {
74        str = "12345";
75    }
76
77    // Breakpoint at this method.
78    public static void method_MBS() {
79        str = str.substring(0, 2);
80    }
81}