#!/usr/bin/perl
# -----------------------------------------------------------------------------
# TWC
# Treuwert-Computer GmbH
# Schloßbergring 9
# 79098 Freiburg
#
# Author: Klaus Reger <K.Reger@twc.de>
#
# -----------------------------------------------------------------------------
# Program-Data
# -----------------------------------------------------------------------------
# Project  :
# System   :
# Program  :
# Module   : $RCSfile: TestPlugin.t,v $
# Version  : $Revision: 1.1 $
# Date     : $Date: 2002/02/28 15:23:50 $
# State    : $State: Exp $
#
# Description:
#   This module handles all the things of WWWdb, which have
#   to do with Plugin
#
# Change-log (See at end of this file)
#
# --- Known Bugs -------------
# please look at the BUGS-File
# --- TODO -------------------
# please look at the TODO-File
# ----------------------------------------------------------------------------


use DBI;
use WWWdb::Plugin;

$oPluginGL = Plugin->new("TestPlugin0", 1, 1);

printf STDERR "Name: '%s'\n",
    $oPluginGL->getName();

$oPluginGL->ShowAttributes();

$oPluginGL->Dump();


$oPluginGL->Call();
$oPluginGL->Call("1",
                 2 + 3 * 4,
                 $oPluginGL->getName());
$oPluginGL->Call("\'");
$oPluginGL->Call($oPluginGL);


$oPluginGL = Plugin->new("TestPlugin0",
                         "HasPrePost" => 1,
                         "HasMy"      => 0);
$oPluginGL->Dump();
$oPluginGL->Call();

$oPluginGL = Plugin->new("TestPlugin0",
                         "HasPrePost" => 0,
                         "HasMy"      => 1);
$oPluginGL->Dump();
$oPluginGL->Call();

$oPluginGL = Plugin->new("TestPlugin0",
                         "HasPrePost" => 0,
                         "HasMy"      => 0);
$oPluginGL->Dump();
$oPluginGL->Call();

$oPluginGL = Plugin->new("TestPlugin1",
                         "HasPrePost" => 0,
                         "HasMy"      => 0);
$oPluginGL->Dump();
$oPluginGL->Call();

$oPluginGL = Plugin->new("NotAvailable",
                         "HasPrePost" => 1,
                         "HasMy"      => 1);
$oPluginGL->Dump();
$oPluginGL->Call();

$oPluginGL = Plugin->new("TestOnlyMy",
                         "HasPrePost" => 1,
                         "HasMy"      => 1);
$oPluginGL->Dump();
$oPluginGL->Call();

foreach ("Pre", "Post", "My", "Default", "IsNotExistent")
{

   printf STDERR "%s: %s\n", $_, $oPluginGL->IsDefined($_);

}

Plugin->new("TestDynamic",
            "HasPrePost" => 0,
            "HasMy"      => 0)->Call(12345);

$cResult = Plugin->new("TestResult",
                       "HasPrePost" => 0,
                       "HasMy"      => 0)->Call(12345);

printf STDERR "Result of TestResult was '%s'\n", $cResult;

exit 0;

sub PreTestPlugin0 ()
{
   print STDERR "** PreTestPlugin0: @_ called\n";
}

sub PostTestPlugin0 ()
{
   print STDERR "** PostTestPlugin0: @_ called\n";

}

sub MyTestPlugin0 ()
{
   print STDERR "** MyTestPlugin0: @_ called\n";

}

sub TestPlugin0 ()
{
   print STDERR "** TestPlugin0: @_ called\n";

}


sub PreTestPlugin1 ()
{
   print STDERR "** PreTestPlugin1: @_ called\n";
}

sub PostTestPlugin1 ()
{
   print STDERR "** PostTestPlugin1: @_ called\n";

}

sub TestPlugin1 ()
{
   print STDERR "** TestPlugin1: @_ called\n";

}
sub MyTestOnlyMy ()
{
   print STDERR "** MyTestOnlyMy: @_ called\n";

}

sub TestDynamic ()
{
   print STDERR "** TestDynamic: @_ called\n";


}


sub TestResult ()
{
   print STDERR "** TestResult: @_ called\n";

   return "** TestResult: @_ called";

}

