1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/vmtest/src/test/java/org/apidesign/bck2brwsr/tck/ResourcesTest.java Thu Jan 10 20:15:11 2013 +0100
1.3 @@ -0,0 +1,32 @@
1.4 +/*
1.5 + * To change this template, choose Tools | Templates
1.6 + * and open the template in the editor.
1.7 + */
1.8 +package org.apidesign.bck2brwsr.tck;
1.9 +
1.10 +import java.io.InputStream;
1.11 +import org.apidesign.bck2brwsr.vmtest.Compare;
1.12 +import org.apidesign.bck2brwsr.vmtest.VMTest;
1.13 +import org.testng.annotations.Factory;
1.14 +
1.15 +/**
1.16 + *
1.17 + * @author Jaroslav Tulach <jtulach@netbeans.org>
1.18 + */
1.19 +public class ResourcesTest {
1.20 +
1.21 + @Compare public String readResourceAsStream() throws Exception {
1.22 + InputStream is = getClass().getResourceAsStream("Resources.txt");
1.23 + byte[] b = new byte[30];
1.24 + int len = is.read(b);
1.25 + StringBuilder sb = new StringBuilder();
1.26 + for (int i = 0; i < len; i++) {
1.27 + sb.append((char)b[i]);
1.28 + }
1.29 + return sb.toString();
1.30 + }
1.31 +
1.32 + @Factory public static Object[] create() {
1.33 + return VMTest.create(ResourcesTest.class);
1.34 + }
1.35 +}