package org.opengroupware.jope.eoaccess.tests;

import org.opengroupware.jope.eoaccess.EODatabase;
import org.opengroupware.jope.eoaccess.EODatabaseDataSource;
import org.opengroupware.jope.foundation.NSObject;

public abstract class EOAccessTest extends NSObject {

  static final String myurl = 
    "jdbc:mysql://localhost/jopetest?user=jopetest&password=jopetest";
  static final String pgurl = 
    "jdbc:postgresql://localhost/jopetest?user=jopetest&password=jopetest";
  
  /* SQL */
  
  static final String createJopeTestContact =
    "CREATE TABLE jopetest_contact ( pkey INT PRIMARY KEY, " +
    "lastname VARCHAR(255), firstname VARCHAR(255), moddate TIMESTAMP )";

  static final String dropJopeTestContact = "DROP TABLE jopetest_contact";

  static final String createJopeTestNotes =
    "CREATE TABLE jopetest_notes ( id INT PRIMARY KEY, " +
    "notetext VARCHAR(255) NOT NULL, contact_id INT)";
  static final String dropJopeTestNotes =
    "DROP TABLE jopetest_notes";

  /* Note: with MySQL we can't send two in one by using ';' separation! */
  static final String fillTable1_1 =
    "INSERT INTO jopetest_contact ( pkey, firstname, lastname ) VALUES (" +
    "1, 'Donald', 'Duck' )";
  static final String fillTable1_2 =
    "INSERT INTO jopetest_contact ( pkey, firstname, lastname ) VALUES (" +
    "2, 'Mickey', 'Mouse' )";
  static final String fillTable2_1 =
    "INSERT INTO jopetest_notes ( id, notetext, contact_id ) VALUES (" +
    "1, 'Hello World', 2 )";
  
  
  /* ivars */

  EODatabase           database;
  EODatabaseDataSource dataSource;
}
