accounttest.java
来自「模拟简单的会计信息录入管理应用」· Java 代码 · 共 69 行
JAVA
69 行
package org.operamasks.example.ejb.gl.service;import org.junit.After;import org.junit.Before;import org.junit.Test;import org.operamasks.example.ejb.gl.entity.AccountView;import org.operamasks.example.ejb.gl.service.IAccountViewService;public class AccountTest { private IAccountViewService accountViewService; @Test public void testCreateAccountView() { AccountView account = new AccountView(); account.setId("account1"); account.setName("Account"); account.setNumber("001"); account.setLongNumber("001"); account.setLevel(1); account.setIsBank(true); account.setIsLeaf(true); accountViewService.createAccountView(account); } @Test public void testModifyAccountView() { AccountView account = accountViewService.getAccountView("account1"); if (account != null) { account.setName("NewAccount"); accountViewService.modifyAccountView(account); } else System.out.println("The Account is null!"); } @Test public void testRemoveAccountView() { AccountView account = accountViewService.getAccountView("account1"); if (account != null) { accountViewService.removeAccountView(account); } else System.out.println("The Account is null!"); } @Test public void testListAccountView() { //fail("Not yet implemented"); } @Before public void setUp() throws Exception { java.util.Properties p = new java.util.Properties(); p.put(javax.naming.Context.PROVIDER_URL, "iiop://127.0.0.1:6888"); p.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, "com.apusic.naming.jndi.CNContextFactory"); javax.naming.InitialContext initCtx = new javax.naming.InitialContext(p); this.accountViewService = (IAccountViewService) initCtx .lookup("org.operamasks.example.gl.service.AccountViewService"); } @After public void tearDown() throws Exception { this.accountViewService = null; }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?