⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mockpagecontext.java

📁 软件测试经典书籍<<Junit in action>>里的源代码。
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
      myGetAttributeStringIntParameter1Values.addExpected(new Integer(arg1));
   }
   public Object getAttribute(String arg0, int arg1){
      myGetAttributeStringIntCalls.inc();
      myGetAttributeStringIntParameter0Values.addActual(arg0);
      myGetAttributeStringIntParameter1Values.addActual(new Integer(arg1));
      Object nextReturnValue = myActualGetAttributeStringIntReturnValues.getNext();
      if (nextReturnValue instanceof ExceptionalReturnValue && ((ExceptionalReturnValue)nextReturnValue).getException() instanceof RuntimeException)
          throw (RuntimeException)((ExceptionalReturnValue)nextReturnValue).getException();
      return (Object) nextReturnValue;
   }
   public void setupExceptionGetAttributeStringInt(Throwable arg){
      myActualGetAttributeStringIntReturnValues.add(new ExceptionalReturnValue(arg));
   }
   public void setupGetAttributeStringInt(Object arg){
      myActualGetAttributeStringIntReturnValues.add(arg);
   }
   public void setExpectedFindAttributeCalls(int calls){
      myFindAttributeCalls.setExpected(calls);
   }
   public void addExpectedFindAttributeValues(String arg0){
      myFindAttributeParameter0Values.addExpected(arg0);
   }
   public Object findAttribute(String arg0){
      myFindAttributeCalls.inc();
      myFindAttributeParameter0Values.addActual(arg0);
      Object nextReturnValue = myActualFindAttributeReturnValues.getNext();
      if (nextReturnValue instanceof ExceptionalReturnValue && ((ExceptionalReturnValue)nextReturnValue).getException() instanceof RuntimeException)
          throw (RuntimeException)((ExceptionalReturnValue)nextReturnValue).getException();
      return (Object) nextReturnValue;
   }
   public void setupExceptionFindAttribute(Throwable arg){
      myActualFindAttributeReturnValues.add(new ExceptionalReturnValue(arg));
   }
   public void setupFindAttribute(Object arg){
      myActualFindAttributeReturnValues.add(arg);
   }
   public void setExpectedRemoveAttributeStringCalls(int calls){
      myRemoveAttributeStringCalls.setExpected(calls);
   }
   public void addExpectedRemoveAttributeStringValues(String arg0){
      myRemoveAttributeStringParameter0Values.addExpected(arg0);
   }
   public void removeAttribute(String arg0){
      myRemoveAttributeStringCalls.inc();
      myRemoveAttributeStringParameter0Values.addActual(arg0);
      Object nextReturnValue = myActualRemoveAttributeStringReturnValues.getNext();
      if (nextReturnValue instanceof ExceptionalReturnValue && ((ExceptionalReturnValue)nextReturnValue).getException() instanceof RuntimeException)
          throw (RuntimeException)((ExceptionalReturnValue)nextReturnValue).getException();
   }
   public void setupExceptionRemoveAttributeString(Throwable arg){
      myActualRemoveAttributeStringReturnValues.add(new ExceptionalReturnValue(arg));
   }
   public void setExpectedRemoveAttributeStringIntCalls(int calls){
      myRemoveAttributeStringIntCalls.setExpected(calls);
   }
   public void addExpectedRemoveAttributeStringIntValues(String arg0, int arg1){
      myRemoveAttributeStringIntParameter0Values.addExpected(arg0);
      myRemoveAttributeStringIntParameter1Values.addExpected(new Integer(arg1));
   }
   public void removeAttribute(String arg0, int arg1){
      myRemoveAttributeStringIntCalls.inc();
      myRemoveAttributeStringIntParameter0Values.addActual(arg0);
      myRemoveAttributeStringIntParameter1Values.addActual(new Integer(arg1));
      Object nextReturnValue = myActualRemoveAttributeStringIntReturnValues.getNext();
      if (nextReturnValue instanceof ExceptionalReturnValue && ((ExceptionalReturnValue)nextReturnValue).getException() instanceof RuntimeException)
          throw (RuntimeException)((ExceptionalReturnValue)nextReturnValue).getException();
   }
   public void setupExceptionRemoveAttributeStringInt(Throwable arg){
      myActualRemoveAttributeStringIntReturnValues.add(new ExceptionalReturnValue(arg));
   }
   public void setExpectedGetAttributesScopeCalls(int calls){
      myGetAttributesScopeCalls.setExpected(calls);
   }
   public void addExpectedGetAttributesScopeValues(String arg0){
      myGetAttributesScopeParameter0Values.addExpected(arg0);
   }
   public int getAttributesScope(String arg0){
      myGetAttributesScopeCalls.inc();
      myGetAttributesScopeParameter0Values.addActual(arg0);
      Object nextReturnValue = myActualGetAttributesScopeReturnValues.getNext();
      if (nextReturnValue instanceof ExceptionalReturnValue && ((ExceptionalReturnValue)nextReturnValue).getException() instanceof RuntimeException)
          throw (RuntimeException)((ExceptionalReturnValue)nextReturnValue).getException();
      return ((Integer) nextReturnValue).intValue();
   }
   public void setupExceptionGetAttributesScope(Throwable arg){
      myActualGetAttributesScopeReturnValues.add(new ExceptionalReturnValue(arg));
   }
   public void setupGetAttributesScope(int arg){
      myActualGetAttributesScopeReturnValues.add(new Integer(arg));
   }
   public void setExpectedGetAttributeNamesInScopeCalls(int calls){
      myGetAttributeNamesInScopeCalls.setExpected(calls);
   }
   public void addExpectedGetAttributeNamesInScopeValues(int arg0){
      myGetAttributeNamesInScopeParameter0Values.addExpected(new Integer(arg0));
   }
   public Enumeration getAttributeNamesInScope(int arg0){
      myGetAttributeNamesInScopeCalls.inc();
      myGetAttributeNamesInScopeParameter0Values.addActual(new Integer(arg0));
      Object nextReturnValue = myActualGetAttributeNamesInScopeReturnValues.getNext();
      if (nextReturnValue instanceof ExceptionalReturnValue && ((ExceptionalReturnValue)nextReturnValue).getException() instanceof RuntimeException)
          throw (RuntimeException)((ExceptionalReturnValue)nextReturnValue).getException();
      return (Enumeration) nextReturnValue;
   }
   public void setupExceptionGetAttributeNamesInScope(Throwable arg){
      myActualGetAttributeNamesInScopeReturnValues.add(new ExceptionalReturnValue(arg));
   }
   public void setupGetAttributeNamesInScope(Enumeration arg){
      myActualGetAttributeNamesInScopeReturnValues.add(arg);
   }
   public void setExpectedGetOutCalls(int calls){
      myGetOutCalls.setExpected(calls);
   }
   public JspWriter getOut(){
      myGetOutCalls.inc();
      Object nextReturnValue = myActualGetOutReturnValues.getNext();
      if (nextReturnValue instanceof ExceptionalReturnValue && ((ExceptionalReturnValue)nextReturnValue).getException() instanceof RuntimeException)
          throw (RuntimeException)((ExceptionalReturnValue)nextReturnValue).getException();
      return (JspWriter) nextReturnValue;
   }
   public void setupExceptionGetOut(Throwable arg){
      myActualGetOutReturnValues.add(new ExceptionalReturnValue(arg));
   }
   public void setupGetOut(JspWriter arg){
      myActualGetOutReturnValues.add(arg);
   }
   public void setExpectedGetSessionCalls(int calls){
      myGetSessionCalls.setExpected(calls);
   }
   public HttpSession getSession(){
      myGetSessionCalls.inc();
      Object nextReturnValue = myActualGetSessionReturnValues.getNext();
      if (nextReturnValue instanceof ExceptionalReturnValue && ((ExceptionalReturnValue)nextReturnValue).getException() instanceof RuntimeException)
          throw (RuntimeException)((ExceptionalReturnValue)nextReturnValue).getException();
      return (HttpSession) nextReturnValue;
   }
   public void setupExceptionGetSession(Throwable arg){
      myActualGetSessionReturnValues.add(new ExceptionalReturnValue(arg));
   }
   public void setupGetSession(HttpSession arg){
      myActualGetSessionReturnValues.add(arg);
   }
   public void setExpectedGetPageCalls(int calls){
      myGetPageCalls.setExpected(calls);
   }
   public Object getPage(){
      myGetPageCalls.inc();
      Object nextReturnValue = myActualGetPageReturnValues.getNext();
      if (nextReturnValue instanceof ExceptionalReturnValue && ((ExceptionalReturnValue)nextReturnValue).getException() instanceof RuntimeException)
          throw (RuntimeException)((ExceptionalReturnValue)nextReturnValue).getException();
      return (Object) nextReturnValue;
   }
   public void setupExceptionGetPage(Throwable arg){
      myActualGetPageReturnValues.add(new ExceptionalReturnValue(arg));
   }
   public void setupGetPage(Object arg){
      myActualGetPageReturnValues.add(arg);
   }
   public void setExpectedGetRequestCalls(int calls){
      myGetRequestCalls.setExpected(calls);
   }
   public ServletRequest getRequest(){
      myGetRequestCalls.inc();
      Object nextReturnValue = myActualGetRequestReturnValues.getNext();
      if (nextReturnValue instanceof ExceptionalReturnValue && ((ExceptionalReturnValue)nextReturnValue).getException() instanceof RuntimeException)
          throw (RuntimeException)((ExceptionalReturnValue)nextReturnValue).getException();
      return (ServletRequest) nextReturnValue;
   }
   public void setupExceptionGetRequest(Throwable arg){
      myActualGetRequestReturnValues.add(new ExceptionalReturnValue(arg));
   }
   public void setupGetRequest(ServletRequest arg){
      myActualGetRequestReturnValues.add(arg);
   }
   public void setExpectedGetResponseCalls(int calls){
      myGetResponseCalls.setExpected(calls);
   }
   public ServletResponse getResponse(){
      myGetResponseCalls.inc();
      Object nextReturnValue = myActualGetResponseReturnValues.getNext();
      if (nextReturnValue instanceof ExceptionalReturnValue && ((ExceptionalReturnValue)nextReturnValue).getException() instanceof RuntimeException)
          throw (RuntimeException)((ExceptionalReturnValue)nextReturnValue).getException();
      return (ServletResponse) nextReturnValue;
   }
   public void setupExceptionGetResponse(Throwable arg){
      myActualGetResponseReturnValues.add(new ExceptionalReturnValue(arg));
   }
   public void setupGetResponse(ServletResponse arg){
      myActualGetResponseReturnValues.add(arg);
   }
   public void setExpectedGetExceptionCalls(int calls){
      myGetExceptionCalls.setExpected(calls);
   }
   public Exception getException(){
      myGetExceptionCalls.inc();
      Object nextReturnValue = myActualGetExceptionReturnValues.getNext();
      if (nextReturnValue instanceof ExceptionalReturnValue && ((ExceptionalReturnValue)nextReturnValue).getException() instanceof RuntimeException)
          throw (RuntimeException)((ExceptionalReturnValue)nextReturnValue).getException();
      return (Exception) nextReturnValue;
   }
   public void setupExceptionGetException(Throwable arg){
      myActualGetExceptionReturnValues.add(new ExceptionalReturnValue(arg));
   }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -