Package mjg

Examples of mjg.Song


  }
 
  @Test
  public void testGetSongById() {
    client.addSong("1", "Feeling Groovy", "Simon and Garfunkel", "1966");
    Song s = client.getSongById("1");
    assertEquals("1",s.getId());
    assertEquals("Feeling Groovy",s.getTitle());
    assertEquals("Simon and Garfunkel",s.getArtist());
    assertEquals("1966",s.getYear());
  }
View Full Code Here


  @Test
  public void testAddSong() {
    client.addSong("1", "Feeling Groovy", "Simon and Garfunkel", "1966");
    List<Song> songs = client.getSongs();
    assertEquals(1,songs.size());
    Song s = songs.get(0);
    assertEquals("Feeling Groovy",s.getTitle());
    assertEquals("Simon and Garfunkel",s.getArtist());
    assertEquals("1966",s.getYear());
    assertEquals("1", s.getId());
  }
View Full Code Here

  }

  public void addSong(String id, String title, String artist,  String year) {
    String url =
      "http://localhost:8163/SongService/SongService.groovy";
    Song s = new Song();
    s.setId(id);
    s.setArtist(artist);
    s.setTitle(title);
    s.setYear(year);
    Song2XML converter = new Song2XML();
    URI uri = template.postForLocation(url, converter.song2xml(s));
    if (uri != null) {
      log.info("Location: " + uri.toString());
    } else {
View Full Code Here

TOP

Related Classes of mjg.Song

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.