Package ch.ralscha.extdirectspring.provider

Examples of ch.ralscha.extdirectspring.provider.Row


  public void testCreateWithDataSingle() {
    ExtDirectStoreResult<Row> rows = (ExtDirectStoreResult<Row>) ControllerUtil
        .sendAndReceive(mockMvc, "remoteProviderStoreModifySingle", "create1",
            new TypeReference<ExtDirectStoreResult<Row>>() {
              /* nothing here */
            }, new Row(10, "Ralph", true, "109.55"));
    assertThat(rows.getRecords()).hasSize(1);
    assertThat(rows.isSuccess()).isTrue();
    Row row = rows.getRecords().iterator().next();
    assertThat(row.getId()).isEqualTo(10);
    assertThat(row.getName()).isEqualTo("Ralph");
    assertThat(row.getSalary()).isEqualTo(new BigDecimal("109.55"));
  }
View Full Code Here


  }

  private void testCreateWithData(String action) {
    Map<String, Object> storeRequest = new LinkedHashMap<String, Object>();
    List<Row> rowsToUpdate = new ArrayList<Row>();
    rowsToUpdate.add(new Row(10, "Ralph", true, "109.55"));
    rowsToUpdate.add(new Row(23, "John", false, "23.12"));
    storeRequest.put("records", rowsToUpdate);

    List<Row> rows = (List<Row>) ControllerUtil.sendAndReceive(mockMvc, action,
        "create1", new TypeReference<List<Row>>() {/* nothing here */
        }, storeRequest);
View Full Code Here

    assertThat(extractProperty("name").from(rows)).containsSequence("Ralph", "John");
  }

  @Test
  public void testCreateWithDataSingle() {
    Row row = (Row) ControllerUtil.sendAndReceive(mockMvc,
        "remoteProviderStoreModifySingle", "create1", Row.class, new Row(10,
            "Ralph", true, "109.55"));
    assertThat(row.getId()).isEqualTo(10);
  }
View Full Code Here

  }

  private void testCreateWithDataAndSupportedArguments(String action) {
    Map<String, Object> storeRequest = new LinkedHashMap<String, Object>();
    List<Row> rowsToUpdate = new ArrayList<Row>();
    rowsToUpdate.add(new Row(10, "Ralph", false, "109.55"));

    storeRequest.put("records", rowsToUpdate);

    List<Row> rows = (List<Row>) ControllerUtil.sendAndReceive(mockMvc, action,
        "create2", new TypeReference<List<Row>>() {/* nothing here */
 
View Full Code Here

    assertThat(extractProperty("id").from(rows)).containsExactly(10);
  }

  @Test
  public void testCreateWithDataAndSupportedArgumentsSingle() {
    Row row = (Row) ControllerUtil.sendAndReceive(mockMvc,
        "remoteProviderStoreModifySingle", "create2", Row.class, new Row(10,
            "Ralph", false, "109.55"));
    assertThat(row.getId()).isEqualTo(10);
  }
View Full Code Here

  }

  private void testUpdate(String action) throws Exception {
    Map<String, Object> storeRequest = new LinkedHashMap<String, Object>();
    List<Row> rowsToUpdate = new ArrayList<Row>();
    rowsToUpdate.add(new Row(10, "Ralph", true, "109.55"));
    storeRequest.put("records", rowsToUpdate);
    executeUpdate(action, storeRequest, "update1");
  }
View Full Code Here

  }

  private void testUpdateWithRequestParam(String action) throws Exception {
    Map<String, Object> storeRequest = new LinkedHashMap<String, Object>();
    List<Row> rowsToUpdate = new ArrayList<Row>();
    rowsToUpdate.add(new Row(10, "Ralph", true, "109.55"));
    storeRequest.put("id", 10);
    storeRequest.put("records", rowsToUpdate);
    executeUpdate(action, storeRequest, "update2");
  }
View Full Code Here

  }

  private void testUpdateWithRequestParamDefaultValue(String action) throws Exception {
    Map<String, Object> storeRequest = new LinkedHashMap<String, Object>();
    List<Row> rowsToUpdate = new ArrayList<Row>();
    rowsToUpdate.add(new Row(10, "Ralph", true, "109.55"));
    storeRequest.put("records", rowsToUpdate);
    executeUpdate(action, storeRequest, "update3");
  }
View Full Code Here

  }

  private void testUpdateWithRequestParamOptional(String action) throws Exception {
    Map<String, Object> storeRequest = new LinkedHashMap<String, Object>();
    List<Row> rowsToUpdate = new ArrayList<Row>();
    rowsToUpdate.add(new Row(10, "Ralph", true, "109.55"));
    storeRequest.put("records", rowsToUpdate);
    executeUpdate(action, storeRequest, "update4");

    storeRequest = new LinkedHashMap<String, Object>();
    rowsToUpdate = new ArrayList<Row>();
    rowsToUpdate.add(new Row(10, "Ralph", true, "109.55"));
    storeRequest.put("records", rowsToUpdate);
    storeRequest.put("id", 11);
    storeRequest.put("yesterday",
        ISODateTimeFormat.date().print(new LocalDate().minusDays(1)));
    executeUpdate(action, storeRequest, "update4");
View Full Code Here

  }

  @Test
  public void testUpdateSingle() throws Exception {
    Map<String, Object> storeRequest = new LinkedHashMap<String, Object>();
    Row row = new Row(10, "Ralph", true, "109.55");
    storeRequest.putAll(ControllerUtil.convertValue(row, Map.class));
    executeUpdate("remoteProviderStoreModifySingle", storeRequest, "update1");
  }
View Full Code Here

TOP

Related Classes of ch.ralscha.extdirectspring.provider.Row

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.