From 905149299e994d71fb756b5027788be3a77081db Mon Sep 17 00:00:00 2001 From: richie Date: Fri, 9 Aug 2019 16:32:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=8F=91=E8=80=85=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E9=93=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/test/java/com/fanruan/api/Prepare.java | 7 +++++++ .../java/com/fanruan/api/session/SessionFactoryTest.java | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/test/java/com/fanruan/api/Prepare.java b/src/test/java/com/fanruan/api/Prepare.java index 485e952..caba8ee 100644 --- a/src/test/java/com/fanruan/api/Prepare.java +++ b/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); } } diff --git a/src/test/java/com/fanruan/api/session/SessionFactoryTest.java b/src/test/java/com/fanruan/api/session/SessionFactoryTest.java index 6174169..3366cf7 100644 --- a/src/test/java/com/fanruan/api/session/SessionFactoryTest.java +++ b/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")); } } \ No newline at end of file