package de.mpg.mpiz_koeln.featureClient.test;

import org.biomoby.shared.MobyException;

import de.mpg.mpiz_koeln.featureClient.FeatureClientException;

public class FeatureClientFactory {
    public static void main( String[] args ) throws MobyException, FeatureClientException {
        if ( args.length == 0 ) {
            usage();
            return;
        }

        String toCall = args[ 0 ];

        if ( toCall.equalsIgnoreCase( "ComplexSingleCall" ) ) {
            ComplexSingleCall.main( null );
        }
        else if ( toCall.equalsIgnoreCase( "MultiCallByDefinition" ) ) {
            MultiCallByDefinition.main( null );
        }
        else if ( toCall.equalsIgnoreCase( "MultiCallWithParameters" ) ) {
            MultiCallWithParameters.main( null );
        }
        else if ( toCall.equalsIgnoreCase( "SimpleMultiCall" ) ) {
            SimpleMultiCall.main( null );
        }
        else if ( toCall.equalsIgnoreCase( "SimpleSingleCall" ) ) {
            SimpleSingleCall.main( null );
        }
        else if ( toCall.equalsIgnoreCase( "SingleCallDefinition" ) ) {
            SingleCallDefinition.main( null );
        }
        else if ( toCall.equalsIgnoreCase( "SingleCallWithParameters" ) ) {
            SingleCallWithParameters.main( null );
        }
        else if ( toCall.equalsIgnoreCase( "SingleMultiServiceCall" ) ) {
            SingleMultiServiceCall.main( null );
        }
        else {
            usage();
        }
    }

    private static void usage() {
        System.err.println( "You have to provide the test class to run:" );
        System.err.println( "\tComplexSingleCall - Calls a service once with a complex datatype" );
        System.err.println( "\tMultiCallByDefinition - Calls more services which are found for a specific definition" );
        System.err
                .println( "\tMultiCallWithParameters - Calls a service more than once with different inputs and parameters" );
        System.err.println( "\tSimpleMultiCall - Calls a service more than once" );
        System.err.println( "\tSimpleSingleCall - Calls a service once" );
        System.err.println( "\tSingleCallDefinition - Calls a service once based on a definition" );
        System.err.println( "\tSingleCallWithParameters - Calls a serivce once with parameters" );
        System.err.println( "\tSingleMultiServiceCall - Calls more services once" );
    }
}
