use of org.jmock.Expectations in project gradle by gradle.
the class DefaultDomainObjectCollectionTest method allCallsActionForEachNewObject.
@Test
public void allCallsActionForEachNewObject() {
@SuppressWarnings("unchecked") final Action<CharSequence> action = context.mock(Action.class);
context.checking(new Expectations() {
{
oneOf(action).execute("a");
}
});
container.all(action);
container.add("a");
}
use of org.jmock.Expectations in project gradle by gradle.
the class DefaultDomainObjectCollectionTest method callsVetoActionOnceBeforeCollectionIsAdded.
@Test
public void callsVetoActionOnceBeforeCollectionIsAdded() {
final Action<Void> action = Cast.uncheckedCast(context.mock(Action.class));
container.beforeChange(action);
context.checking(new Expectations() {
{
oneOf(action).execute(null);
}
});
container.addAll(toList("a", "b"));
}
use of org.jmock.Expectations in project gradle by gradle.
the class BasePomFilterContainerTest method setUp.
@Before
public void setUp() {
pomFilterMock = context.mock(PomFilter.class);
pomMock = context.mock(MavenPom.class);
publishFilterMock = context.mock(PublishFilter.class);
context.checking(new Expectations() {
{
allowing(mavenPomFactoryMock).create();
will(returnValue(pomMock));
}
});
pomFilterContainer = createPomFilterContainer();
pomFilterContainer.setDefaultPomFilter(pomFilterMock);
}
use of org.jmock.Expectations in project gradle by gradle.
the class BasePomFilterContainerTest method setPom.
@Test
public void setPom() {
context.checking(new Expectations() {
{
allowing(pomFilterMock).setPomTemplate(pomMock);
}
});
pomFilterContainer.setPom(pomMock);
}
use of org.jmock.Expectations in project gradle by gradle.
the class FileCopyActionTest method file.
private FileCopyDetailsInternal file(final RelativePath relativePath, final File targetFile) {
final FileCopyDetailsInternal details = context.mock(FileCopyDetailsInternal.class, relativePath.getPathString());
context.checking(new Expectations() {
{
allowing(details).getRelativePath();
will(returnValue(relativePath));
one(details).copyTo(targetFile);
}
});
return details;
}
Aggregations