Examples of DerivedDto


Examples of org.company.recordshop.service.dto.DerivedDto

  DerivedDto toDto(final Derived source, final Map<Object, Object> translated) {
    if (translated.containsKey((source))) {
      return (DerivedDto) translated.get(source);
    }
    Assert.notNull(source, "argument [source] may not be null");
    DerivedDto result = new DerivedDto(source.getId(), source.getVersion());
    result.setFirst(source.getFirst());
    result.setSecondo(source.isSecondo());
    result.setThird(source.getThird());
    result.setFourth(source.getFourth());
    result.setFifth(source.getFifth());

    translated.put(source, result);

    return result;
  }
View Full Code Here

Examples of org.company.recordshop.service.dto.DerivedDto

    @Autowired
    TestSVCLocalService testSVCService;

    @Test
    public void testCreateDerived() {
        DerivedDto dto = new DerivedDto();
        testSVCService.createDerived(dto);
    }
View Full Code Here

Examples of org.company.recordshop.service.dto.DerivedDto

        testSVCService.createDerived(dto);
    }

    @Test
    public void testListAllDerived() {
        testSVCService.createDerived(new DerivedDto());
        List<DerivedDto> list = testSVCService.listAllDerived();
        assertEquals(1, list.size());
        DerivedDto read = list.get(0);
        // assertEquals(null, read.getFirst());
        assertTrue(read.isSecondo());
        // assertEquals(new DateTime(3), read.getThird());
        assertEquals(Integer.valueOf(4), read.getFourth());
        // assertEquals(Float.valueOf(5.0F), read.getFifth());
    }
View Full Code Here

Examples of org.company.recordshop.service.dto.DerivedDto

        // assertEquals(Float.valueOf(5.0F), read.getFifth());
    }

    @Test
    public void testReadDerived() {
        Long id = testSVCService.createDerived(new DerivedDto());
        DerivedDto read = testSVCService.readDerivedAsDerivedDto(id);
        // assertEquals("first", read.getFirst());
        assertTrue(read.isSecondo());
        // assertEquals(new DateTime(3), read.getThird());
        assertEquals(Integer.valueOf(4), read.getFourth());
        // assertEquals(Float.valueOf(5.0F), read.getFifth());
    }
View Full Code Here

Examples of org.company.recordshop.service.dto.DerivedDto

        // assertEquals(Float.valueOf(5.0F), read.getFifth());
    }

    @Test
    public void testUpdateDerived() {
        Long id = testSVCService.createDerived(new DerivedDto());
        DerivedDto read = testSVCService.readDerivedAsDerivedDto(id);
        // assertEquals("first", read.getFirst());
        assertTrue(read.isSecondo());
        // assertEquals(new DateTime(3), read.getThird());
        assertEquals(Integer.valueOf(4), read.getFourth());
        // assertEquals(Float.valueOf(5.0F), read.getFifth());
        // read.setFirst("second");
        read.setSecondo(false);
        // read.setThird(new DateTime(3));
        read.setFourth(4);
        // read.setFifth(5.0F);
        testSVCService.updateDerived(read);
        DerivedDto updated = testSVCService.readDerivedAsDerivedDto(id);
        // assertEquals("first", updated.getFirst());
        assertTrue(updated.isSecondo());
        // assertEquals(new DateTime(3), updated.getThird());
        assertEquals(Integer.valueOf(4), updated.getFourth());
        // assertEquals(Float.valueOf(5.0F), updated.getFifth());
    }
View Full Code Here

Examples of org.company.recordshop.service.dto.DerivedDto

  public List<DerivedDto> listAllDerived() {
    List<Derived> all = testSVCDomainService.listAllDeriveds();
    List<DerivedDto> result = new ArrayList<DerivedDto>();

    for (Derived object : all) {
      DerivedDto item = derivedDtoTranslator.toDto(object);
      result.add(item);
    }
    return result;
  }
View Full Code Here

Examples of org.company.recordshop.service.dto.DerivedDto

    List<Derived> range = testSVCDomainService.listDeriveds(firstResult,
        maxResults);
    List<DerivedDto> result = new ArrayList<DerivedDto>();

    for (Derived object : range) {
      DerivedDto item = derivedDtoTranslator.toDto(object);
      result.add(item);
    }
    return result;
  }
View Full Code Here

Examples of org.company.recordshop.service.dto.DerivedDto

    List<Derived> range = testSVCDomainService.listDeriveds(firstResult,
        maxResults, sortProperty, isAscending);
    List<DerivedDto> result = new ArrayList<DerivedDto>();

    for (Derived object : range) {
      DerivedDto item = derivedDtoTranslator.toDto(object);
      result.add(item);
    }
    return result;
  }
View Full Code Here

Examples of org.company.recordshop.service.dto.DerivedDto

   * {@link DerivedDtoTranslator#fromDto(DerivedDto, Derived)} method must not
   * call setters for derived properties that are not writable.
   */
  @Test
  public void testFromDto() {
    DerivedDto dto = new DerivedDto();
    //dto.setFirst("second");
    dto.setSecondo(false);
    //dto.setThird(new DateTime(4));
    dto.setFourth(5);
    //dto.setFifth(6.0F);
    Derived target = translator.fromDto(dto);
    assertEquals("first", target.getFirst());
    assertEquals(true, target.isSecondo());
    assertEquals(new DateTime(3), target.getThird());
View Full Code Here

Examples of org.company.recordshop.service.dto.DerivedDto

    assertEquals(5.0F, target.getFifth(), 0.0D);
  }

  @Test
  public void testToDto() {
    DerivedDto dto = translator.toDto(new Derived());
    //assertEquals("first", dto.getFirst());
    assertTrue(dto.isSecondo());
    //assertEquals(new DateTime(3), dto.getThird());
    assertEquals(4L, dto.getFourth().intValue());
    //assertEquals(5.0F, dto.getFifth(), 0.0D);
  }
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.