1 7 package com.inversoft.junit.internal.http; 8 9 10 import javax.servlet.RequestDispatcher ; 11 import javax.servlet.ServletRequest ; 12 import javax.servlet.ServletResponse ; 13 14 15 22 public class MockRequestDispatcher implements RequestDispatcher { 23 24 private String url; 25 private boolean forward; 26 private boolean include; 27 28 29 32 public MockRequestDispatcher(String url) { 33 this.url = url; 34 } 35 36 37 39 public void forward(ServletRequest request, ServletResponse response) { 40 forward = true; 41 include = false; 42 } 43 44 46 public void include(ServletRequest request, ServletResponse response) { 47 forward = false; 48 include = true; 49 } 50 51 52 56 57 60 public boolean isForwarded() { 61 return forward; 62 } 63 64 67 public boolean isIncluded() { 68 return include; 69 } 70 71 74 public String getURL() { 75 return url; 76 } 77 78 81 public void clearURL() { 82 url = null; 83 } 84 } | Popular Tags |