当前位置: 首页>>代码示例>>Java>>正文


Java JUnit4Mockery类代码示例

本文整理汇总了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");
  }
}
 
开发者ID:sih4sing5hong5,项目名称:google-sites-liberation,代码行数:23,代码来源:EntryParserImplTest.java

示例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();
}
 
开发者ID:sih4sing5hong5,项目名称:google-sites-liberation,代码行数:26,代码来源:PageExporterImplTest.java

示例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");
}
 
开发者ID:sih4sing5hong5,项目名称:google-sites-liberation,代码行数:22,代码来源:SiteExporterImplTest.java

示例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();
}
 
开发者ID:fchauvel,项目名称:trio,代码行数:19,代码来源:SystemTest.java

示例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();
}
 
开发者ID:fchauvel,项目名称:trio,代码行数:19,代码来源:SystemTest.java

示例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();
}
 
开发者ID:fchauvel,项目名称:trio,代码行数:19,代码来源:ConjunctionTest.java

示例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();
}
 
开发者ID:fchauvel,项目名称:trio,代码行数:19,代码来源:ConjunctionTest.java

示例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();
}
 
开发者ID:fchauvel,项目名称:trio,代码行数:19,代码来源:NegationTest.java

示例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();
}
 
开发者ID:fchauvel,项目名称:trio,代码行数:19,代码来源:NegationTest.java

示例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();
}
 
开发者ID:fchauvel,项目名称:trio,代码行数:19,代码来源:NothingTest.java

示例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();
}
 
开发者ID:fchauvel,项目名称:trio,代码行数:19,代码来源:NothingTest.java

示例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();
}
 
开发者ID:fchauvel,项目名称:trio,代码行数:19,代码来源:RequireTest.java

示例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();
}
 
开发者ID:fchauvel,项目名称:trio,代码行数:19,代码来源:RequireTest.java

示例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();
}
 
开发者ID:fchauvel,项目名称:trio,代码行数:19,代码来源:DisjunctionTest.java

示例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();
}
 
开发者ID:fchauvel,项目名称:trio,代码行数:19,代码来源:DisjunctionTest.java


注:本文中的org.jmock.integration.junit4.JUnit4Mockery类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。