📄 currencytest.java
字号:
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.Currency;import org.operamasks.example.ejb.gl.service.ICurrencyService;public class CurrencyTest { private ICurrencyService currencyService; @Test public void testCreateCurrency() { Currency currency = new Currency(); currency.setId("currency1"); currency.setIsocode("ISO9001"); currency.setBaseUnit("元"); currency.setPrecision("0.00"); currency.setSign("人民币"); currencyService.createCurrency(currency); } @Test public void testModifyCurrency() { Currency currency = currencyService.getCurrency("currency1"); if (currency != null) { currency.setSign("美元"); currencyService.modifyCurrency(currency); } else System.out.println("The Currency is null!"); } @Test public void testRemoveCurrency() { Currency currency = currencyService.getCurrency("currency1"); if (currency != null) { currencyService.removeCurrency(currency); } else System.out.println("The Currency is null!"); } @Test public void testListCurrency() { // 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.currencyService = (ICurrencyService) initCtx .lookup("org.operamasks.example.gl.service.CurrencyService"); } @After public void tearDown() throws Exception { this.currencyService = null; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -