Package org.jmock

Examples of org.jmock.Sequence


            will(returnValue("config1"));

            allowing(configuration2).getName();
            will(returnValue("config2"));

            Sequence resolve = context.sequence("resolve");
            Sequence render = context.sequence("render");

            one(configuration1).getResolvedConfiguration();
            inSequence(resolve);
            will(returnValue(resolvedConfiguration1));
View Full Code Here


    }

    @Test
    public void completesRendererAtEndOfGeneration() throws IOException {
        context.checking(new Expectations() {{
            Sequence sequence = context.sequence("sequence");
            one(renderer).setOutput((StyledTextOutput) with(notNullValue()));
            inSequence(sequence);
            one(renderer).startProject(project);
            inSequence(sequence);
            one(generator).run();
View Full Code Here

    @Test
    public void setsOutputFileNameOnRendererBeforeGeneration() throws IOException {
        final File file = tmpDir.getDir().file("report.txt");

        context.checking(new Expectations() {{
            Sequence sequence = context.sequence("sequence");
            one(renderer).setOutputFile(file);
            inSequence(sequence);
            one(renderer).startProject(project);
            inSequence(sequence);
            one(generator).run();
View Full Code Here

    public void passesEachProjectToRenderer() throws IOException {
        final Project child1 = createChildProject(project, "child1");
        final Project child2 = createChildProject(project, "child2");
        task.setProjects(project.getAllprojects());
        context.checking(new Expectations() {{
            Sequence sequence = context.sequence("seq");

            one(renderer).setOutput((StyledTextOutput) with(notNullValue()));
            inSequence(sequence);
            one(renderer).startProject(project);
            inSequence(sequence);
View Full Code Here

            will(returnIterator(toLinkedSet()));

            allowing(taskContainer).getRules();
            will(returnValue(toList()));

            Sequence sequence = context.sequence("seq");

            one(renderer).showDetail(false);
            inSequence(sequence);

            one(renderer).addDefaultTasks(testDefaultTasks);
View Full Code Here

            will(returnIterator(toLinkedSet()));

            one(taskContainer).getRules();
            will(returnValue(toList(rule1, rule2)));

            Sequence sequence = context.sequence("seq");

            one(renderer).showDetail(false);
            inSequence(sequence);

            one(renderer).addDefaultTasks(defaultTasks);
View Full Code Here

    /**
     * This method tests the dynamic class loading through the package admin.
     * The returned class changes from map to array list.
     */
    @Test public void testLoading() throws Exception {
        final Sequence sequence = this.context.sequence("load-sequence");
        final BundleContext bundleContext = this.context.mock(BundleContext.class);
        final PackageAdmin packageAdmin = this.context.mock(PackageAdmin.class);
        final ExportedPackage ep = this.context.mock(ExportedPackage.class);
        final Bundle bundle = this.context.mock(Bundle.class);
        this.context.checking(new Expectations() {{
View Full Code Here

  @Test public void
  pushes_and_pops_loaders() throws IOException, CoreException {
    ScriptStack stack = new ScriptStack();
    final ScriptLoader loader1 = context.mock(ScriptLoader.class, "loader1");
    final ScriptLoader loader2 = context.mock(ScriptLoader.class, "loader2");
    final Sequence sequence = context.sequence("loaderSequence");
    final String filename = "foo.rs";
   
    context.checking(new Expectations() {{
      oneOf(loader1).file(filename); inSequence(sequence);
      oneOf(loader2).file(filename); inSequence(sequence);
View Full Code Here

        final List<Method> methods = Arrays.asList(NormalDomainObject.class.getMethod("titleElement1"), NormalDomainObject.class.getMethod("titleElement2"), NormalDomainObject.class.getMethod("titleElement3"));

        final List<TitleComponent> components = Lists.transform(methods, TitleComponent.FROM_METHOD);
        final TitleFacetViaTitleAnnotation facet = new TitleFacetViaTitleAnnotation(components, mockFacetHolder, mockAdapterManager);
        final NormalDomainObject normalPojo = new NormalDomainObject();
        final Sequence sequence = context.sequence("in-title-element-order");
        context.checking(new Expectations() {
            {
                allowing(mockObjectAdapter).getObject();
                will(returnValue(normalPojo));
View Full Code Here

    @Test
    public void callsResolveOnSetterAndThenObjectChanged() throws Exception {

        mockery.checking(new Expectations() {
            {
                final Sequence sequence = mockery.sequence("set");

                one(mockObjectResolver).resolve(sdo, "name");
                inSequence(sequence);

                one(mockObjectChanger).objectChanged(sdo);
View Full Code Here

TOP

Related Classes of org.jmock.Sequence

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.