Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2013, devbliss GmbH
   *
   * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
   * in compliance with the License. You may obtain a copy of the License at
   *
   * http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software distributed under the License
  * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
 
 package com.devbliss.doctest.machine;
 
 import java.util.List;
 
 
 
The DocTestMachine offers method to generate a report.
  1. First of all, the beginDoctest(java.lang.String,java.lang.String) method must be called to initialize the report.
  2. Then, the different say methods give the possibility to write some informations into the report by using several templates (Request, response, assert)
  3. The method endDocTest() ends up the generation of the file.

Author(s):
bmary
 
 public interface DocTestMachine {
 
     public static final String NOT_VALID_JSON = "The payload is not a valid json: ";

    
Begins a report if there is no on-going generation.

Parameters:
className The name of the tested class, which is going to be the name of the file.
introduction
 
     void beginDoctest(String fileNameString introduction);

    
Ends up the generation of the report.

 
     void endDocTest() throws Exception;

    
Clears the internal state of the DocTest to be ready for another run.
 
     void prepareDocTest() throws Exception;

    
Writes a new com.devbliss.doctest.items.TextDocItem into the report.

Parameters:
say Text to add
 
     void say(String say);

    
Writes a new com.devbliss.doctest.items.TextDocItem into the report supporting %s replacements.

Parameters:
say
strings
 
     void say(String sayString[] strings);

    
Writes a new com.devbliss.doctest.items.SectionDocItem into the report.

Parameters:
sectionTitle Title of the new section
 
     void sayNextSectionTitle(String sectionTitle);

    
Writes a new com.devbliss.doctest.items.RequestDocItem into the report.

Parameters:
uri
payload
httpRequest
Throws:
org.json.JSONException
 
     void sayRequest(ApiRequest apiRequestString payloadList<StringheadersToShow,
            List<StringcookiesToShowthrows JSONException;

    
Writes a new com.devbliss.doctest.items.AssertDocItem into the report.

Parameters:
condition
    void sayVerify(String condition);

    
Writes a new com.devbliss.doctest.items.JsonDocItem into the report.

Parameters:
preformattedText
    void sayPreformatted(String preformattedText);
    void sayUploadRequest(ApiRequest httpRequestString fileNameString fileBodylong l,
            String mimetypeList<StringheadersToShowList<StringcookiesToShow)
            throws JSONException;

    
Writes a new com.devbliss.doctest.items.ResponseDocItem into the report.

Parameters:
response
Throws:
java.lang.Exception
    void sayResponse(ApiResponse responseList<StringheadersToShowthrows Exception;
New to GrepCode? Check out our FAQ X