junit etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
junit etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
11 Mart 2011 Cuma
How to stop compilation of your gwt project every time you run a GwtTestCase in production (web) mode
When you run a GwtTestCase in production(web) mode , java to javascript compilation is done, whether source files are modified or not. And as already known, java to jaavascript is compilation is very slow. GwtTestCase does not have any option to prevent compilation. I have modified JUnitShell.maybeCompileWebMode method to make compilation depend on VM argument compile. You can download modified JUnitShell from here. You should add -Dcompile=false to the script responsible running for your GwtTestCase.
9 Aralık 2010 Perşembe
How to write spring tests without spring transactional management facility
As you know, Spring 3.0 test framework does not allow transaction demercation . You should use beforeTransaction or afterTransaction method annotations to implement test logic after or before the transaction . But it means that you should write one class for every test method. As a result, the number of your test classes increase dramatically. Well, here is the solution , I have used AbstractJUnit4SpringContextTests instead of AbstractTransactionalJUnit4SpringContextTests.
@ContextConfiguration(value = "/applicationContext.xml")
public class JPASpringTest extends AbstractJUnit4SpringContextTests {
@PersistenceContext(unitName="jpadenemelocal")
EntityManager entityManager;
@Autowired
protected PlatformTransactionManager transactionManager;
@Test
public void testInsertRolManyToMany() {
TransactionStatus status = transactionManager.getTransaction(null);
// your code
transactionManager.commit(status);
}
}
Kaydol:
Kayıtlar (Atom)