示例#1
0
 /**
  * Gets product.
  *
  * @return product
  */
 public Product getProduct() {
   if (product == null) {
     Website website = (Website) getModel();
     Products products = website.getProducts();
     if (productOid != null) {
       product = products.getProduct(productOid);
     }
   }
   return product;
 }
 @AfterClass
 public static void afterTests() throws Exception {
   products.remove(sampleProduct01);
   products.remove(sampleProduct02);
   products.remove(sampleProduct03);
   customers.remove(sampleCustomer);
   invoices.remove(sampleInvoice01);
   invoices.remove(sampleInvoice02);
   invoices.remove(sampleInvoice03);
   TwoadwTest.getSingleton().close();
 }
 @BeforeClass
 public static void beforeTests() throws Exception {
   Website website = TwoadwTest.getSingleton().getTwoadw().getWebsite();
   products = website.getProducts();
   sampleProduct01 = products.createProduct("001", "Product1");
   sampleProduct02 = products.createProduct("002", "Product2");
   sampleProduct03 = products.createProduct("003", "Product3");
   customers = website.getCustomers();
   sampleCustomer = customers.createCustomer("007", "jb", "Bond", "James", "*****@*****.**");
   addresses = sampleCustomer.getAddresss();
   sampleAddress =
       addresses.createAddress(
           sampleCustomer, "99 street", "city", "zipCode", "state", "country", "telephone");
   invoices = sampleAddress.getInvoices();
   sampleInvoice01 = invoices.createInvoice(sampleAddress, "001");
   sampleInvoice02 = invoices.createInvoice(sampleAddress, "002");
   sampleInvoice03 = invoices.createInvoice(sampleAddress, "003");
 }