BaseTestHandler.java revision 3c938a3f6b61ce5e2dba0d039b03fe73b89fd26c
1/* 2 * Copyright (C) 2013 Square, Inc. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16package com.squareup.okhttp.internal.spdy; 17 18import java.io.IOException; 19import java.util.List; 20import okio.BufferedSource; 21import okio.ByteString; 22 23import static org.junit.Assert.fail; 24 25class BaseTestHandler implements FrameReader.Handler { 26 @Override public void data(boolean inFinished, int streamId, BufferedSource source, int length) 27 throws IOException { 28 fail(); 29 } 30 31 @Override 32 public void headers(boolean outFinished, boolean inFinished, int streamId, int associatedStreamId, 33 int priority, List<Header> headerBlock, HeadersMode headersMode) { 34 fail(); 35 } 36 37 @Override public void rstStream(int streamId, ErrorCode errorCode) { 38 fail(); 39 } 40 41 @Override public void settings(boolean clearPrevious, Settings settings) { 42 fail(); 43 } 44 45 @Override public void ackSettings() { 46 fail(); 47 } 48 49 @Override public void ping(boolean ack, int payload1, int payload2) { 50 fail(); 51 } 52 53 @Override public void goAway(int lastGoodStreamId, ErrorCode errorCode, ByteString debugData) { 54 fail(); 55 } 56 57 @Override public void windowUpdate(int streamId, long windowSizeIncrement) { 58 fail(); 59 } 60 61 @Override public void priority(int streamId, int priority) { 62 fail(); 63 } 64 65 @Override 66 public void pushPromise(int streamId, int associatedStreamId, List<Header> headerBlock) { 67 fail(); 68 } 69} 70