1 package com.atlassian.core.ofbiz.test;
2
3 import com.atlassian.core.ofbiz.CoreFactory;
4 import com.atlassian.core.ofbiz.test.mock.MockSequenceUtil;
5
6 import org.ofbiz.core.entity.MemoryHelper;
7 import org.ofbiz.core.entity.model.ModelEntity;
8
9 import junit.framework.TestCase;
10
11 public class AbstractOFBizTestCase extends TestCase
12 {
13 public AbstractOFBizTestCase()
14 {}
15
16
17
18
19
20 public AbstractOFBizTestCase(final String s)
21 {
22 super(s);
23 }
24
25 protected void setUp() throws Exception
26 {
27 MemoryHelper.clearCache();
28 CoreFactory.getGenericDelegator().clearAllCaches();
29
30 final String helperName = CoreFactory.getGenericDelegator().getEntityHelperName("SequenceValueItem");
31 final ModelEntity seqEntity = CoreFactory.getGenericDelegator().getModelEntity("SequenceValueItem");
32
33 CoreFactory.getGenericDelegator().setSequencer(new MockSequenceUtil(helperName, seqEntity, "seqName", "seqId"));
34 }
35 }