Package org.springframework.rules.closure

Examples of org.springframework.rules.closure.Closure


    public void testWithLazyInitFalseAndAlwaysRefreshTrue() {
        Object returnValue1 = new Object();
        Object returnValue2 = new Object();
        Object returnValue3 = new Object();

        Closure refreshFunction = (Closure) EasyMock.createMock(Closure.class);
        EasyMock.expect(refreshFunction.call(null)).andReturn(returnValue1);
        EasyMock.expect(refreshFunction.call(null)).andReturn(returnValue2);
        EasyMock.expect(refreshFunction.call(null)).andReturn(returnValue3);
        EasyMock.replay(refreshFunction);

        RefreshableValueHolder valueHolder = new RefreshableValueHolder(refreshFunction, true, true);
        assertSame(returnValue1, valueHolder.getValue());
        assertSame(returnValue2, valueHolder.getValue());
View Full Code Here


   */
  public Object call(Object argument) {
    Object result = argument;
    Iterator it = iterator();
    while (it.hasNext()) {
      Closure f = (Closure) it.next();
      result = f.call(result);
    }
    return result;
  }
View Full Code Here

TOP

Related Classes of org.springframework.rules.closure.Closure

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.