Package org.jmock.integration.junit4

Examples of org.jmock.integration.junit4.JUnit4Mockery


    }

    @Test
    public void getExtensionApiAsJsonDefaultHasApiElements() {
        this.mockery = new JUnit4Mockery();

        final ExtensionDescriptor extensionDescriptor = this.mockery.mock(ExtensionDescriptor.class);
        final ExtensionApi extensionApi = this.mockery.mock(ExtensionApi.class);

        this.mockery.checking(new Expectations() {{
View Full Code Here


    private Mockery mockery = new JUnit4Mockery();
    private MockAbstractSubResource mockResource;

    @Before
    public void init() {
        this.mockery = new JUnit4Mockery();

        final UriInfo uriInfo = this.mockery.mock(UriInfo.class);
        final HttpServletRequest req = this.mockery.mock(HttpServletRequest.class);

        final Graph graph = this.mockery.mock(Graph.class);
View Full Code Here

    }

    @Test
    public void findExtensionGraphExtensionNotPresent() {

        this.mockery = new JUnit4Mockery();
        UriInfo uri = this.mockTheUri("not", "here", "");

        List<RexsterExtension> extensions = this.mockResource.findExtensionExposed(new ExtensionSegmentSet(uri, ExtensionPoint.GRAPH));
        Assert.assertNull(extensions);
    }
View Full Code Here

    }

    @Test
    public void findExtensionGraphExtensionFound() {

        this.mockery = new JUnit4Mockery();
        UriInfo uri = this.mockTheUri("tp", "gremlin", "");

        List<RexsterExtension> extensions = this.mockResource.findExtensionExposed(new ExtensionSegmentSet(uri, ExtensionPoint.GRAPH));
        Assert.assertNotNull(extensions);
        Assert.assertTrue(extensions.get(0) instanceof GremlinExtension);
View Full Code Here

        ExtensionSegmentSet extensionSegmentSet = new ExtensionSegmentSet(this.mockTheUri("ns", "extension", ""), ExtensionPoint.GRAPH);
        configuration.isExtensionAllowed(extensionSegmentSet);
    }

    private UriInfo mockTheUri(final String namespace, final String extension, final String method) {
        this.mockery = new JUnit4Mockery();

        final UriInfo uri = this.mockery.mock(UriInfo.class);
        final List<PathSegment> pathSegments = new ArrayList<PathSegment>();
        final PathSegment graphsPathSegment = this.mockery.mock(PathSegment.class, "graphsSegment");
        final PathSegment graphPathSegment = this.mockery.mock(PathSegment.class, "graphPathSegment");
View Full Code Here

        Assert.assertNull(api);
    }

    @Test
    public void getExtensionApiAsJsonDescriptorOnlyNoApiElements() {
        this.mockery = new JUnit4Mockery();

        final ExtensionDescriptor extensionDescriptor = this.mockery.mock(ExtensionDescriptor.class);

        this.mockery.checking(new Expectations() {{
            allowing(extensionDescriptor).description();
View Full Code Here

        Assert.assertFalse(api.has(Tokens.PARAMETERS));
    }

    @Test
    public void getExtensionApiAsJsonParameterOnlyNoApiElements() {
        this.mockery = new JUnit4Mockery();

        final ExtensionDescriptor extensionDescriptor = this.mockery.mock(ExtensionDescriptor.class);

        this.mockery.checking(new Expectations() {{
            allowing(extensionDescriptor).description();
View Full Code Here

        Assert.assertFalse(api.has(Tokens.PARAMETERS));
    }

    @Test
    public void getExtensionApiAsJsonDefaultNoApiElements() {
        this.mockery = new JUnit4Mockery();

        final ExtensionDescriptor extensionDescriptor = this.mockery.mock(ExtensionDescriptor.class);

        this.mockery.checking(new Expectations() {{
            allowing(extensionDescriptor).description();
View Full Code Here

    protected RexsterApplication raToyGraph;
    protected RexsterApplication raEmptyGraph;

    @Before
    public void init() {
        this.mockery = new JUnit4Mockery();
        this.createDefaultGraphs(TinkerGraphFactory.createTinkerGraph(), new TinkerGraph());
    }
View Full Code Here

public class RexsterResourceTest {
    protected Mockery mockery = new JUnit4Mockery();

    @Before
    public void init() {
        this.mockery = new JUnit4Mockery();
    }
View Full Code Here

TOP

Related Classes of org.jmock.integration.junit4.JUnit4Mockery

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.