Examples of StringAttribute


Examples of org.geomajas.layer.feature.attribute.StringAttribute

    Point geometry = null;
    geometry = (Point) wktReader.read("POINT (0 0)");

    Object feature = (SimpleFeature)layer.getFeatureModel().newInstance("500");
    Map<String, Attribute> map = new HashMap<String, Attribute>();
    map.put("NAME", new StringAttribute("Tsjakamaka"));
    map.put("POP_OTHER", new IntegerAttribute(342));
    layer.getFeatureModel().setAttributes(feature, map);
    layer.getFeatureModel().setGeometry(feature, geometry);
   
    created = layer.create(feature);
View Full Code Here

Examples of org.geomajas.layer.feature.attribute.StringAttribute

  @SuppressWarnings("unchecked")
  @Test
  public void setAttributes() throws Exception {
    Map<String, Attribute> map = new HashMap<String, Attribute>();
    map.put(ATTRIBUTE_NAME, new StringAttribute("Heikant"));
    map.put(ATTRIBUTE_POPULATION, new DoubleAttribute(100.0));
    featureModel.setAttributes(feature, map);
    Assert.assertEquals("Heikant", featureModel.getAttribute(feature, ATTRIBUTE_NAME).getValue());
  }
View Full Code Here

Examples of org.geomajas.layer.feature.attribute.StringAttribute

  @SuppressWarnings("unchecked")
  @Test
  public void testSetAttributes() throws Exception {
    Map<String, Attribute> map = new HashMap<String, Attribute>();
    map.put(ATTRIBUTE_NAME, new StringAttribute("Heikant"));
    map.put(ATTRIBUTE_POPULATION, new IntegerAttribute(100));
    featureModel.setAttributes(feature, map);
    Assert.assertEquals("Heikant", featureModel.getAttribute(feature, ATTRIBUTE_NAME).getValue());
  }
View Full Code Here

Examples of org.geomajas.layer.feature.attribute.StringAttribute

        break;
      case CURRENCY:
        result = new CurrencyAttribute((String) value);
        break;
      case STRING:
        result = new StringAttribute(value == null ? null : value.toString());
        break;
      case DATE:
        result = new DateAttribute((Date) value);
        break;
      case URL:
View Full Code Here

Examples of org.geomajas.layer.feature.attribute.StringAttribute

  @Autowired
  private PipelineService pipelineService;

  @Test
  public void testPipeline() throws Exception {
    StringAttribute response = new StringAttribute("bla");

    PipelineContext context = pipelineService.createContext();
    context.put("start", "start");
    pipelineService.execute("pipelineTest", null, context, response);
    Assert.assertEquals("starts1s2s3", response.getValue());

    context.put("start", "bla-");
    pipelineService.execute("pipelineTest", "aLayer", context, response);
    Assert.assertEquals("bla-step-1step-3", response.getValue());

    context.put("start", "stop-");
    pipelineService.execute("pipelineTest", "stop", context, response);
    Assert.assertEquals("stop-s1-STOP", response.getValue());
  }
View Full Code Here

Examples of org.geomajas.layer.feature.attribute.StringAttribute

    PipelineInfo<StringAttribute> pipelineInfo;

    pipelineInfo = pipelineService.getPipeline("pipelineTest", "delegate");
    Assert.assertNotNull(pipelineInfo);

    StringAttribute response = new StringAttribute("bla");
    PipelineContext context = pipelineService.createContext();
    context.put("start", "stop-");
    pipelineService.execute(pipelineInfo, context, response);
    Assert.assertEquals("stop-s1-STOP", response.getValue());
  }
View Full Code Here

Examples of org.geomajas.layer.feature.attribute.StringAttribute

    Assert.assertEquals("stop-s1-STOP", response.getValue());
  }

  @Test
  public void extensionTest() throws Exception {
    StringAttribute response = new StringAttribute("bla");

    PipelineContext context = pipelineService.createContext();
    context.put("start", "start");
    pipelineService.execute("hookedTest", "base", context, response);
    Assert.assertEquals("starts1s2", response.getValue());

    context.put("start", "start");
    pipelineService.execute("hookedTest", "delegate2", context, response);
    Assert.assertEquals("starts1pps2ps2s2", response.getValue());

    context.put("start", "start");
    pipelineService.execute("hookedTest", "delegate", context, response);
    Assert.assertEquals("starts1ps2s2", response.getValue());
  }
View Full Code Here

Examples of org.geomajas.layer.feature.attribute.StringAttribute

    Assert.assertEquals("starts1ps2s2", response.getValue());
  }
 
  @Test
  public void interceptorTest() throws Exception {
    StringAttribute response = new StringAttribute("bla");
    PipelineContext context = pipelineService.createContext();
    pipelineService.execute("interceptorTest1", "base", context, response);
    Assert.assertEquals("blabeforei1s1s2afteri1", response.getValue());
  }
View Full Code Here

Examples of org.geomajas.layer.feature.attribute.StringAttribute

    Assert.assertEquals("blabeforei1s1s2afteri1", response.getValue());
  }
 
  @Test
  public void interceptorTestNested() throws Exception {
    StringAttribute response = new StringAttribute("bla");
    PipelineContext context = pipelineService.createContext();
    pipelineService.execute("interceptorTest2", "base", context, response);
    Assert.assertEquals("blabeforei1beforei2s1afteri2s2afteri1", response.getValue());
  }
View Full Code Here

Examples of org.geomajas.layer.feature.attribute.StringAttribute

    Assert.assertEquals("blabeforei1beforei2s1afteri2s2afteri1", response.getValue());
  }
 
  @Test
  public void interceptorTestSkip() throws Exception {
    StringAttribute response = new StringAttribute("bla");
    PipelineContext context = pipelineService.createContext();
    pipelineService.execute("interceptorTest3", "base", context, response);
    Assert.assertEquals("blas2", response.getValue());
  }
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.