contentservicetest.java.svn-base

来自「EJB3 Annotation Sample」· SVN-BASE 代码 · 共 89 行

SVN-BASE
89
字号
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package com.s7turn.entities.test;import com.bm.testsuite.BaseSessionBeanFixture;import com.bm.testsuite.dataloader.CSVInitialDataSet;import com.bm.testsuite.dataloader.EntityInitialDataSet;import com.s7turn.content.entities.Content;import com.s7turn.content.entities.InlineContent;import com.s7turn.content.session.ContentServiceBean;/** * * @author Long */public class ContentServiceTest extends BaseSessionBeanFixture<ContentServiceBean> {    private static final Class[] usedBeans = { Content.class};//, ContentProperty.class };        private static final CSVInitialDataSet CSV_SET = new CSVInitialDataSet<Content>(                    Content.class, "Content.csv", "id", "contentKey", "resourceId",                    "body", "author", "lastUpdate", "createDate",                    "tags");            public ContentServiceTest() {        //super(ContentServiceBean.class);        super( ContentServiceBean.class,                 usedBeans,                 new ContentInitDataSet(),                 CSV_SET//,                //new ContentInitDataSet()                );               System.out.println("Initial Bixture OK.");    }        public void testLoadContent()    {        //System.out.println("runing ContentServiceBean testing cases.");        ContentServiceBean csb = this.getBeanToTest(); //.loadContent("/usr/local", "en_US");                assertNotNull(csb);        Content ct = (Content)csb.loadContent("/home/logo.7t", "en_US");                assertNotNull( ct );        assertEquals( "title", ct.getContentKey());    }        public void testHello()    {        System.out.println("Hello, I am OK.");    }          public static class ContentInitDataSet extends EntityInitialDataSet<Content>    {        public ContentInitDataSet()        {            super( Content.class );        }        public void create()         {                        Content ct1 = new Content();            ct1.setId( new Long(1));            ct1.setAuthor("long");            ct1.setBody("Hello, world");            //ct1.setClassification("body");            ct1.setResourceId("/home/logo.7t");            ct1.setContentKey("title");                        Content ct2 = new Content();            ct2.setId( new Long(2));            ct2.setAuthor("long");            ct2.setBody("Hello, world");            //ct2.setClassification("body");            ct2.setResourceId("/home/logo9.7t");            ct2.setContentKey("name");            this.add(ct1);            this.add(ct2);                    }    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?