Browse Source

开发者工具链

master
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.LocalXmlEntityDao;
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.Before;
@ -21,6 +24,8 @@ public class Prepare {
DaoContext.setEntityDao(new LocalEntityDao());
DaoContext.setClassHelperDao(new LocalClassHelperDao());
DaoContext.setXmlEntityDao(new LocalXmlEntityDao());
StateHubManager.setStorage(new MemoryStore());
StateHubManager.setLock(new MemoryLock());
}
@After
@ -28,6 +33,8 @@ public class Prepare {
DaoContext.setEntityDao(null);
DaoContext.setClassHelperDao(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;
import com.fanruan.api.Prepare;
import org.junit.Assert;
import org.junit.Test;
/**
@ -12,6 +13,6 @@ public class SessionFactoryTest extends Prepare {
@Test
public void getSession() throws Exception {
Assert.assertNull(SessionFactory.getSession("abc"));
}
}
Loading…
Cancel
Save