Examples of ValueMap


Examples of org.apache.sling.api.resource.ValueMap

    @Test
    public void testSimpleValueModelConstructor() {
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("first", "first-value");
        map.put("second", "second-value");
        ValueMap vm = new ValueMapDecorator(map);

        Resource res = mock(Resource.class);
        when(res.adaptTo(ValueMap.class)).thenReturn(vm);
        when(request.getResource()).thenReturn(res);
View Full Code Here

Examples of org.apache.sling.api.resource.ValueMap

        Logger logFromValueMap = LoggerFactory.getLogger(this.getClass());

        Map<String, Object> map = new HashMap<String, Object>();
        map.put("first", "first-value");
        map.put("log", logFromValueMap);
        ValueMap vm = new ValueMapDecorator(map);

        Resource res = mock(Resource.class);
        when(res.adaptTo(ValueMap.class)).thenReturn(vm);
        when(request.getResource()).thenReturn(res);
View Full Code Here

Examples of org.apache.sling.api.resource.ValueMap

        when(resourceAccessGate.canRead(resource)).thenReturn(ResourceAccessGate.GateResult.GRANTED);
        when(resourceAccessGate.canUpdate(resource)).thenReturn(ResourceAccessGate.GateResult.DENIED);
        Resource readableResource = resourceAccessSecurity.getReadableResource(resource);

        ValueMap resultValueMap = readableResource.adaptTo(ValueMap.class);

        resultValueMap.put("modified", "value");

        verify(valueMap, times(0)).put("modified", "value");
    }
View Full Code Here

Examples of org.apache.wicket.util.value.ValueMap

  public final ValueMap getMarkupAttributes()
  {
    ComponentTag tag = getMarkupTag();
    if (tag != null)
    {
      ValueMap attrs = new ValueMap(tag.getAttributes());
      attrs.makeImmutable();
      return attrs;
    }
    return ValueMap.EMPTY_MAP;
  }
View Full Code Here

Examples of org.apache.wicket.util.value.ValueMap

  public final ValueMap getMarkupAttributes()
  {
    ComponentTag tag = getMarkupTag();
    if (tag != null)
    {
      ValueMap attrs = new ValueMap(tag.getAttributes());
      attrs.makeImmutable();
      return attrs;
    }
    return ValueMap.EMPTY_MAP;
  }
View Full Code Here

Examples of org.apache.wicket.util.value.ValueMap

  public final ValueMap getMarkupAttributes()
  {
    ComponentTag tag = getMarkupTag();
    if (tag != null)
    {
      ValueMap attrs = new ValueMap(tag.getAttributes());
      attrs.makeImmutable();
      return attrs;
    }
    return ValueMap.EMPTY_MAP;
  }
View Full Code Here

Examples of org.myjson.json.ValueMap

  public BingResponse getResults(String json) {
    if(logger.isDebugEnabled()) {
      logger.debug("Response json: "+json);
    }
    BingResponse bingResponse = new BingResponse();
    ValueMap response = (ValueMap) Parser.parse(json);
    ValueMap map = (ValueMap) response.get("SearchResponse");

    ValueMap images = (ValueMap) map.get("Image");
    if(images != null) {
      Image imageItem = new Image();
      parseValueMap(bingResponse, images, imageItem)
    }
    ValueMap news = (ValueMap) map.get("News");
    if(news != null) {
      News newsItem = new News();
      parseValueMap(bingResponse, news, newsItem);
    }
    ValueMap video = (ValueMap) map.get("Video");
    if(video != null) {
      Video videoItem = new Video();
      parseValueMap(bingResponse, video, videoItem);
    }
    ValueMap web = (ValueMap) map.get("Web");
    if(web != null) {
      Web webItem = new Web();
      parseValueMap(bingResponse, web, webItem);
    }
   
View Full Code Here

Examples of util.ValueMap

public class TestCalculation {
 
  @Test
  public void testSum() throws LexicalException, Exception {
    ValueMap values = new ValueMap();
    values.put("val1", new BigDecimal(5));
    values.put("val2", new BigDecimal(10));
   
    Parser p = new Parser("val1+val2");
    BigDecimal value = p.eval(p.lexicalVerifier(), values);
    assertEquals(value.compareTo(new BigDecimal("15")), 0);
  }
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.