use of org.jmock.Mockery in project gocd by gocd.
the class AntTaskDetectorTest method setUp.
@Before
public void setUp() {
context = new Mockery();
reporter = context.mock(Reporter.class);
detector = new AntTaskDetector(reporter);
}
use of org.jmock.Mockery in project gocd by gocd.
the class AntTestFailureDetectorTest method setUp.
@Before
public void setUp() {
context = new Mockery();
reporter = context.mock(Reporter.class);
detector = new AntTestFailureDetector(reporter);
}
use of org.jmock.Mockery in project gocd by gocd.
the class BuildFailedErrorDetectorTest method setUp.
@Before
public void setUp() {
context = new Mockery();
reporter = context.mock(Reporter.class);
detector = new BuildFailedErrorDetector(reporter);
}
use of org.jmock.Mockery in project gocd by gocd.
the class JobInstanceLogTest method setUp.
@Before
public void setUp() {
context = new Mockery();
context.setImposteriser(ClassImposteriser.INSTANCE);
jobInstanceLog = new JobInstanceLog(null, new HashMap());
defaultLogFile = new LogFile(new File("log20051209122103.xml"));
rootFolder = new File("root");
rootFolder.mkdirs();
env = new SystemEnvironment();
}
use of org.jmock.Mockery in project gocd by gocd.
the class SystemServiceTest method shouldPopulateServerDetailsModel.
@Test
public void shouldPopulateServerDetailsModel() {
Mockery mockery = new Mockery();
final DbMetadataDao dao = mockery.mock(DbMetadataDao.class);
mockery.checking(new Expectations() {
{
one(dao).getSchemaVersion();
will(returnValue(20));
}
});
new SystemEnvironment().setProperty("java.version", "1.5");
new SystemEnvironment().setProperty("os.name", "Linux");
new SystemEnvironment().setProperty("os.version", "2.6");
Map<String, Object> model = new HashMap<>();
new SystemService(dao, null).populateServerDetailsModel(model);
assertThat(model.get("jvm_version"), is("1.5"));
assertThat(model.get("os_info"), is("Linux 2.6"));
assertThat(model.get("schema_version"), is(20));
mockery.assertIsSatisfied();
}
Aggregations