本文整理汇总了Java中org.jmock.integration.junit4.JUnit4Mockery类的典型用法代码示例。如果您正苦于以下问题:Java JUnit4Mockery类的具体用法?Java JUnit4Mockery怎么用?Java JUnit4Mockery使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JUnit4Mockery类属于org.jmock.integration.junit4包,在下文中一共展示了JUnit4Mockery类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: before
import org.jmock.integration.junit4.JUnit4Mockery; //导入依赖的package包/类
@Before
public void before() {
context = new JUnit4Mockery() {{
setImposteriser(ClassImposteriser.INSTANCE);
}};
authorParser = context.mock(AuthorParser.class);
contentParser = context.mock(ContentParser.class);
dataParser = context.mock(DataParser.class);
fieldParser = context.mock(FieldParser.class);
summaryParser = context.mock(SummaryParser.class);
titleParser = context.mock(TitleParser.class);
updatedParser = context.mock(UpdatedParser.class);
entryParser = new EntryParserImpl(authorParser, contentParser, dataParser,
fieldParser, summaryParser, titleParser,
updatedParser);
try {
document = DocumentBuilderFactory.newInstance()
.newDocumentBuilder().newDocument();
} catch (ParserConfigurationException e) {
fail("Failure to create test document");
}
}
示例2: before
import org.jmock.integration.junit4.JUnit4Mockery; //导入依赖的package包/类
@Before
public void before() {
context = new JUnit4Mockery();
ancestorLinksRenderer = context.mock(AncestorLinksRenderer.class);
announcementsRenderer = context.mock(AnnouncementsRenderer.class);
attachmentsRenderer = context.mock(AttachmentsRenderer.class);
commentsRenderer = context.mock(CommentsRenderer.class);
contentRenderer = context.mock(ContentRenderer.class);
fileCabinetRenderer = context.mock(FileCabinetRenderer.class);
listRenderer = context.mock(ListRenderer.class);
subpageLinksRenderer = context.mock(SubpageLinksRenderer.class);
titleRenderer = context.mock(TitleRenderer.class);
exporter = new PageExporterImpl(
ancestorLinksRenderer,
announcementsRenderer,
attachmentsRenderer,
commentsRenderer,
contentRenderer,
fileCabinetRenderer,
listRenderer,
subpageLinksRenderer,
titleRenderer);
out = new StringBuilder();
entryStore = new InMemoryEntryStoreFactory().newEntryStore();
}
示例3: before
import org.jmock.integration.junit4.JUnit4Mockery; //导入依赖的package包/类
@Before
public void before() throws MalformedURLException {
context = new JUnit4Mockery() {{
setImposteriser(ClassImposteriser.INSTANCE);
}};
linkConverter = context.mock(AbsoluteLinkConverter.class);
appendableFactory = context.mock(AppendableFactory.class);
attachmentDownloader = new FakeDownloader();
entryStore = context.mock(EntryStore.class);
entryStoreFactory = context.mock(EntryStoreFactory.class);
feedProvider = context.mock(FeedProvider.class);
pageExporter = context.mock(PageExporter.class);
progressListener = context.mock(ProgressListener.class);
revisionsExporter = context.mock(RevisionsExporter.class);
siteExporter = new SiteExporterImpl(linkConverter, appendableFactory,
attachmentDownloader, entryStoreFactory, feedProvider, pageExporter,
revisionsExporter);
sitesService = new SitesService("");
entries = Sets.newHashSet();
feedUrl = new URL("https://host/feeds/content/domain/webspace");
}
示例4: beginShouldTriggerEnterOnTheVisitor
import org.jmock.integration.junit4.JUnit4Mockery; //导入依赖的package包/类
@Test
public void beginShouldTriggerEnterOnTheVisitor() {
final Mockery context = new JUnit4Mockery();
final Assembly system = new Assembly(new Component("A"));
final AssemblyVisitor visitor = context.mock(AssemblyVisitor.class);
context.checking(new Expectations() {
{
oneOf(visitor).enter(system);
}
});
system.begin(visitor);
context.assertIsSatisfied();
}
示例5: endShouldTriggerExitOnTheVisitor
import org.jmock.integration.junit4.JUnit4Mockery; //导入依赖的package包/类
@Test
public void endShouldTriggerExitOnTheVisitor() {
final Mockery context = new JUnit4Mockery();
final Assembly system = new Assembly(new Component("A"));
final AssemblyVisitor visitor = context.mock(AssemblyVisitor.class);
context.checking(new Expectations() {
{
oneOf(visitor).exit(system);
}
});
system.end(visitor);
context.assertIsSatisfied();
}
示例6: beginShouldTriggerEnterOnTheVisitor
import org.jmock.integration.junit4.JUnit4Mockery; //导入依赖的package包/类
@Test
public void beginShouldTriggerEnterOnTheVisitor() {
final Mockery context = new JUnit4Mockery();
final Conjunction conjunction = RequirementSamples.conjunction();
final AssemblyVisitor visitor = context.mock(AssemblyVisitor.class);
context.checking(new Expectations() {
{
oneOf(visitor).enter(conjunction);
}
});
conjunction.begin(visitor);
context.assertIsSatisfied();
}
示例7: endShouldTriggerEnterOnTheVisitor
import org.jmock.integration.junit4.JUnit4Mockery; //导入依赖的package包/类
@Test
public void endShouldTriggerEnterOnTheVisitor() {
final Mockery context = new JUnit4Mockery();
final Conjunction conjunction = RequirementSamples.conjunction();
final AssemblyVisitor visitor = context.mock(AssemblyVisitor.class);
context.checking(new Expectations() {
{
oneOf(visitor).exit(conjunction);
}
});
conjunction.end(visitor);
context.assertIsSatisfied();
}
示例8: beginShouldTriggerEnterOnTheVisitor
import org.jmock.integration.junit4.JUnit4Mockery; //导入依赖的package包/类
@Test
public void beginShouldTriggerEnterOnTheVisitor() {
final Mockery context = new JUnit4Mockery();
final Negation negation = RequirementSamples.negation();
final AssemblyVisitor visitor = context.mock(AssemblyVisitor.class);
context.checking(new Expectations() {
{
oneOf(visitor).enter(negation);
}
});
negation.begin(visitor);
context.assertIsSatisfied();
}
示例9: endShouldTriggerEnterOnTheVisitor
import org.jmock.integration.junit4.JUnit4Mockery; //导入依赖的package包/类
@Test
public void endShouldTriggerEnterOnTheVisitor() {
final Mockery context = new JUnit4Mockery();
final Negation negation = RequirementSamples.negation();
final AssemblyVisitor visitor = context.mock(AssemblyVisitor.class);
context.checking(new Expectations() {
{
oneOf(visitor).exit(negation);
}
});
negation.end(visitor);
context.assertIsSatisfied();
}
示例10: beginShouldTriggerEnterOnTheVisitor
import org.jmock.integration.junit4.JUnit4Mockery; //导入依赖的package包/类
@Test
public void beginShouldTriggerEnterOnTheVisitor() {
final Mockery context = new JUnit4Mockery();
final Nothing nothing = Nothing.getInstance();
final AssemblyVisitor visitor = context.mock(AssemblyVisitor.class);
context.checking(new Expectations() {
{
oneOf(visitor).enter(nothing);
}
});
nothing.begin(visitor);
context.assertIsSatisfied();
}
示例11: endShouldTriggerEnterOnTheVisitor
import org.jmock.integration.junit4.JUnit4Mockery; //导入依赖的package包/类
@Test
public void endShouldTriggerEnterOnTheVisitor() {
final Mockery context = new JUnit4Mockery();
final Nothing nothing = Nothing.getInstance();
final AssemblyVisitor visitor = context.mock(AssemblyVisitor.class);
context.checking(new Expectations() {
{
oneOf(visitor).exit(nothing);
}
});
nothing.end(visitor);
context.assertIsSatisfied();
}
示例12: beginShouldTriggerEnterOnTheVisitor
import org.jmock.integration.junit4.JUnit4Mockery; //导入依赖的package包/类
@Test
public void beginShouldTriggerEnterOnTheVisitor() {
final Mockery context = new JUnit4Mockery();
final Require sut = RequirementSamples.require();
final AssemblyVisitor visitor = context.mock(AssemblyVisitor.class);
context.checking(new Expectations() {
{
oneOf(visitor).enter(sut);
}
});
sut.begin(visitor);
context.assertIsSatisfied();
}
示例13: endShouldTriggerEnterOnTheVisitor
import org.jmock.integration.junit4.JUnit4Mockery; //导入依赖的package包/类
@Test
public void endShouldTriggerEnterOnTheVisitor() {
final Mockery context = new JUnit4Mockery();
final Require sut = RequirementSamples.require();
final AssemblyVisitor visitor = context.mock(AssemblyVisitor.class);
context.checking(new Expectations() {
{
oneOf(visitor).exit(sut);
}
});
sut.end(visitor);
context.assertIsSatisfied();
}
示例14: beginShouldTriggerEnterOnTheVisitor
import org.jmock.integration.junit4.JUnit4Mockery; //导入依赖的package包/类
@Test
public void beginShouldTriggerEnterOnTheVisitor() {
final Mockery context = new JUnit4Mockery();
final Disjunction disjunction = RequirementSamples.disjunction();
final AssemblyVisitor visitor = context.mock(AssemblyVisitor.class);
context.checking(new Expectations() {
{
oneOf(visitor).enter(disjunction);
}
});
disjunction.begin(visitor);
context.assertIsSatisfied();
}
示例15: endShouldTriggerEnterOnTheVisitor
import org.jmock.integration.junit4.JUnit4Mockery; //导入依赖的package包/类
@Test
public void endShouldTriggerEnterOnTheVisitor() {
final Mockery context = new JUnit4Mockery();
final Disjunction disjunction = RequirementSamples.disjunction();
final AssemblyVisitor visitor = context.mock(AssemblyVisitor.class);
context.checking(new Expectations() {
{
oneOf(visitor).exit(disjunction);
}
});
disjunction.end(visitor);
context.assertIsSatisfied();
}