/******************************************************************************
   42Tests
   FT
 
  Copyright (c) 2004, 2005 oliver langer

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

  -------------------------------------------------------------------------
  Modification history

  30.01.2005 ola     initial version
  -------------------------------------------------------------------------
******************************************************************************/


#include <Foundation/Foundation.h>
#include <Encore/Encore.h>
#include <FTCreateDBTEST.h>
#include "FTStartupTEST.h"
#include "FTObjectToIdMapperTEST.h"
#include "FTCreateGraphTEST.h"
#include "FTModifyGraphTEST.h"
#include "FTServiceTEST.h"
#include "FTFileStoreTEST.h"
#include "FTConfigTEST.h"
#include "FTGraphInfoDBTEST.h"
#include "FTGraphManagementTEST.h"


int main( int argc, char *argv[] ) {
  NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init ];
  ECTestSuite *suite;
  BOOL successfulRun = YES;

  NSLog( @"** FTTests" );

  suite = [[[ECTestSuite alloc] init] autorelease];

#if 1
  [suite addTestcase: [[[FTCreateDBTEST alloc] init] autorelease]
    withSelector: @selector(testCreation)]; 

  [suite addTestcase: [[[FTStartupTEST alloc] init] autorelease]
    withSelector:@selector(testStartup)];
#endif

#if 1
  [suite addTestcase: [[[FTObjectToIdMapperTEST alloc] init] autorelease]
    withSelector:@selector(testObjectToIdMapper)];

  [suite addTestcase: [[[FTCreateGraphTEST alloc] init] autorelease]
    withSelector: @selector(testGraphCreation)];
#endif 

#if 1
  [suite addTestcase: [[[FTModifyGraphTEST alloc] init] autorelease]
    withSelector: @selector(testGraphModification)];  
#endif

#if 1
  [suite addTestcase: [[[FTServiceTEST alloc] init] autorelease]
    withSelector: @selector(testServices)]; 
#endif

#if 1
  [suite addTestcase: [[[FTFileStoreTEST alloc] init] autorelease]
    withSelector: @selector(testFileStore)];
#endif
#if 1
  [suite addTestcase: [[[FTConfigTEST alloc] init] autorelease]
    withSelector: @selector(testConfigReader)];
   
  [suite addTestcase: [[[FTGraphInfoDBTEST alloc] init] autorelease]
    withSelector: @selector(testInfoDB)];
#endif

#if 1
  [suite addTestcase: [[[FTGraphManagementTEST alloc] init] autorelease]
    withSelector: @selector(testGraphmanagement)];
#endif

  NS_DURING
    [suite runTestcases];
  NS_HANDLER
    NSLog( @"Got exception: %@", localException );
    successfulRun = NO;
  NS_ENDHANDLER
  
  [pool release];
  
  if( successfulRun ) { 
    NSLog( @">>>>>>>>>>>>>>>>>>>>All Tests run successfully!" );
  } else {
    NSLog( @">>>>>>>>>>>>>>>>>>>>Tests run with (at least one) failure..." );
  }
  
  return 0;
}
