Examples of MapValue


Examples of com.groupon.jenkins.buildtype.install_packages.buildconfiguration.configvalue.MapValue

public class CompositeConfigSectionTest {

    @Test
    public void yml_with_unrecognized_keys_is_invalid() {
        ConfigSection buildConfiguration = new BuildConfiguration(new MapValue(map("environment", map("not_legit_key", ""))));
        assertFalse(buildConfiguration.isValid());
    }
View Full Code Here

Examples of com.groupon.jenkins.buildtype.install_packages.buildconfiguration.configvalue.MapValue

        assertFalse(buildConfiguration.isValid());
    }

    @Test
    public void yml_with_invalid_value_format_is_invalid() {
        CompositeConfigSection buildConfiguration = new BuildConfiguration(new MapValue(map("environment", "")));
        assertFalse(buildConfiguration.isValid());
    }
View Full Code Here

Examples of com.groupon.jenkins.buildtype.install_packages.buildconfiguration.configvalue.MapValue

        assertFalse(buildConfiguration.isValid());
    }

    @Test
    public void yml_with_missing_keys_is_invalid() {
        ConfigSection buildConfiguration = new BuildConfiguration(new MapValue(map("environment", map("language", "ruby"))));
        assertTrue(buildConfiguration.isValid());
    }
View Full Code Here

Examples of com.groupon.jenkins.buildtype.install_packages.buildconfiguration.configvalue.MapValue

        assertTrue(buildConfiguration.isValid());
    }

    @Test
    public void should_specify_unrecognized_key_in_error_message() {
        CompositeConfigSection buildConfiguration = new BuildConfiguration(new MapValue(map("environment", "", "unknown_key", "")));
        assertEquals("Unrecognized key unknown_key in .ci.yml", get(buildConfiguration.getValidationErrors(), 0));
    }
View Full Code Here

Examples of com.groupon.jenkins.buildtype.install_packages.buildconfiguration.configvalue.MapValue

        assertEquals("Unrecognized key unknown_key in .ci.yml", get(buildConfiguration.getValidationErrors(), 0));
    }

    @Test
    public void should_check_sub_sections_for_errors_too() {
        CompositeConfigSection buildConfiguration = new BuildConfiguration(new MapValue(map("environment", "")));
        ConfigSection validConfigSection = mock(ConfigSection.class);
        ConfigSection inValidConfigSection = mock(ConfigSection.class);
        when(inValidConfigSection.getValidationErrors()).thenReturn(list("error_message"));
        when(inValidConfigSection.getName()).thenReturn("environment");
        when(validConfigSection.getValidationErrors()).thenReturn(Lists.<String> newArrayList());
View Full Code Here

Examples of org.apache.slide.projector.value.MapValue

                                    rowMap.put(key, new StringValue((String)object));
                                } else if ( object instanceof Integer ) {
                                    rowMap.put(key, new NumberValue((Integer)object));
                                }
                            }
                            resultSetResources.add(new MapValue(rowMap));
                        }
                        Value[] resultEntries = new Value[resultSetResources.size()];
                        result.addResultEntry(RESULT, new ArrayValue((Value[] )resultSetResources.toArray(resultEntries)));
                    } else {
                        result.addResultEntry(ROW_COUNT, new NumberValue(new BigDecimal(preparedStatement.getUpdateCount())));
View Full Code Here

Examples of org.apache.slide.projector.value.MapValue

  private Map getMap() throws IOException {
    if ( mapResource != null ) return mapResource.getMap();
    mapResource = (MapValue)store.get(storageKey);
    if ( mapResource == null ) {
      map = new HashMap();
      mapResource = new MapValue(map);
      return map;
    } else {
      return mapResource.getMap();
    }
  }
View Full Code Here

Examples of org.apache.slide.projector.value.MapValue

        String sortedBy = null, order = null;
        if ( sortedByParameter != NullValue.NULL ) sortedBy = sortedByParameter.toString();
        if ( orderParameter != NullValue.NULL ) order = orderParameter.toString();
        String id = parameter.get(TableHandler.ID).toString();
        Store store = context.getStore(StoreHelper.getStoreByName(parameter.get(TableHandler.STORE).toString()));
        MapValue idResource = (MapValue)store.get(id);
        Map tableMap;
        if ( idResource == null) {
            tableMap = new HashMap();
            MapValue tableState = new MapValue(tableMap);
            store.put(id, tableState);
        } else {
            tableMap = idResource.getMap();
            NumberValue offset = (NumberValue)idResource.getMap().get(TableHandler.CURRENT_POSITION);
            if ( offset != null ) offsetResource = offset;
View Full Code Here

Examples of org.apache.slide.projector.value.MapValue

    this.context = context;
    this.store = store;
  }

  public void put(String key, Object value) throws IOException {
    MapValue domain = getDomain();
    domain.getMap().put(key, value);
  }
View Full Code Here

Examples of org.apache.slide.projector.value.MapValue

    store.dispose(domain);
  }
 
  public MapValue getDomain() throws IOException {
    String domain = context.getProcess().toString();
    MapValue mapResource = (MapValue)store.get(domain);
    if ( mapResource == null ) {
      mapResource = new MapValue();
      store.put(domain, mapResource);
      return mapResource;
    } else {
      return mapResource;
    }
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.