@@ -0,0 +1,2168 @@
+package jgravatar;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport static org.junit.Assert.*;%0A%0Apublic class JGravatarTest %7B%0A%0A    private Gravatar gravatar;%0A%0A    @Before%0A    public void setup() %7B%0A        gravatar = new Gravatar();%0A    %7D%0A%0A    @Test%0A    public void testGetImageUrlDefaults() %7B%0A        assertEquals(%22http://www.gravatar.com/avatar/3b3be63a4c2a439b013787725dfce802.jpg?d=404%22, gravatar.getUrl(%22iHaveAn@email.com%22));%0A        assertEquals(%22http://www.gravatar.com/avatar/fa8771dec9da9299afed9ffce70c2c18.jpg?d=404%22, gravatar.getUrl(%22info@ralfebert.de%22));%0A    %7D%0A%0A    @Test%0A    public void testGetImageUrlSize() %7B%0A        gravatar.setSize(100);%0A        assertEquals(%22http://www.gravatar.com/avatar/3b3be63a4c2a439b013787725dfce802.jpg?s=100&d=404%22, gravatar.getUrl(%22iHaveAn@email.com%22));%0A    %7D%0A%0A    @Test%0A    public void testGetImageUrlRating() %7B%0A        gravatar.setRating(GravatarRating.PARENTAL_GUIDANCE_SUGGESTED);%0A        assertEquals(%22http://www.gravatar.com/avatar/3b3be63a4c2a439b013787725dfce802.jpg?r=pg&d=404%22, gravatar.getUrl(%22iHaveAn@email.com%22));%0A    %7D%0A%0A    @Test%0A    public void testGetImageUrlDefaultImage() %7B%0A        gravatar.setDefaultImage(GravatarDefaultImage.IDENTICON);%0A        assertEquals(%22http://www.gravatar.com/avatar/3b3be63a4c2a439b013787725dfce802.jpg?d=identicon%22, gravatar.getUrl(%22iHaveAn@email.com%22));%0A    %7D%0A%0A    @Test%0A    public void testGetImageUrlCombined() %7B%0A        gravatar = new Gravatar();%0A        gravatar.setSize(123);%0A        gravatar.setDefaultImage(GravatarDefaultImage.IDENTICON);%0A        assertEquals(%22http://www.gravatar.com/avatar/3b3be63a4c2a439b013787725dfce802.jpg?s=123&d=identicon%22, gravatar.getUrl(%22iHaveAn@email.com%22));%0A    %7D%0A%0A    @Test%0A    public void testDownload() %7B%0A        Gravatar g = new Gravatar();%0A        byte%5B%5D bytes = g.download(%22info@ralfebert.de%22);%0A        assertTrue(%22content present%22, bytes.length %3E 100);%0A%0A        assertNull(%22null for no gravatar by default%22, g.download(%22doesntexist@example.com%22));%0A%0A        g.setDefaultImage(GravatarDefaultImage.IDENTICON);%0A        bytes = g.download(%22info@ralfebert.de%22);%0A        assertTrue(%22content present%22, bytes.length %3E 100);%0A    %7D%0A%0A%7D%0A

move file