7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /**
25 * @test
26 * @bug 4333920 4994372
27 * @run main ChunkedEncodingWithProgressMonitorTest
28 * @summary ChunkedEncoding unit test; MeteredStream/ProgressData problem
29 */
30
31 import java.net.*;
32 import java.util.BitSet;
33 import sun.net.ProgressMeteringPolicy;
34 import sun.net.ProgressMonitor;
35 import sun.net.ProgressListener;
36 import sun.net.ProgressEvent;
37
38 public class ChunkedEncodingWithProgressMonitorTest {
39 public static void main (String[] args) throws Exception {
40 ProgressMonitor.setMeteringPolicy(new MyProgressMeteringPolicy());
41 ProgressListener listener = new MyProgressListener();
42 ProgressMonitor.getDefault().addProgressListener(listener);
43 ChunkedEncodingTest.test();
44 ProgressMonitor.getDefault().removeProgressListener(listener);
45
46 if (flag.cardinality() != 3) {
47 throw new RuntimeException("All three methods in ProgressListener"+
48 " should be called. Yet the number of"+
|
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /**
25 * @test
26 * @bug 4333920 4994372
27 * @summary ChunkedEncoding unit test; MeteredStream/ProgressData problem
28 * @modules java.base/sun.net
29 * @run main ChunkedEncodingWithProgressMonitorTest
30 */
31
32 import java.net.*;
33 import java.util.BitSet;
34 import sun.net.ProgressMeteringPolicy;
35 import sun.net.ProgressMonitor;
36 import sun.net.ProgressListener;
37 import sun.net.ProgressEvent;
38
39 public class ChunkedEncodingWithProgressMonitorTest {
40 public static void main (String[] args) throws Exception {
41 ProgressMonitor.setMeteringPolicy(new MyProgressMeteringPolicy());
42 ProgressListener listener = new MyProgressListener();
43 ProgressMonitor.getDefault().addProgressListener(listener);
44 ChunkedEncodingTest.test();
45 ProgressMonitor.getDefault().removeProgressListener(listener);
46
47 if (flag.cardinality() != 3) {
48 throw new RuntimeException("All three methods in ProgressListener"+
49 " should be called. Yet the number of"+
|