Examples of TheGoods


Examples of org.nutz.dao.test.meta.TheGoods

    @Test
    public void test_simple_byte_array() throws IOException {
        String path = "org/nutz/dao/test/meta/goods.png";

        dao.create(TheGoods.class, true);
        TheGoods tg = TheGoods.create("AAA", path);
        dao.insert(tg);

        // 读取
        TheGoods tg2 = dao.fetch(TheGoods.class, tg.getId());

        // 比较字节流
        byte[] olds = Files.readBytes(path);
        byte[] dbs = tg2.getThumbnail();

        assertEquals(olds.length, dbs.length);
        for (int i = 0; i < olds.length; i++) {
            assertEquals(olds[i], dbs[i]);
        }
View Full Code Here

Examples of org.nutz.dao.test.meta.TheGoods

            fos.write(new byte[1024]);
        }
        fos.close();

        dao.create(TheGoods.class, true);
        TheGoods tg = TheGoods.create("AAA", path);
        dao.insert(tg);

        new File(path).delete();
    }
View Full Code Here

Examples of org.nutz.dao.test.meta.TheGoods

    @Test
    public void test_simple_byte_array() throws IOException {
        String path = "org/nutz/dao/test/meta/goods.png";

        dao.create(TheGoods.class, true);
        TheGoods tg = TheGoods.create("AAA", path);
        dao.insert(tg);

        // 读取
        TheGoods tg2 = dao.fetch(TheGoods.class, tg.getId());

        // 比较字节流
        byte[] olds = Files.readBytes(path);
        byte[] dbs = tg2.getThumbnail();

        assertEquals(olds.length, dbs.length);
        for (int i = 0; i < olds.length; i++) {
            assertEquals(olds[i], dbs[i]);
        }
View Full Code Here

Examples of org.nutz.dao.test.meta.TheGoods

            fos.write(new byte[1024]);
        }
        fos.close();

        dao.create(TheGoods.class, true);
        TheGoods tg = TheGoods.create("AAA", path);
        dao.insert(tg);

        new File(path).delete();
    }
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.