📄 timerservicedaotest.java
字号:
package junit.test;
import java.util.Properties;
import javax.naming.InitialContext;
import org.junit.BeforeClass;
import org.junit.Test;
import com.foshanshop.ejb3.TimerServiceDAO;
public class TimerServiceDAOTest {
private static TimerServiceDAO dao;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
Properties props = new Properties();
props.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
props.setProperty("java.naming.provider.url", "localhost:1099");
props.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
InitialContext ctx = new InitialContext(props);
dao = (TimerServiceDAO) ctx.lookup("TimerServiceBean/remote");
}
@Test
public void testScheduleTimer() {
dao.scheduleTimer(3*1000);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -