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 */ 16 package com.squareup.okhttp.internal.spdy; 17 18 import java.io.IOException; 19 import java.util.List; 20 import okio.BufferedSource; 21 import okio.ByteString; 22 23 import static org.junit.Assert.fail; 24 25 class BaseTestHandler implements FrameReader.Handler { data(boolean inFinished, int streamId, BufferedSource source, int length)26 @Override public void data(boolean inFinished, int streamId, BufferedSource source, int length) 27 throws IOException { 28 fail(); 29 } 30 31 @Override headers(boolean outFinished, boolean inFinished, int streamId, int associatedStreamId, List<Header> headerBlock, HeadersMode headersMode)32 public void headers(boolean outFinished, boolean inFinished, int streamId, int associatedStreamId, 33 List<Header> headerBlock, HeadersMode headersMode) { 34 fail(); 35 } 36 rstStream(int streamId, ErrorCode errorCode)37 @Override public void rstStream(int streamId, ErrorCode errorCode) { 38 fail(); 39 } 40 settings(boolean clearPrevious, Settings settings)41 @Override public void settings(boolean clearPrevious, Settings settings) { 42 fail(); 43 } 44 ackSettings()45 @Override public void ackSettings() { 46 fail(); 47 } 48 ping(boolean ack, int payload1, int payload2)49 @Override public void ping(boolean ack, int payload1, int payload2) { 50 fail(); 51 } 52 goAway(int lastGoodStreamId, ErrorCode errorCode, ByteString debugData)53 @Override public void goAway(int lastGoodStreamId, ErrorCode errorCode, ByteString debugData) { 54 fail(); 55 } 56 windowUpdate(int streamId, long windowSizeIncrement)57 @Override public void windowUpdate(int streamId, long windowSizeIncrement) { 58 fail(); 59 } 60 priority(int streamId, int streamDependency, int weight, boolean exclusive)61 @Override public void priority(int streamId, int streamDependency, int weight, 62 boolean exclusive) { 63 fail(); 64 } 65 66 @Override pushPromise(int streamId, int associatedStreamId, List<Header> headerBlock)67 public void pushPromise(int streamId, int associatedStreamId, List<Header> headerBlock) { 68 fail(); 69 } 70 alternateService(int streamId, String origin, ByteString protocol, String host, int port, long maxAge)71 @Override public void alternateService(int streamId, String origin, ByteString protocol, 72 String host, int port, long maxAge) { 73 fail(); 74 } 75 } 76