Example #1
0
def testLocal(islandId,numMessages):
    mc = ManagementContainer.getInstance()
    pm = mc.getPartitionManager()
    custId = None

    try:       
        custId = findCustomer("rgm-local")
        print 'Found customer id',custId
        
        if custId < 0:
            print 'Unable to locate test customer named rgm2'
            return 1
            
        msgs = findMessages(mc,custId,numMessages)
        for msg in msgs:
            pp = pm.getContentProxy(msg.getPartitionId())
    
            print 'Get message',msg.getMessageId(),"from partition",msg.getPartitionId()
            inputStream = pp.getRawMessage(custId,-1,msg.getMessageId())
            if inputStream is None:
                print >>sys.stderr,"Got null stream for message",msg.getMessageId(),"from partition",msg.getPartitionId()
                return 1
            createPurgeOrphan(mc,msg)
            print 'Get message',msg.getMessageId(),"from partition",msg.getPartitionId()
            try:
                inputStream = pp.getRawMessage(custId,-1,msg.getMessageId())
                print >>sys.stderr,"Got unexpected stream for message",msg.getMessageId(),"from partition",msg.getPartitionId(),inputStream
                return 1
            except MessageNotFoundIOException, e:
                print >>sys.stderr,"Got expected MessageNotFoundIOException"
            except:
                print >>sys.stderr,"Got unexpected exception for message",msg.getMessageId(),"from partition",msg.getPartitionId(),sys.except_info()
                return 1
Example #2
0
        pp = pm.getContentProxy(msg.getPartitionId())
        print 'Get message',msg.getMessageId(),"from partition",msg.getPartitionId()
        inputStream = pp.getRawMessage(custId,-1,msg.getMessageId())
        if inputStream is None:
            print >>sys.stderr,"Got null stream for message",msg.getMessageId(),"from partition",msg.getPartitionId()
            return 1
        createPurgeOrphan(mc,msg)
        print 'Get message',msg.getMessageId(),"from partition",msg.getPartitionId()
        try:
            inputStream = pp.getRawMessage(custId,-1,msg.getMessageId())
            print >>sys.stderr,"Got unexpected stream for message",msg.getMessageId(),"from partition",msg.getPartitionId()
            return 1
        except MessageNotFoundIOException, e:
            print >>sys.stderr,"Got expected MessageNotFoundIOException"
        except:
            print >>sys.stderr,"Got unexpected exception for message",msg.getMessageId(),"from partition",msg.getPartitionId(),sys.except_info()
            return 1

    return 0

def testLocal(islandId,numMessages):
    mc = ManagementContainer.getInstance()
    pm = mc.getPartitionManager()
    custId = None

    try:       
        custId = findCustomer("rgm-local")
        print 'Found customer id',custId
        
        if custId < 0:
            print 'Unable to locate test customer named rgm2'