htmlpage/src/test/java/org/apidesign/bck2brwsr/htmlpage/ProcessPageTest.java
changeset 25 e214f04abb98
child 26 03e4aaa4ef3d
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/htmlpage/src/test/java/org/apidesign/bck2brwsr/htmlpage/ProcessPageTest.java	Mon Sep 24 12:39:21 2012 +0200
     1.3 @@ -0,0 +1,23 @@
     1.4 +package org.apidesign.bck2brwsr.htmlpage;
     1.5 +
     1.6 +import java.io.IOException;
     1.7 +import java.io.InputStream;
     1.8 +import java.util.Set;
     1.9 +import org.testng.annotations.Test;
    1.10 +import static org.testng.Assert.*;
    1.11 +
    1.12 +public class ProcessPageTest {
    1.13 +    
    1.14 +    
    1.15 +    @Test public void findsThreeIds() throws IOException {
    1.16 +        InputStream is = ProcessPageTest.class.getResourceAsStream("TestPage.xhtml");
    1.17 +        assertNotNull(is, "Sample HTML page found");
    1.18 +        ProcessPage res = ProcessPage.readPage(is);
    1.19 +        final Set<String> ids = res.ids();
    1.20 +        assertEquals(ids.size(), 3, "Three ids found: " + ids);
    1.21 +        
    1.22 +        assertEquals(res.tagNameForId("pg.title"), "title");
    1.23 +        assertEquals(res.tagNameForId("pg.button"), "button");
    1.24 +        assertEquals(res.tagNameForId("pg.text"), "input");
    1.25 +    }
    1.26 +}