Package de.panikco.pmdb.model

Examples of de.panikco.pmdb.model.Media


  private Errors errors;

  @Before
  public void setup() {
    validator = new MediaValidator();
    media = new Media();
    media.setTitle("A valid title");
    media.setComment("A valid comment.");
   
    errors = new BindException(media, "media");
  }
View Full Code Here


 
  @Test
  public void addMediaTest() {
   
    List <Media> media = new ArrayList<Media>();
    Media aMedium = new Media();
    aMedium.setTitle("Herr der Ringe");
    media.add(aMedium);
   
    when(repository.findAll()).thenReturn(media);
   
    List<Media> result = ms.getAllMedia();
View Full Code Here

    if (!supports(target.getClass()))
      throw new IllegalArgumentException("Validation of classs '"
          + target.getClass() + "' is not supported");

    Media media = (Media) target;

    ValidationUtils.rejectIfEmpty(errors, FIELD_TITLE, ERROR_EMPTY);
    rejectIfExceedsMaxLength(FIELD_TITLE, TITLE_MAX_LENGTH, errors, media.getTitle());

  }
View Full Code Here

    return "mediaDetail";
  }

  @RequestMapping(method = RequestMethod.GET, value = "/insert")
  public ModelAndView prepareInsertPage(ModelMap modelMap) {
    return new ModelAndView("insertMedium", "media", new Media());
  }
View Full Code Here

TOP

Related Classes of de.panikco.pmdb.model.Media

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.