Examples of CallCountingTransactionManager


Examples of org.springframework.tests.transaction.CallCountingTransactionManager

        new AnnotationConfigApplicationContext(Spr11915Config.class);

    TransactionalTestBean bean = ctx.getBean(TransactionalTestBean.class);
    bean.saveQualifiedFoo();

    CallCountingTransactionManager txManager = ctx
        .getBean("qualifiedTransactionManager", CallCountingTransactionManager.class);
    assertThat(txManager.begun, equalTo(1));
    assertThat(txManager.commits, equalTo(1));
    assertThat(txManager.rollbacks, equalTo(0));
  }
View Full Code Here

Examples of org.springframework.tests.transaction.CallCountingTransactionManager

    private ConfigurableApplicationContext applicationContext;

    @PostConstruct
    public void initializeApp() {
      applicationContext.getBeanFactory().registerSingleton(
          "qualifiedTransactionManager", new CallCountingTransactionManager());
    }
View Full Code Here

Examples of org.springframework.tests.transaction.CallCountingTransactionManager

      return new TransactionalTestBean();
    }

    @Bean
    public PlatformTransactionManager txManager() {
      return new CallCountingTransactionManager();
    }
View Full Code Here

Examples of org.springframework.tests.transaction.CallCountingTransactionManager

  @Configuration
  static class MultiTxManagerConfig extends TxManagerConfig implements TransactionManagementConfigurer {

    @Bean
    public PlatformTransactionManager txManager2() {
      return new CallCountingTransactionManager();
    }
View Full Code Here

Examples of org.springframework.tests.transaction.CallCountingTransactionManager

    assertTrue("Stereotype annotation not visible", services.containsKey("testBean"));
  }

  public void testInvokeTransactional() throws Exception {
    TransactionalTestBean testBean = getTestBean();
    CallCountingTransactionManager ptm = (CallCountingTransactionManager) context.getBean("transactionManager");

    // try with transactional
    assertEquals("Should not have any started transactions", 0, ptm.begun);
    testBean.findAllFoos();
    assertEquals("Should have 1 started transaction", 1, ptm.begun);
View Full Code Here

Examples of org.springframework.tests.transaction.CallCountingTransactionManager

    }
  }

  public void testNonPublicMethodsNotAdvised() {
    TransactionalTestBean testBean = getTestBean();
    CallCountingTransactionManager ptm = (CallCountingTransactionManager) context.getBean("transactionManager");

    assertEquals("Should not have any started transactions", 0, ptm.begun);
    testBean.annotationsOnProtectedAreIgnored();
    assertEquals("Should not have any started transactions", 0, ptm.begun);
  }
View Full Code Here

Examples of org.springframework.tests.transaction.CallCountingTransactionManager

  private TransactionInterceptor ti;


  @Override
  public void setUp() {
    this.ptm = new CallCountingTransactionManager();
    this.source = new AnnotationTransactionAttributeSource();
    this.ti = new TransactionInterceptor(this.ptm, this.source);
  }
View Full Code Here

Examples of org.springframework.transaction.CallCountingTransactionManager

  private TransactionInterceptor ti;


  public void setUp() {
    this.ptm = new CallCountingTransactionManager();
    this.source = new AnnotationTransactionAttributeSource();
    this.ti = new TransactionInterceptor(this.ptm, this.source);
  }
View Full Code Here

Examples of org.springframework.transaction.CallCountingTransactionManager

    assertTrue("Stereotype annotation not visible", services.containsKey("testBean"));
  }

  public void testInvokeTransactional() throws Exception {
    TransactionalTestBean testBean = getTestBean();
    CallCountingTransactionManager ptm = (CallCountingTransactionManager) context.getBean("transactionManager");

    // try with transactional
    assertEquals("Should not have any started transactions", 0, ptm.begun);
    testBean.findAllFoos();
    assertEquals("Should have 1 started transaction", 1, ptm.begun);
View Full Code Here

Examples of org.springframework.transaction.CallCountingTransactionManager

    }
  }
 
  public void testNonPublicMethodsNotAdvised() {
    TransactionalTestBean testBean = getTestBean();
    CallCountingTransactionManager ptm = (CallCountingTransactionManager) context.getBean("transactionManager");

    assertEquals("Should not have any started transactions", 0, ptm.begun);
    testBean.annotationsOnProtectedAreIgnored();
    assertEquals("Should not have any started transactions", 0, ptm.begun);   
  }
View Full Code Here
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.