1 17 package org.alfresco.repo.node.integrity; 18 19 import java.util.HashSet ; 20 import java.util.List ; 21 import java.util.Set ; 22 23 import junit.framework.TestCase; 24 25 import org.alfresco.service.cmr.dictionary.DictionaryService; 26 import org.alfresco.service.cmr.repository.NodeRef; 27 import org.alfresco.service.cmr.repository.NodeService; 28 import org.alfresco.service.namespace.QName; 29 30 35 public class IntegrityEventTest extends TestCase 36 { 37 private static final String NAMESPACE = "http://test"; 38 39 private NodeRef nodeRef; 40 private QName typeQName; 41 private QName qname; 42 private IntegrityEvent event; 43 44 public void setUp() throws Exception 45 { 46 nodeRef = new NodeRef("workspace://protocol/ID123"); 47 typeQName = QName.createQName(NAMESPACE, "SomeTypeQName"); 48 qname = QName.createQName(NAMESPACE, "qname"); 49 50 event = new TestIntegrityEvent(null, null, nodeRef, typeQName, qname); 51 } 52 53 public void testSetFunctionality() throws Exception 54 { 55 Set <IntegrityEvent> set = new HashSet <IntegrityEvent>(5); 56 boolean added = set.add(event); 57 assertTrue(added); 58 added = set.add(new TestIntegrityEvent(null, null, nodeRef, typeQName, qname)); 59 assertFalse(added); 60 } 61 62 private static class TestIntegrityEvent extends AbstractIntegrityEvent 63 { 64 public TestIntegrityEvent( 65 NodeService nodeService, 66 DictionaryService dictionaryService, 67 NodeRef nodeRef, 68 QName typeQName, 69 QName qname) 70 { 71 super(nodeService, dictionaryService, nodeRef, typeQName, qname); 72 } 73 74 public void checkIntegrity(List <IntegrityRecord> eventResults) 75 { 76 throw new UnsupportedOperationException (); 77 } 78 } 79 } 80 | Popular Tags |