Browse Source

开发者工具链

pull/11/head
richie 5 years ago
parent
commit
905149299e
  1. 7
      src/test/java/com/fanruan/api/Prepare.java
  2. 3
      src/test/java/com/fanruan/api/session/SessionFactoryTest.java

7
src/test/java/com/fanruan/api/Prepare.java

@ -5,6 +5,9 @@ import com.fr.config.dao.impl.LocalClassHelperDao;
import com.fr.config.dao.impl.LocalEntityDao; import com.fr.config.dao.impl.LocalEntityDao;
import com.fr.config.dao.impl.LocalXmlEntityDao; import com.fr.config.dao.impl.LocalXmlEntityDao;
import com.fr.runtime.FineRuntime; import com.fr.runtime.FineRuntime;
import com.fr.store.StateHubManager;
import com.fr.store.impl.MemoryLock;
import com.fr.store.impl.MemoryStore;
import org.junit.After; import org.junit.After;
import org.junit.Before; import org.junit.Before;
@ -21,6 +24,8 @@ public class Prepare {
DaoContext.setEntityDao(new LocalEntityDao()); DaoContext.setEntityDao(new LocalEntityDao());
DaoContext.setClassHelperDao(new LocalClassHelperDao()); DaoContext.setClassHelperDao(new LocalClassHelperDao());
DaoContext.setXmlEntityDao(new LocalXmlEntityDao()); DaoContext.setXmlEntityDao(new LocalXmlEntityDao());
StateHubManager.setStorage(new MemoryStore());
StateHubManager.setLock(new MemoryLock());
} }
@After @After
@ -28,6 +33,8 @@ public class Prepare {
DaoContext.setEntityDao(null); DaoContext.setEntityDao(null);
DaoContext.setClassHelperDao(null); DaoContext.setClassHelperDao(null);
DaoContext.setXmlEntityDao(null); DaoContext.setXmlEntityDao(null);
StateHubManager.setStorage(null);
StateHubManager.setLock(null);
} }
} }

3
src/test/java/com/fanruan/api/session/SessionFactoryTest.java

@ -1,6 +1,7 @@
package com.fanruan.api.session; package com.fanruan.api.session;
import com.fanruan.api.Prepare; import com.fanruan.api.Prepare;
import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
/** /**
@ -12,6 +13,6 @@ public class SessionFactoryTest extends Prepare {
@Test @Test
public void getSession() throws Exception { public void getSession() throws Exception {
Assert.assertNull(SessionFactory.getSession("abc"));
} }
} }
Loading…
Cancel
Save