Package de.linwave.junit

Source Code of de.linwave.junit.SetupCustomer

package de.linwave.junit;

import de.linwave.junit.inheritance.Adress;
import de.linwave.junit.inheritance.BankAccount;
import de.linwave.junit.inheritance.Customer;
import de.linwave.junit.inheritance.GoldCustomer;
import de.linwave.junit.inheritance.Person;

public class SetupCustomer extends AbstractTestCase
{
  private static final int MAX = 10;

  /**
   * @param args
   */
  public void init()
  {
    try {
      db.deleteClass(Person.class);
      db.deleteClass(Customer.class);
      db.deleteClass(GoldCustomer.class);
      db.deleteClass(Adress.class);
      db.deleteClass(BankAccount.class);

      for (int i = 0; i < MAX; i++) {
        Person p = new Person("Joeckel", "Lothar");
        db.store(p);

        Customer customer = new Customer("CUST4711", "CUSTOMER");
        customer.setFirstName("customerFirstName");
        customer.setLastName("customerLastname");
        db.store(customer);

        GoldCustomer gold = new GoldCustomer("GOLD4712", "GOLD_CUSTOMER");
        gold.setFirstName("goldCustomerFirstName");
        gold.setLastName("goldCustomerLastname");
        db.store(gold);
      }

    } catch (Exception ex) {
      fail(ex.getMessage());
    }
  }

  public static void main(String[] args)
  {
    SetupCustomer test = new SetupCustomer();
    test.init();
  }
}
TOP

Related Classes of de.linwave.junit.SetupCustomer

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.