Package siena.base.test.model

Examples of siena.base.test.model.TransactionAccountFrom


    assertNull(accFromAfter);

  }
 
  public void testTransactionSave() {
    TransactionAccountFrom accFrom = new TransactionAccountFrom(1000L);
    pm.insert(accFrom);
 
    try {
      pm.beginTransaction(Connection.TRANSACTION_READ_COMMITTED);
      accFrom.amount-=100L;
      pm.save(accFrom);
      pm.commitTransaction();
    }catch(SienaException e){
      pm.rollbackTransaction();
      fail();
    }finally{
      pm.closeConnection();
    }
   
    TransactionAccountFrom accFromAfter = pm.getByKey(TransactionAccountFrom.class, accFrom.id);
    assertTrue(900L == accFromAfter.amount);
  }
View Full Code Here


    TransactionAccountFrom accFromAfter = pm.getByKey(TransactionAccountFrom.class, accFrom.id);
    assertTrue(900L == accFromAfter.amount);
  }
 
  public void testTransactionSaveFailure() {
    TransactionAccountFrom accFrom = new TransactionAccountFrom(1000L);
    pm.insert(accFrom);
 
    try {
      pm.beginTransaction(Connection.TRANSACTION_READ_COMMITTED);
      accFrom.amount-=100L;
      pm.save(accFrom);
      throw new SienaException("test");
    }catch(SienaException e){
      pm.rollbackTransaction();
    }finally{
      pm.closeConnection();
    }
   
    TransactionAccountFrom accFromAfter = pm.getByKey(TransactionAccountFrom.class, accFrom.id);
    assertTrue(1000L == accFromAfter.amount);
  }
View Full Code Here

    TransactionAccountFrom accFromAfter = pm.getByKey(TransactionAccountFrom.class, accFrom.id);
    assertTrue(1000L == accFromAfter.amount);
  }
 
  public void testTransactionDelete() {
    TransactionAccountFrom accFrom = new TransactionAccountFrom(1000L);
    pm.insert(accFrom);
 
    try {
      pm.beginTransaction(Connection.TRANSACTION_READ_COMMITTED);
      pm.delete(accFrom);
      pm.commitTransaction();
    }catch(SienaException e){
      pm.rollbackTransaction();
      fail();
    }finally{
      pm.closeConnection();
    }
   
    TransactionAccountFrom accFromAfter = pm.getByKey(TransactionAccountFrom.class, accFrom.id);
    assertNull(accFromAfter);
  }
View Full Code Here

    TransactionAccountFrom accFromAfter = pm.getByKey(TransactionAccountFrom.class, accFrom.id);
    assertNull(accFromAfter);
  }
 
  public void testTransactionDeleteFailure() {
    TransactionAccountFrom accFrom = new TransactionAccountFrom(1000L);
    pm.insert(accFrom);
 
    try {
      pm.beginTransaction(Connection.TRANSACTION_READ_COMMITTED);
      pm.delete(accFrom);
      throw new SienaException("test");
    }catch(SienaException e){
      pm.rollbackTransaction();
    }finally{
      pm.closeConnection();
    }
   
    TransactionAccountFrom accFromAfter = pm.getByKey(TransactionAccountFrom.class, accFrom.id);
    assertTrue(1000L == accFromAfter.amount);
  }
View Full Code Here

    TransactionAccountFrom accFromAfter = pm.getByKey(TransactionAccountFrom.class, accFrom.id);
    assertTrue(1000L == accFromAfter.amount);
  }
 
  public void testTransactionInsertBatch() {
    TransactionAccountFrom accFrom = new TransactionAccountFrom(1000L);
 
    try {
      pm.beginTransaction(Connection.TRANSACTION_READ_COMMITTED);
      accFrom.amount=1000L;
      pm.insert(accFrom);
      pm.commitTransaction();
    }catch(SienaException e){
      pm.rollbackTransaction();
      fail();
    }finally{
      pm.closeConnection();
    }
   
    TransactionAccountFrom accFromAfter = pm.getByKey(TransactionAccountFrom.class, accFrom.id);
    assertTrue(1000L == accFromAfter.amount);
  }
