Examples of ViewPreparer


Examples of org.apache.tiles.preparer.ViewPreparer

    public void testRenderStringRequest() throws IOException {
        Request request = createMock(Request.class);
        Map<String, Object> requestScope = createMock(Map.class);
        Deque<AttributeContext> deque = createMock(Deque.class);
        AttributeContext attributeContext = createMock(AttributeContext.class);
        ViewPreparer preparer = createMock(ViewPreparer.class);
        Renderer renderer = createMock(Renderer.class);
        Definition definition = createMock(Definition.class);
        AttributeEvaluator evaluator = createMock(AttributeEvaluator.class);

        Attribute templateAttribute = Attribute.createTemplateAttribute("/my/template.jsp");
View Full Code Here

Examples of org.apache.tiles.preparer.ViewPreparer

    public void testRenderRequestDefinition() throws IOException {
        Request request = createMock(Request.class);
        Map<String, Object> requestScope = createMock(Map.class);
        Deque<AttributeContext> deque = createMock(Deque.class);
        AttributeContext attributeContext = createMock(AttributeContext.class);
        ViewPreparer preparer = createMock(ViewPreparer.class);
        Renderer renderer = createMock(Renderer.class);
        Definition definition = createMock(Definition.class);
        AttributeEvaluator evaluator = createMock(AttributeEvaluator.class);

        Attribute templateAttribute = Attribute.createTemplateAttribute("/my/template.jsp");
View Full Code Here

Examples of org.apache.tiles.preparer.ViewPreparer

    public void testRenderRequestDefinitionException() throws IOException {
        Request request = createMock(Request.class);
        Map<String, Object> requestScope = createMock(Map.class);
        Deque<AttributeContext> deque = createMock(Deque.class);
        AttributeContext attributeContext = createMock(AttributeContext.class);
        ViewPreparer preparer = createMock(ViewPreparer.class);
        Renderer renderer = createMock(Renderer.class);
        Definition definition = createMock(Definition.class);
        AttributeEvaluator evaluator = createMock(AttributeEvaluator.class);

        Attribute templateAttribute = Attribute.createTemplateAttribute("/my/template.jsp");
View Full Code Here

Examples of org.apache.tiles.preparer.ViewPreparer

    public void testRenderRequestAttributeContext() throws IOException {
        Request request = createMock(Request.class);
        Map<String, Object> requestScope = createMock(Map.class);
        Deque<AttributeContext> deque = createMock(Deque.class);
        AttributeContext attributeContext = createMock(AttributeContext.class);
        ViewPreparer preparer = createMock(ViewPreparer.class);
        Attribute templateAttribute = createMock(Attribute.class);
        Renderer renderer = createMock(Renderer.class);
        AttributeEvaluator evaluator = createMock(AttributeEvaluator.class);

        expect(attributeContext.getPreparer()).andReturn(null);
View Full Code Here

Examples of org.apache.tiles.preparer.ViewPreparer

        if (LOG.isDebugEnabled()) {
            LOG.debug("Prepare request received for '" + preparerName);
        }

        ViewPreparer preparer = preparerFactory.getPreparer(preparerName, context);
        if (preparer == null && ignoreMissing) {
            return;
        }

        if (preparer == null) {
            throw new NoSuchPreparerException("Preparer '" + preparerName + " not found");
        }

        AttributeContext attributeContext = BasicAttributeContext.getContext(context);

        preparer.execute(context, attributeContext);
    }
View Full Code Here

Examples of org.apache.tiles.preparer.ViewPreparer

     * Test method for
     * {@link org.apache.tiles.compat.preparer.CompatibilityPreparerFactory#createPreparer(java.lang.String)}
     * .
     */
    public void testCreatePreparer() {
        ViewPreparer preparer = factory.createPreparer("/my/url.do");
        assertTrue("The preparer is not an UrlPreparer",
                preparer instanceof UrlPreparer);
        preparer = factory.createPreparer(MockViewPreparer.class.getName());
        assertTrue("The preparer is not an class ViewPreparer",
                preparer instanceof MockViewPreparer);
View Full Code Here

Examples of org.apache.tiles.preparer.ViewPreparer


  @Override
  protected ViewPreparer getPreparer(String name, WebApplicationContext context) throws TilesException {
    // Quick check on the concurrent map first, with minimal locking.
    ViewPreparer preparer = this.sharedPreparers.get(name);
    if (preparer == null) {
      synchronized (this.sharedPreparers) {
        preparer = this.sharedPreparers.get(name);
        if (preparer == null) {
          try {
View Full Code Here

Examples of org.apache.tiles.preparer.ViewPreparer

     *
     * @throws TilesException If something goes wrong.
     */
    public void testGetPreparer() throws TilesException {
        String name = ViewPreparerSupport.class.getName();
        ViewPreparer p = factory.getPreparer(name, null);
        assertNotNull(p);
        assertTrue(p instanceof ViewPreparerSupport);

        name = "org.doesnotexist.Class";
        p = factory.getPreparer(name, null);
View Full Code Here

Examples of org.apache.tiles.preparer.ViewPreparer

        if (LOG.isDebugEnabled()) {
            LOG.debug("Prepare request received for '" + preparerName);
        }

        ViewPreparer preparer = preparerFactory.getPreparer(preparerName, context);
        if (preparer == null && ignoreMissing) {
            return;
        }

        if (preparer == null) {
            throw new NoSuchPreparerException("Preparer '" + preparerName + " not found");
        }

        AttributeContext attributeContext = BasicAttributeContext.getContext(context);

        // TODO: Temporary while preparerInstance gets refactored to throw a more specific exception.
        try {
            preparer.execute(context, attributeContext);
        } catch (Exception e) {
            throw new PreparerException(e.getMessage(), e);
        }
    }
View Full Code Here

Examples of org.apache.tiles.preparer.ViewPreparer


  @Override
  protected ViewPreparer getPreparer(String name, WebApplicationContext context) throws TilesException {
    // Quick check on the concurrent map first, with minimal locking.
    ViewPreparer preparer = this.sharedPreparers.get(name);
    if (preparer == null) {
      synchronized (this.sharedPreparers) {
        preparer = this.sharedPreparers.get(name);
        if (preparer == null) {
          try {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.