Package com.google.sitebricks

Examples of com.google.sitebricks.MvelEvaluator


        final String[] out = new String[1];
        Respond mockRespond = createMock(Respond.class);
        final String boundTo = "aString";

        new TextFieldWidget(new ProceedingWidgetChain(), "boundTo", new MvelEvaluator())
                .render(new HashMap<String, Object>() {{
                    put("boundTo", boundTo);
                }}, mockRespond);

View Full Code Here


                times[0]++;
            }
        };


        RepeatWidget widget = new RepeatWidget(mockChain, "items=beans", new MvelEvaluator());
        widget.setConverter(new DummyTypeConverter());
        widget.render(new HashMap<String, Object>() {{
                    put("beans", ints);
                }}, RespondersForTesting.newRespond());
       
View Full Code Here

    };
  }

  @Test(dataProvider = ANNOTATION_EXPRESSIONS)
  public final void readAWidgetWithVariousExpressions(String expression) {
    final Evaluator evaluator = new MvelEvaluator();

    final WidgetRegistry registry = injector.getInstance(WidgetRegistry.class);

    String templateValue = String.format("<html><#if %s><p>hello</p></#if></html>", expression);
View Full Code Here

      protected void configure() {
        bind(HttpServletRequest.class).toProvider(mockRequestProviderForContext());
      }
    });

    final Evaluator evaluator = new MvelEvaluator();

    final WidgetRegistry registry = injector.getInstance(WidgetRegistry.class);


    Renderable widget =
View Full Code Here

        };
    }

    @Test(dataProvider = WIDGETS_AND_KEYS)
    public final void storeRetrieveWidgets(final String key, final Class<Renderable> expected) throws ExpressionCompileException {
        final WidgetRegistry registry = new DefaultWidgetRegistry(new MvelEvaluator(), createNiceMock(PageBook.class), createNiceMock(Injector.class));
        registry.add(key, expected);

        Renderable widget = registry.newWidget(key, "some=expression", new ProceedingWidgetChain(), createMock(EvaluatorCompiler.class));

        assert expected.isInstance(widget) : "Wrong widget returned";
View Full Code Here

            }
        };


        //try to render widget
        new ShowIfWidget(mockChain, expression, new MvelEvaluator())
                .render(new HashMap<String, Object>() {{
                    put("visible", true);
                }}, RespondersForTesting.newRespond());

        assert run[0] == should : "ShowIf did not do as it should " + should;
View Full Code Here

    widget.render(eq(myEmbeddedPage), isA(Respond.class));


    replay(pageBook, page, widget);

    final MvelEvaluator evaluator = new MvelEvaluator();
    final WidgetChain widgetChain = new ProceedingWidgetChain();
    final WidgetChain targetWidgetChain = new ProceedingWidgetChain();

    //noinspection unchecked
    targetWidgetChain.addWidget(new XmlWidget(new TerminalWidgetChain(), "p", createMock(EvaluatorCompiler.class), Collections.EMPTY_MAP));
View Full Code Here

    final PageBook pageBook = createMock(PageBook.class);
    final PageBook.Page page = createMock(PageBook.Page.class);
    final Respond respond = RespondersForTesting.newRespond();


    final MvelEvaluator evaluator = new MvelEvaluator();

    final WidgetChain widget = new ProceedingWidgetChain();
    final WidgetChain targetWidgetChain = new ProceedingWidgetChain();

    //noinspection unchecked
View Full Code Here

    final PageBook pageBook = createMock(PageBook.class);
    final PageBook.Page page = createMock(PageBook.Page.class);
    final Respond respond = RespondersForTesting.newRespond();


    final MvelEvaluator evaluator = new MvelEvaluator();

    final WidgetChain widget = new ProceedingWidgetChain();
    final WidgetChain targetWidgetChain = new ProceedingWidgetChain();
    //noinspection unchecked
    targetWidgetChain.addWidget(new XmlWidget(new ProceedingWidgetChain()
View Full Code Here

    final PageBook pageBook = createMock(PageBook.class);
    final PageBook.Page page = createMock(PageBook.Page.class);
    final Respond respond = RespondersForTesting.newRespond();


    final MvelEvaluator evaluator = new MvelEvaluator();

    final ProceedingWidgetChain widget = new ProceedingWidgetChain();
    final WidgetChain targetWidgetChain = new ProceedingWidgetChain();
    //noinspection unchecked
    targetWidgetChain.addWidget(new XmlWidget(new TerminalWidgetChain(), "p", new MvelEvaluatorCompiler(Object.class), new LinkedHashMap<String, String>() {{
View Full Code Here

TOP

Related Classes of com.google.sitebricks.MvelEvaluator

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.