use of org.jmock.lib.concurrent.Synchroniser in project geode by apache.
the class SerializableObjectHttpMessageConverterJUnitTest method setUp.
@Before
public void setUp() {
mockContext = new Mockery();
mockContext.setImposteriser(ClassImposteriser.INSTANCE);
mockContext.setThreadingPolicy(new Synchroniser());
}
use of org.jmock.lib.concurrent.Synchroniser in project geode by apache.
the class InitializerJUnitTest method setUp.
@Before
public void setUp() {
mockContext = new Mockery();
mockContext.setImposteriser(ClassImposteriser.INSTANCE);
mockContext.setThreadingPolicy(new Synchroniser());
}
use of org.jmock.lib.concurrent.Synchroniser in project geode by apache.
the class CompiledAggregateFunctionJUnitTest method setUp.
@Before
public void setUp() throws Exception {
context = new Mockery() {
{
setImposteriser(ClassImposteriser.INSTANCE);
setThreadingPolicy(new Synchroniser());
}
};
cache = context.mock(InternalCache.class);
bucketList = new ArrayList();
bucketList.add(1);
}
use of org.jmock.lib.concurrent.Synchroniser in project i2p.i2p-bote by i2p.
the class TestUtil method createConfiguration.
/**
* Creates a mock {@link Configuration} whose getKeyDerivationParametersFile() and
* getPasswordFile() methods must be called at least once each.<br/>
* Creates a file named derivparams in <code>testDir</code>.<br/>
* The <code>getPasswordCacheDuration</code> method returns 1 (one minute).
* @param testDir
*/
public static Configuration createConfiguration(File testDir) {
final Synchroniser synchroniser = new Synchroniser();
Mockery mockery = new Mockery() {
{
setImposteriser(ClassImposteriser.INSTANCE);
// otherwise we get errors on threads
setThreadingPolicy(synchroniser);
}
};
final Configuration configuration = mockery.mock(Configuration.class);
final File derivParametersFile = new File(testDir, "derivparams");
mockery.checking(new Expectations() {
{
atLeast(1).of(configuration).getKeyDerivationParametersFile();
will(returnValue(derivParametersFile));
}
});
final File passwordFile = new File(testDir, "password");
mockery.checking(new Expectations() {
{
atLeast(1).of(configuration).getPasswordFile();
will(returnValue(passwordFile));
}
});
mockery.checking(new Expectations() {
{
allowing(configuration).getPasswordCacheDuration();
will(returnValue(1));
}
});
return configuration;
}
use of org.jmock.lib.concurrent.Synchroniser in project geode by apache.
the class PidFileJUnitTest method before.
@Before
public void before() {
mockContext = new Mockery() {
{
setImposteriser(ClassImposteriser.INSTANCE);
setThreadingPolicy(new Synchroniser());
}
};
this.futures = Executors.newFixedThreadPool(2);
}
Aggregations