當前位置: 首頁>>代碼示例>>Java>>正文


Java NotTransactional類代碼示例

本文整理匯總了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);
}
 
開發者ID:deathspeeder,項目名稱:class-guard,代碼行數:8,代碼來源:ContainerManagedEntityManagerIntegrationTests.java

示例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.");
}
 
開發者ID:deathspeeder,項目名稱:class-guard,代碼行數:10,代碼來源:ConcreteTransactionalTestNGSpringContextTests.java

示例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.");
}
 
開發者ID:deathspeeder,項目名稱:class-guard,代碼行數:8,代碼來源:ConcreteTransactionalTestNGSpringContextTests.java

示例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.");
}
 
開發者ID:deathspeeder,項目名稱:class-guard,代碼行數:8,代碼來源:ConcreteTransactionalTestNGSpringContextTests.java

示例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.");
}
 
開發者ID:deathspeeder,項目名稱:class-guard,代碼行數:9,代碼來源:ConcreteTransactionalTestNGSpringContextTests.java

示例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.");
}
 
開發者ID:deathspeeder,項目名稱:class-guard,代碼行數:8,代碼來源:ConcreteTransactionalTestNGSpringContextTests.java

示例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);
}
 
開發者ID:deathspeeder,項目名稱:class-guard,代碼行數:8,代碼來源:TimedTransactionalSpringRunnerTests.java

示例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));
}
 
開發者ID:deathspeeder,項目名稱:class-guard,代碼行數:11,代碼來源:ClassLevelTransactionalSpringRunnerTests.java

示例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);
}
 
開發者ID:deathspeeder,項目名稱:class-guard,代碼行數:8,代碼來源:ConcreteTransactionalJUnit4SpringContextTests.java

示例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);
}
 
開發者ID:deathspeeder,項目名稱:class-guard,代碼行數:8,代碼來源:ConcreteTransactionalJUnit4SpringContextTests.java

示例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);
}
 
開發者ID:deathspeeder,項目名稱:class-guard,代碼行數:8,代碼來源:ConcreteTransactionalJUnit4SpringContextTests.java

示例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());
}
 
開發者ID:deathspeeder,項目名稱:class-guard,代碼行數:9,代碼來源:ConcreteTransactionalJUnit4SpringContextTests.java


注:本文中的org.springframework.test.annotation.NotTransactional類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。