本文整理匯總了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());
}