本文整理汇总了Java中org.springframework.test.annotation.NotTransactional类的典型用法代码示例。如果您正苦于以下问题:Java NotTransactional类的具体用法?Java NotTransactional怎么用?Java NotTransactional使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NotTransactional类属于org.springframework.test.annotation包,在下文中一共展示了NotTransactional类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testEntityManagerFactoryImplementsEntityManagerFactoryInfo
import org.springframework.test.annotation.NotTransactional; //导入依赖的package包/类
@NotTransactional
public void testEntityManagerFactoryImplementsEntityManagerFactoryInfo() {
assertTrue(Proxy.isProxyClass(entityManagerFactory.getClass()));
assertTrue("Must have introduced config interface",
entityManagerFactory instanceof EntityManagerFactoryInfo);
EntityManagerFactoryInfo emfi = (EntityManagerFactoryInfo) entityManagerFactory;
//assertEquals("Person", emfi.getPersistenceUnitName());
assertNotNull("PersistenceUnitInfo must be available", emfi.getPersistenceUnitInfo());
assertNotNull("Raw EntityManagerFactory must be available", emfi.getNativeEntityManagerFactory());
}
开发者ID:deathspeeder,项目名称:class-guard,代码行数:11,代码来源:AbstractContainerEntityManagerFactoryIntegrationTests.java
示例2: testQueryNoPersonsNotTransactional
import org.springframework.test.annotation.NotTransactional; //导入依赖的package包/类
@NotTransactional
@SuppressWarnings("unchecked")
public void testQueryNoPersonsNotTransactional() {
EntityManager em = entityManagerFactory.createEntityManager();
Query q = em.createQuery("select p from Person as p");
List<Person> people = q.getResultList();
assertEquals(0, people.size());
try {
assertNull(q.getSingleResult());
fail("Should have thrown NoResultException");
}
catch (NoResultException ex) {
// expected
}
}
开发者ID:deathspeeder,项目名称:class-guard,代码行数:16,代码来源:AbstractContainerEntityManagerFactoryIntegrationTests.java
示例3: testExceptionTranslationWithDialectFoundOnEntityManagerFactoryBean
import org.springframework.test.annotation.NotTransactional; //导入依赖的package包/类
@NotTransactional
public void testExceptionTranslationWithDialectFoundOnEntityManagerFactoryBean() throws Exception {
AbstractEntityManagerFactoryBean aefb =
(AbstractEntityManagerFactoryBean) applicationContext.getBean("&entityManagerFactory");
assertNotNull("Dialect must have been set", aefb.getJpaDialect());
doTestExceptionTranslationWithDialectFound(aefb);
}
示例4: verifyApplicationContextSet
import org.springframework.test.annotation.NotTransactional; //导入依赖的package包/类
@Test
@NotTransactional
public void verifyApplicationContextSet() {
assertInTransaction(false);
assertNotNull(super.applicationContext,
"The application context should have been set due to ApplicationContextAware semantics.");
Employee employeeBean = (Employee) super.applicationContext.getBean("employee");
assertEquals(employeeBean.getName(), "John Smith", "employee's name.");
}
示例5: verifyBeanInitialized
import org.springframework.test.annotation.NotTransactional; //导入依赖的package包/类
@Test
@NotTransactional
public void verifyBeanInitialized() {
assertInTransaction(false);
assertTrue(beanInitialized,
"This test instance should have been initialized due to InitializingBean semantics.");
}
示例6: verifyBeanNameSet
import org.springframework.test.annotation.NotTransactional; //导入依赖的package包/类
@Test
@NotTransactional
public void verifyBeanNameSet() {
assertInTransaction(false);
assertEquals(beanName, getClass().getName(),
"The bean name of this test instance should have been set due to BeanNameAware semantics.");
}
示例7: verifyAnnotationAutowiredFields
import org.springframework.test.annotation.NotTransactional; //导入依赖的package包/类
@Test
@NotTransactional
public void verifyAnnotationAutowiredFields() {
assertInTransaction(false);
assertNull(nonrequiredLong, "The nonrequiredLong field should NOT have been autowired.");
assertNotNull(pet, "The pet field should have been autowired.");
assertEquals(pet.getName(), "Fido", "pet's name.");
}
示例8: verifyAnnotationAutowiredMethods
import org.springframework.test.annotation.NotTransactional; //导入依赖的package包/类
@Test
@NotTransactional
public void verifyAnnotationAutowiredMethods() {
assertInTransaction(false);
assertNotNull(employee, "The setEmployee() method should have been autowired.");
assertEquals(employee.getName(), "John Smith", "employee's name.");
}
示例9: autowiringFromConfigClass
import org.springframework.test.annotation.NotTransactional; //导入依赖的package包/类
@Test
@NotTransactional
public void autowiringFromConfigClass() {
assertNotNull(employee, "The employee should have been autowired.");
assertEquals(employee.getName(), "John Smith");
assertNotNull(pet, "The pet should have been autowired.");
assertEquals(pet.getName(), "Fido");
}
开发者ID:deathspeeder,项目名称:class-guard,代码行数:10,代码来源:AnnotationConfigTransactionalTestNGSpringContextTests.java
示例10: notTransactionalWithSpringTimeout
import org.springframework.test.annotation.NotTransactional; //导入依赖的package包/类
@Test
@NotTransactional
@Timed(millis = 10000)
@Repeat(5)
public void notTransactionalWithSpringTimeout() {
assertInTransaction(false);
}
示例11: modifyTestDataWithoutTransaction
import org.springframework.test.annotation.NotTransactional; //导入依赖的package包/类
@Test
@NotTransactional
public void modifyTestDataWithoutTransaction() {
assertInTransaction(false);
assertEquals("Adding luke", 1, addPerson(simpleJdbcTemplate, LUKE));
assertEquals("Adding leia", 1, addPerson(simpleJdbcTemplate, LEIA));
assertEquals("Adding yoda", 1, addPerson(simpleJdbcTemplate, YODA));
assertEquals("Verifying the number of rows in the person table without a transaction.", 4,
countRowsInPersonTable(simpleJdbcTemplate));
}
示例12: verifyApplicationContext
import org.springframework.test.annotation.NotTransactional; //导入依赖的package包/类
@Test
@NotTransactional
public final void verifyApplicationContext() {
assertInTransaction(false);
assertNotNull("The application context should have been set due to ApplicationContextAware semantics.",
super.applicationContext);
}
示例13: verifyBeanInitialized
import org.springframework.test.annotation.NotTransactional; //导入依赖的package包/类
@Test
@NotTransactional
public final void verifyBeanInitialized() {
assertInTransaction(false);
assertTrue("This test bean should have been initialized due to InitializingBean semantics.",
this.beanInitialized);
}
示例14: verifyBeanNameSet
import org.springframework.test.annotation.NotTransactional; //导入依赖的package包/类
@Test
@NotTransactional
public final void verifyBeanNameSet() {
assertInTransaction(false);
assertEquals("The bean name of this test instance should have been set to the fully qualified class name "
+ "due to BeanNameAware semantics.", getClass().getName(), this.beanName);
}
示例15: verifyAnnotationAutowiredFields
import org.springframework.test.annotation.NotTransactional; //导入依赖的package包/类
@Test
@NotTransactional
public final void verifyAnnotationAutowiredFields() {
assertInTransaction(false);
assertNull("The nonrequiredLong property should NOT have been autowired.", this.nonrequiredLong);
assertNotNull("The pet field should have been autowired.", this.pet);
assertEquals("Fido", this.pet.getName());
}