Examples of TAlbums


Examples of com.pugh.sockso.templates.api.TAlbums

     *
     */
   
    protected void showAlbums( final List<Album> albums ) throws IOException {
       
        TAlbums tpl = new TAlbums();
        tpl.setAlbums( albums );
       
        getResponse().showJson( tpl.makeRenderer() );
       
    }
View Full Code Here

Examples of com.pugh.sockso.templates.api.TAlbums

        String input = "{  id: 123, name: \"foo \\\"bar\" }";
        assertEquals( "{id:123,name:\"foo \\\"bar\"}", write(input) );
    }

    public void testIssue109() throws Exception {
        TAlbums tpl = new TAlbums();
        List<Album> albums = new ArrayList<Album>();
        final Artist artist = new Artist.Builder().id(1).name("Artist\"").build();
        albums.add( new Album.Builder()
                .artist(artist)
                .id(2)
                .name("Album\"")
                .year("1980")
                .build()
                );
        tpl.setAlbums(albums);
        tpl.makeRenderer().renderTo(jsonWriter);

        String expected = "[{\"id\":2,\"name\":\"Album\\\"\",\"date_added\":\"null\",\"artist\":{\"id\":1,\"name\":\"Artist\\\"\",\"date_added\":\"null\"}}]";
        String actual = stringWriter.toString();

        assertEquals( expected, actual );
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.