assertArrayEquals(${expected:array}, ${actual:array});${:importStatic('org.junit.Assert.assertArrayEquals')}This page contains collection of useful code templates ready to use in your Eclipse IDE. This site is part of Public Eclipse Template Respository project which aims to make sharing of Eclipse code templates easy.
Follow simple steps:
assertArrayEquals(${expected:array}, ${actual:array});${:importStatic('org.junit.Assert.assertArrayEquals')}assertEquals(${expected:localVar}, ${actual:localVar});${:importStatic('org.junit.Assert.assertEquals')}assertNull(${localVar});${:importStatic('org.junit.Assert.assertNull')}assertNotNull(${localVar});${:importStatic('org.junit.Assert.assertNotNull')}assertTrue(${localVar});${cursor}${:importStatic('org.junit.Assert.assertTrue')}LOG.debug(${variable} + " <-- ${variable}");LOG.debug("${enclosing_type}.${enclosing_method}()");//$$FALL-THROUGH$$
(${condition:var(boolean)}) ? ${doIfTrue} : ${doIfFalse};${log:field(org.apache.commons.logging.Log,org.slf4j.Logger)}.debug("${cursor}");${log:field(org.apache.commons.logging.Log,org.slf4j.Logger)}.info("${cursor}");@SuppressWarnings("unused")
private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(${enclosing_type}.class);private final Log logger = LogFactory.getLog(getClass());
${log:import(org.apache.commons.logging.Log)}
${logfactory:import(org.apache.commons.logging.LogFactory)}mock(${elemType});
${cursor}${:importStatic('org.mockito.Mockito.*')}verify(${call:localVar}).${cursor}${:importStatic('org.mockito.Mockito.verify')}when(${call:localVar}).${cursor}${:importStatic('org.mockito.Mockito.when')}System.currentTimeMillis();
${imp:import(org.joda.time.DateTimeUtils)}
final long now = DateTimeUtils.currentTimeMillis();${imp:import(org.joda.time.DateTimeUtils)}
final long ${now} = DateTimeUtils.currentTimeMillis();${imp:import(org.joda.time.DateTimeUtils)}
DateTimeUtils.currentTimeMillis();${:import (org.slf4j.Logger, org.slf4j.LoggerFactory)}
private static final Logger logger = LoggerFactory.getLogger(${enclosing_type}.class);${:import (org.slf4j.Logger, org.slf4j.LoggerFactory)}
@SuppressWarnings("unused")
private static final Logger logger = LoggerFactory.getLogger(${enclosing_type}.class);${:import (org.slf4j.Logger, org.slf4j.LoggerFactory)}
private static final Logger LOG = LoggerFactory.getLogger(${enclosing_type}.class);@After
public void tearDown() throws Exception {
${cursor}
}${:import(org.junit.After)}@Before
public void setUp() throws Exception {
${cursor}
}${:import(org.junit.Before)}${returnType} ${result} = (${condition:var(boolean)}) ? ${doIfTrue} : ${doIfFalse};