test/jdk/java/net/Socket/setReuseAddress/Basic.java
author igerasim
Thu, 19 Apr 2018 09:36:06 -0700
changeset 49833 06a6ae39d892
parent 49431 5812849b5027
child 54770 62b6e7587b1f
permissions -rw-r--r--
8201510: Merge TwoStacksPlainSocketImpl into DualStackPlainSocketImpl [win] Reviewed-by: chegar
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
49431
5812849b5027 8198358: Align organization of TwoStacksPlainSocketImp with DualStackPlainSocketImpl [win]
igerasim
parents: 47216
diff changeset
     2
 * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
 * @test
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
 * @bug 4476378
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
 * @summary Check the specific behaviour of the setReuseAddress(boolean)
49833
06a6ae39d892 8201510: Merge TwoStacksPlainSocketImpl into DualStackPlainSocketImpl [win]
igerasim
parents: 49431
diff changeset
    28
 *          method.
13043
10fa4f21ea0f 7123896: Unexpected behavior due to Solaris using separate IPv4 and IPv6 port spaces
coffeys
parents: 5506
diff changeset
    29
 * @run main Basic
10fa4f21ea0f 7123896: Unexpected behavior due to Solaris using separate IPv4 and IPv6 port spaces
coffeys
parents: 5506
diff changeset
    30
 * @run main/othervm -Dsun.net.useExclusiveBind Basic
49833
06a6ae39d892 8201510: Merge TwoStacksPlainSocketImpl into DualStackPlainSocketImpl [win]
igerasim
parents: 49431
diff changeset
    31
 * @run main/othervm -Dsun.net.useExclusiveBind=true Basic
49431
5812849b5027 8198358: Align organization of TwoStacksPlainSocketImp with DualStackPlainSocketImpl [win]
igerasim
parents: 47216
diff changeset
    32
 * @run main/othervm -Djava.net.preferIPv4Stack=true Basic
49833
06a6ae39d892 8201510: Merge TwoStacksPlainSocketImpl into DualStackPlainSocketImpl [win]
igerasim
parents: 49431
diff changeset
    33
 * @run main/othervm -Dsun.net.useExclusiveBind
06a6ae39d892 8201510: Merge TwoStacksPlainSocketImpl into DualStackPlainSocketImpl [win]
igerasim
parents: 49431
diff changeset
    34
 *                   -Djava.net.preferIPv4Stack=true Basic
06a6ae39d892 8201510: Merge TwoStacksPlainSocketImpl into DualStackPlainSocketImpl [win]
igerasim
parents: 49431
diff changeset
    35
 * @run main/othervm -Dsun.net.useExclusiveBind=true
