Document Triggers

Triggers are small Java classes which check documents for validity. i-net Doqua comes with a set of triggers to do standard tests, e.g. for HTML validation or to check all links for validity.

What do Triggers look like?

Triggers can do any job on a file that you want them to. They only have to implement the interface outlined below.

i-net Doqua comes with a set of default triggers:

Interface specification

package com.inet.doqua.trigger;
 
import junit.framework.TestSuite;
import com.inet.doqua.project.IDocument;
 
/**
 * This interface has to be implemented to use a Class as Trigger for Styles
 * @author i-net software <tools [at] inetsoftware [dot] de>
 *
 */
public interface ITrigger {
 
 
 
    /**
     * Validates a files. Options can be defined in the project style settings to re-use
     * a class sveral times. 
     *
     * @param document file to check
     * @param options options from style definitions
     * @return TestSuite to check the document with.
     */
    TestSuite validate( IDocument document, String options );
 
    /**
     * Function will be called once when starting the test series. This function
     * prepares static content and/or removes old results
     * 
     * @param options options from the project settings
     */
    void startUpSuite(String options);
 
    /**
     * Function will be called once when finisheing the test series. This function
     * can execute final tests over actual results and collected data from this trigger
     * 
     * @param options options from the project settings
     * @return TestSuite with final tests
     */
    TestSuite shutDownSuite(String options);
 
 
    /**
     * This function will be executed per file AFTER all tests. It delivers the result if it 
     * does not return null. So you can finally change the output for a file.
     *
     * @param file file to check
     * @param options options from the project settings
     * @return TestSuite, if there are final tests to do per file
     */
    TestSuite shutDownFile( IDocument document, String options );    
}

What's next?

 

© Copyright 1996 - 2024, i-net software; All Rights Reserved.