Fix issues raised by tests

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2565 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2006-03-22 12:04:59 +00:00
parent 706c1e331d
commit 9fe16d5ae3
3 changed files with 6 additions and 14 deletions

View File

@@ -33,11 +33,9 @@ import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.repository.StoreRef; import org.alfresco.service.cmr.repository.StoreRef;
import org.alfresco.service.namespace.QName; import org.alfresco.service.namespace.QName;
import org.alfresco.service.transaction.TransactionService; import org.alfresco.service.transaction.TransactionService;
import org.alfresco.util.ApplicationContextHelper;
import org.alfresco.util.PropertyMap; import org.alfresco.util.PropertyMap;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.springframework.context.ApplicationContext;
/** /**
* Checks that tagging of <i>incomplete</i> nodes is done properly. * Checks that tagging of <i>incomplete</i> nodes is done properly.
@@ -49,12 +47,6 @@ public class IncompleteNodeTaggerTest extends TestCase
{ {
private static Log logger = LogFactory.getLog(IncompleteNodeTaggerTest.class); private static Log logger = LogFactory.getLog(IncompleteNodeTaggerTest.class);
private static ApplicationContext ctx;
static
{
ctx = ApplicationContextHelper.getApplicationContext();
}
private IncompleteNodeTagger tagger; private IncompleteNodeTagger tagger;
private ServiceRegistry serviceRegistry; private ServiceRegistry serviceRegistry;
private NodeService nodeService; private NodeService nodeService;
@@ -65,7 +57,7 @@ public class IncompleteNodeTaggerTest extends TestCase
public void setUp() throws Exception public void setUp() throws Exception
{ {
DictionaryDAO dictionaryDao = (DictionaryDAO) ctx.getBean("dictionaryDAO"); DictionaryDAO dictionaryDao = (DictionaryDAO) IntegrityTest.ctx.getBean("dictionaryDAO");
ClassLoader cl = BaseNodeServiceTest.class.getClassLoader(); ClassLoader cl = BaseNodeServiceTest.class.getClassLoader();
// load the test model // load the test model
InputStream modelStream = cl.getResourceAsStream("org/alfresco/repo/node/integrity/IntegrityTest_model.xml"); InputStream modelStream = cl.getResourceAsStream("org/alfresco/repo/node/integrity/IntegrityTest_model.xml");
@@ -73,11 +65,11 @@ public class IncompleteNodeTaggerTest extends TestCase
M2Model model = M2Model.createModel(modelStream); M2Model model = M2Model.createModel(modelStream);
dictionaryDao.putModel(model); dictionaryDao.putModel(model);
tagger = (IncompleteNodeTagger) ctx.getBean("incompleteNodeTagger"); tagger = (IncompleteNodeTagger) IntegrityTest.ctx.getBean("incompleteNodeTagger");
serviceRegistry = (ServiceRegistry) ctx.getBean(ServiceRegistry.SERVICE_REGISTRY); serviceRegistry = (ServiceRegistry) IntegrityTest.ctx.getBean(ServiceRegistry.SERVICE_REGISTRY);
nodeService = serviceRegistry.getNodeService(); nodeService = serviceRegistry.getNodeService();
this.authenticationComponent = (AuthenticationComponent)ctx.getBean("authenticationComponent"); this.authenticationComponent = (AuthenticationComponent)IntegrityTest.ctx.getBean("authenticationComponent");
this.authenticationComponent.setSystemUserAsCurrentUser(); this.authenticationComponent.setSystemUserAsCurrentUser();

View File

@@ -79,7 +79,7 @@ public class IntegrityTest extends TestCase
public static final QName TEST_PROP_INT_B = QName.createQName(NAMESPACE, "prop-int-b"); public static final QName TEST_PROP_INT_B = QName.createQName(NAMESPACE, "prop-int-b");
public static final QName TEST_PROP_INT_C = QName.createQName(NAMESPACE, "prop-int-c"); public static final QName TEST_PROP_INT_C = QName.createQName(NAMESPACE, "prop-int-c");
private static ApplicationContext ctx; public static ApplicationContext ctx;
static static
{ {
ctx = ApplicationContextHelper.getApplicationContext(); ctx = ApplicationContextHelper.getApplicationContext();

View File

@@ -115,7 +115,7 @@
<properties> <properties>
<property name="test:prop-int-a"> <property name="test:prop-int-a">
<type>d:int</type> <type>d:int</type>
<mandatory>true</mandatory> <mandatory enforced="true">true</mandatory>
</property> </property>
<property name="test:prop-int-b"> <property name="test:prop-int-b">
<type>d:int</type> <type>d:int</type>