< prev index next >

test/sun/net/www/protocol/http/SetChunkedStreamingMode.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 5049976

  27  * @library ../../httptest/
  28   @build HttpCallback TestHttpServer ClosedChannelList HttpTransaction
  29  * @run main SetChunkedStreamingMode
  30  * @summary Unspecified NPE is thrown when streaming output mode is enabled
  31  */
  32 
  33 import java.io.*;
  34 import java.net.*;
  35 
  36 public class SetChunkedStreamingMode implements HttpCallback {
  37 
  38     void okReply (HttpTransaction req) throws IOException {
  39         req.setResponseEntityBody ("Hello .");
  40         req.sendResponse (200, "Ok");
  41             System.out.println ("Server: sent response");
  42         req.orderlyClose();
  43     }
  44 
  45     public void request (HttpTransaction req) {
  46         try {
  47             okReply (req);
  48         } catch (IOException e) {




   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 5049976
  27  * @modules java.base/sun.net.www
  28  * @library ../../httptest/
  29  * @build HttpCallback TestHttpServer ClosedChannelList HttpTransaction
  30  * @run main SetChunkedStreamingMode
  31  * @summary Unspecified NPE is thrown when streaming output mode is enabled
  32  */
  33 
  34 import java.io.*;
  35 import java.net.*;
  36 
  37 public class SetChunkedStreamingMode implements HttpCallback {
  38 
  39     void okReply (HttpTransaction req) throws IOException {
  40         req.setResponseEntityBody ("Hello .");
  41         req.sendResponse (200, "Ok");
  42             System.out.println ("Server: sent response");
  43         req.orderlyClose();
  44     }
  45 
  46     public void request (HttpTransaction req) {
  47         try {
  48             okReply (req);
  49         } catch (IOException e) {


< prev index next >