06a6ae39d892 8201510: Merge TwoStacksPlainSocketImpl into DualStackPlainSocketImpl [win]
igerasim
parents: 49431
diff changeset
    36
 *                   -Djava.net.preferIPv4Stack=true Basic
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
import java.net.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
public class Basic {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
    static int testCount = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
    static int failures = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
    void test(String msg) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
        testCount++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
        System.out.println("***************************************");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
        System.out.println("Test " + testCount + ": " + msg);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
    void passed() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
        System.out.println("Test passed.");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
    void failed() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
        failures++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
        System.out.println("Test failed.");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
    void check(boolean pass) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
        if (pass) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
            passed();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
            failed();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    void SocketTests() throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
        Socket s1 = new Socket();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
        test("Socket should be created with SO_REUSEADDR disabled");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
        check(!s1.getReuseAddress());
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
        test("Socket.setReuseAddress(true)");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
        s1.setReuseAddress(true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
        check(s1.getReuseAddress());
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
        test("Socket.setReuseAddress(false)");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
        s1.setReuseAddress(false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
        check(!s1.getReuseAddress() );
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
        /* bind to any port */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
        s1.bind( new InetSocketAddress(0) );
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
        test("Binding Socket to port already in use should throw " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
             "a BindException");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
        Socket s2 = new Socket();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
            s2.bind( new InetSocketAddress(s1.getLocalPort()) );
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
            failed();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
        } catch (BindException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
            passed();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
        s2.close();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
        s1.close();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
    void ServerSocketTests() throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
        ServerSocket s1 = new ServerSocket();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
        test("ServerSocket.setReuseAddress(true)");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
        s1.setReuseAddress(true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
        check(s1.getReuseAddress());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
        test("Socket.setReuseAddress(false)");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
        s1.setReuseAddress(false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
        check(!s1.getReuseAddress() );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
        /* bind to any port */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
        s1.bind( new InetSocketAddress(0) );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
        test("Binding ServerSocket to port already in use should throw " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
                "a BindException");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
        ServerSocket s2 = new ServerSocket();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
            s2.bind( new InetSocketAddress(s1.getLocalPort()) );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
            failed();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
        } catch (BindException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
            passed();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
        s2.close();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
        s1.close();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
    void DatagramSocketTests() throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
        DatagramSocket s1 = new DatagramSocket(null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
        test("DatagramSocket should be created with SO_REUSEADDR disabled");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
        check(!s1.getReuseAddress());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
        test("DatagramSocket.setReuseAddress(true)");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
        s1.setReuseAddress(true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
        check(s1.getReuseAddress());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
        test("DatagramSocket.setReuseAddress(false)");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
        s1.setReuseAddress(false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
        check(!s1.getReuseAddress() );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
        /* bind to any port */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
        s1.bind( new InetSocketAddress(0) );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
        test("Binding datagram socket to port already in use should throw " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
             "a BindException");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
        DatagramSocket s2 = new DatagramSocket(null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
            s2.bind( new InetSocketAddress(s1.getLocalPort()) );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
            failed();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
        } catch (BindException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
            passed();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
        s2.close();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
        s1.close();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
        // bind with SO_REUSEADDR enabled
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
        s1 = new DatagramSocket(null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
        s1.setReuseAddress(true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
        s1.bind( new InetSocketAddress(0) );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
        test("Bind 2 datagram sockets to the same port - second " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
             "bind doesn't have SO_REUSEADDR enabled");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
        s2 = new DatagramSocket(null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
            s2.bind( new InetSocketAddress(s1.getLocalPort()) );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
            failed();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
        } catch (BindException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
            passed();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
        s2.close();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
        test("Bind 2 datagram sockets to the same port - both have " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
             "SO_REUSEADDR enabled");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
        s2 = new DatagramSocket(null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
        s2.setReuseAddress(true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
            s2.bind( new InetSocketAddress(s1.getLocalPort()) );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
            passed();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
        } catch (BindException e) {
13043
10fa4f21ea0f 7123896: Unexpected behavior due to Solaris using separate IPv4 and IPv6 port spaces
coffeys
parents: 5506
diff changeset
   181
            if (System.getProperty("sun.net.useExclusiveBind") != null) {
10fa4f21ea0f 7123896: Unexpected behavior due to Solaris using separate IPv4 and IPv6 port spaces
coffeys
parents: 5506
diff changeset
   182
                // exclusive bind enabled - expected result
10fa4f21ea0f 7123896: Unexpected behavior due to Solaris using separate IPv4 and IPv6 port spaces
coffeys
parents: 5506
diff changeset
   183
                passed();
10fa4f21ea0f 7123896: Unexpected behavior due to Solaris using separate IPv4 and IPv6 port spaces
coffeys
parents: 5506
diff changeset
   184
            } else {
10fa4f21ea0f 7123896: Unexpected behavior due to Solaris using separate IPv4 and IPv6 port spaces
coffeys
parents: 5506
diff changeset
   185
                failed();
10fa4f21ea0f 7123896: Unexpected behavior due to Solaris using separate IPv4 and IPv6 port spaces
coffeys
parents: 5506
diff changeset
   186
            }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
        s2.close();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
        s1.close();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
    void MulticastSocketTests() throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
        test("Check SO_REUSEADDR is enabled in MulticastSocket()");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
        MulticastSocket s1 = new MulticastSocket();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
        check(s1.getReuseAddress());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
        s1.close();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
        test("Check that SO_REUSEADDR is not disabled by " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
             "MulticastSocket.bind()");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
        s1 = new MulticastSocket(null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
        // bind to specific address
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
        InetSocketAddress isa = new InetSocketAddress(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
                                   InetAddress.getLocalHost(), 0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
        s1.bind(isa);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
        check(s1.getReuseAddress());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
        s1.close();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
    Basic() throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
        SocketTests();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
        ServerSocketTests();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
        DatagramSocketTests();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
        MulticastSocketTests();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
        System.out.println("***************************************");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
        System.out.println(testCount + " test(s) executed, " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
                           failures + " failure(s).");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
        if (failures > 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
            throw new Exception(failures + " test(s) failed");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
    public static void main(String args[]) throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
        new Basic();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
}