test/sun/net/www/http/ChunkedInputStream/ChunkedEncodingWithProgressMonitorTest.java

Print this page




   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  * @library ../../../../../sun/net/www/httptest/
  28  * @build HttpCallback HttpServer ClosedChannelList HttpTransaction
  29  * @run main ChunkedEncodingWithProgressMonitorTest
  30  * @summary ChunkedEncoding unit test; MeteredStream/ProgressData problem
  31  */
  32 
  33 import java.net.*;
  34 import java.util.BitSet;
  35 import sun.net.ProgressMeteringPolicy;
  36 import sun.net.ProgressMonitor;
  37 import sun.net.ProgressListener;
  38 import sun.net.ProgressEvent;
  39 
  40 public class ChunkedEncodingWithProgressMonitorTest {
  41     public static void main (String[] args) throws Exception {
  42         ProgressMonitor.setMeteringPolicy(new MyProgressMeteringPolicy());
  43         ProgressListener listener = new MyProgressListener();
  44         ProgressMonitor.getDefault().addProgressListener(listener);
  45         ChunkedEncodingTest.test();
  46         ProgressMonitor.getDefault().removeProgressListener(listener);
  47 
  48         if (flag.cardinality() != 3) {




   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) {