View Full Code Here

    TransactionAccountFrom accFromAfter = pm.getByKey(TransactionAccountFrom.class, accFrom.id);
    assertTrue(1000L == accFromAfter.amount);
  }
 
  public void testTransactionInsertBatchFailure() {
    TransactionAccountFrom accFrom = new TransactionAccountFrom(1000L);
 
    try {
      pm.beginTransaction(Connection.TRANSACTION_READ_COMMITTED);
      accFrom.amount=1000L;
      pm.insert(accFrom);
      throw new SienaException("test");
    }catch(SienaException e){
      pm.rollbackTransaction();
    }finally{
      pm.closeConnection();
    }
   
    TransactionAccountFrom accFromAfter = pm.getByKey(TransactionAccountFrom.class, accFrom.id);
    assertNull(accFromAfter);
  }
View Full Code Here

    TransactionAccountFrom accFromAfter = pm.getByKey(TransactionAccountFrom.class, accFrom.id);
    assertNull(accFromAfter);
  }
 
  public void testTransactionDeleteBatch() {
    TransactionAccountFrom accFrom = new TransactionAccountFrom(1000L);
    pm.insert(accFrom);

    try {
      pm.beginTransaction(Connection.TRANSACTION_READ_COMMITTED);
      pm.delete(accFrom);
      pm.commitTransaction();
    }catch(SienaException e){
      pm.rollbackTransaction();
      fail();
    }finally{
      pm.closeConnection();
    }
   
    TransactionAccountFrom accFromAfter = pm.getByKey(TransactionAccountFrom.class, accFrom.id);
    assertNull(accFromAfter);
  }
View Full Code Here

    TransactionAccountFrom accFromAfter = pm.getByKey(TransactionAccountFrom.class, accFrom.id);
    assertNull(accFromAfter);
  }
 
  public void testTransactionDeleteBatchFailure() {
    TransactionAccountFrom accFrom = new TransactionAccountFrom(1000L);
    pm.insert(accFrom);
 
    try {
      pm.beginTransaction(Connection.TRANSACTION_READ_COMMITTED);
      pm.delete(accFrom);
      throw new SienaException("test");
    }catch(SienaException e){
      pm.rollbackTransaction();
    }finally{
      pm.closeConnection();
    }
   
    TransactionAccountFrom accFromAfter = pm.getByKey(TransactionAccountFrom.class, accFrom.id);
    assertTrue(1000L == accFromAfter.amount);
  }
View Full Code Here

    TransactionAccountFrom accFromAfter = pm.getByKey(TransactionAccountFrom.class, accFrom.id);
    assertTrue(1000L == accFromAfter.amount);
  }
 
  public void testTransactionUpdateBatch() {
    TransactionAccountFrom accFrom = new TransactionAccountFrom(1000L);
    pm.insert(accFrom);
 
    try {
      pm.beginTransaction(Connection.TRANSACTION_READ_COMMITTED);
      accFrom.amount-=100L;
      pm.update(accFrom);
      pm.commitTransaction();
    }catch(SienaException e){
      pm.rollbackTransaction();
      fail();
    }finally{
      pm.closeConnection();
    }
   
    TransactionAccountFrom accFromAfter = pm.getByKey(TransactionAccountFrom.class, accFrom.id);
    assertTrue(900L == accFromAfter.amount);
  }
View Full Code Here

    TransactionAccountFrom accFromAfter = pm.getByKey(TransactionAccountFrom.class, accFrom.id);
    assertTrue(900L == accFromAfter.amount);
  }
 
  public void testTransactionUpdateBatchFailure() {
    TransactionAccountFrom accFrom = new TransactionAccountFrom(1000L);
    pm.insert(accFrom);
 
    try {
      pm.beginTransaction(Connection.TRANSACTION_READ_COMMITTED);
      accFrom.amount-=100L;
      throw new SienaException("test");
    }catch(SienaException e){
      pm.rollbackTransaction();
    }finally{
      pm.closeConnection();
    }
   
    TransactionAccountFrom accFromAfter = pm.getByKey(TransactionAccountFrom.class, accFrom.id);
    assertTrue(1000L == accFromAfter.amount);
  }
View Full Code Here

TOP

Related Classes of siena.base.test.model.TransactionAccountFrom

Copyright © 2018 www.massapicom. 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.