本文整理汇总了Java中org.kuali.rice.ken.service.ProcessingResult类的典型用法代码示例。如果您正苦于以下问题:Java ProcessingResult类的具体用法?Java ProcessingResult怎么用?Java ProcessingResult使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ProcessingResult类属于org.kuali.rice.ken.service包,在下文中一共展示了ProcessingResult类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: groupWorkItems
import org.kuali.rice.ken.service.ProcessingResult; //导入依赖的package包/类
/**
* Template method that subclasses should override to group work items into units of work
* @param workItems list of work items to break into groups
* @param result ProcessingResult to modify if there are any failures...this is sort of a hack because previously
* failure to obtain a deliverer was considered a work item failure, and now this method has been factored out...
* but the tests still want to see the failure
* @return a collection of collection of work items
*/
protected Collection<Collection<T>> groupWorkItems(Collection<T> workItems, ProcessingResult result) {
Collection<Collection<T>> groupedWorkItems = new ArrayList<Collection<T>>();
if (workItems != null) {
for (T workItem: workItems) {
Collection<T> c = new ArrayList<T>(1);
c.add(workItem);
groupedWorkItems.add(c);
}
}
return groupedWorkItems;
}
示例2: resolveNotificationMessageDeliveries
import org.kuali.rice.ken.service.ProcessingResult; //导入依赖的package包/类
/**
* This method is responsible for resolving the list of NotificationMessageDelivery records for a given notification. This service will look
* at all notifications that are ready to be delivered and will "explode" out specific message delivery records for given delivery end points.
* @see org.kuali.rice.ken.service.NotificationMessageDeliveryResolverService#resolveNotificationMessageDeliveries()
*/
public ProcessingResult resolveNotificationMessageDeliveries() {
LOG.debug("[" + new Timestamp(System.currentTimeMillis()).toString() + "] STARTING RESOLUTION OF NOTIFICATION MESSAGE DELIVERIES");
ProcessingResult result = run();
LOG.debug("[" + new Timestamp(System.currentTimeMillis()).toString() + "] FINISHED RESOLUTION OF NOTIFICATION MESSAGE DELIVERIES - " +
"Message Delivery End Points Resolved = " + result.getSuccesses().size());
return result;
}
示例3: testAutoRemovedNotificationMessageDeliveries
import org.kuali.rice.ken.service.ProcessingResult; //导入依赖的package包/类
/**
* Test auto-removal message deliveries
*/
@Test
public void testAutoRemovedNotificationMessageDeliveries() {
NotificationMessageDeliveryAutoRemovalService nSvc = services.getNotificationMessageDeliveryAutoRemovalService();
services.getNotificationMessageDeliveryResolverService().resolveNotificationMessageDeliveries();
ProcessingResult result = nSvc.processAutoRemovalOfDeliveredNotificationMessageDeliveries();
assertEquals(0, result.getFailures().size());
assertEquals(EXPECTED_SUCCESSES, result.getSuccesses().size());
assertProcessResults();
}
示例4: testAutoRemovalConcurrency
import org.kuali.rice.ken.service.ProcessingResult; //导入依赖的package包/类
/**
* Test concurrent auto-removal of message deliveries
*/
@Test
public void testAutoRemovalConcurrency() throws InterruptedException {
final NotificationMessageDeliveryAutoRemovalService nSvc = services.getNotificationMessageDeliveryAutoRemovalService();
services.getNotificationMessageDeliveryResolverService().resolveNotificationMessageDeliveries();
final ProcessingResult[] results = new ProcessingResult[2];
Thread t1 = new Thread(new Runnable() {
public void run() {
results[0] = nSvc.processAutoRemovalOfDeliveredNotificationMessageDeliveries();
}
});
Thread t2 = new Thread(new Runnable() {
public void run() {
results[1] = nSvc.processAutoRemovalOfDeliveredNotificationMessageDeliveries();
}
});
t1.start();
t2.start();
t1.join();
t2.join();
// assert that ONE of the autoremovers got all the items, and the other got NONE of the items
LOG.info("Results of thread #1: " + results[0]);
LOG.info("Results of thread #2: " + results[1]);
assertTrue((results[0].getSuccesses().size() == EXPECTED_SUCCESSES && results[0].getFailures().size() == 0 &&
results[1].getSuccesses().size() == 0 && results[1].getFailures().size() == 0) ||
(results[1].getSuccesses().size() == EXPECTED_SUCCESSES && results[1].getFailures().size() == 0 &&
results[0].getSuccesses().size() == 0 && results[0].getFailures().size() == 0));
assertProcessResults();
}
示例5: testResolveNotificationMessageDeliveries
import org.kuali.rice.ken.service.ProcessingResult; //导入依赖的package包/类
/**
* Test resolution of notifications
* This test resolves UNRESOLVED notification ids #3 and #4 in the test data. An artificial exception is generated for notification #3.
* For notification #4, the recipients are defined to be the Rice Team and testuser1. This results in 8 recipient resolutions, two of which
* are Email deliveries for jaf30 and ag266.
* If you change the test data this test should be updated to reflect the expected results.
*/
@Test
public void testResolveNotificationMessageDeliveries() throws Exception {
NotificationMessageDeliveryResolverService nSvc = getResolverService();
ProcessingResult result = nSvc.resolveNotificationMessageDeliveries();
assertEquals(EXPECTED_SUCCESSES, result.getSuccesses().size());
assertProcessResults();
}
示例6: testAutoRemovalConcurrency
import org.kuali.rice.ken.service.ProcessingResult; //导入依赖的package包/类
/**
* Test concurrent auto-removal of message deliveries
*/
@Test
public void testAutoRemovalConcurrency() throws InterruptedException {
final NotificationMessageDeliveryAutoRemovalService nSvc = services.getNotificationMessageDeliveryAutoRemovalService();
services.getNotificationMessageDeliveryResolverService().resolveNotificationMessageDeliveries();
final ProcessingResult[] results = new ProcessingResult[2];
Thread t1 = new Thread(new Runnable() {
public void run() {
results[0] = nSvc.processAutoRemovalOfDeliveredNotificationMessageDeliveries();
}
});
Thread t2 = new Thread(new Runnable() {
public void run() {
results[1] = nSvc.processAutoRemovalOfDeliveredNotificationMessageDeliveries();
}
});
t1.start();
t2.start();
t1.join();
t2.join();
// assert that ONE of the autoremovers got all the items, and the other got NONE of the items
LOG.info("Results of thread #1: " + results[0]);
LOG.info("Results of thread #2: " + results[1]);
assertTrue((results[0].getSuccesses().size() == EXPECTED_SUCCESSES && results[0].getFailures().size() == 0 && results[1].getSuccesses().size() == 0 && results[1].getFailures().size() == 0) ||
(results[1].getSuccesses().size() == EXPECTED_SUCCESSES && results[1].getFailures().size() == 0 && results[0].getSuccesses().size() == 0 && results[0].getFailures().size() == 0));
assertProcessResults();
}
开发者ID:aapotts,项目名称:kuali_rice,代码行数:36,代码来源:NotificationMessageDeliveryAutoRemovalServiceImplTest.java
示例7: testResolveNotificationMessageDeliveries
import org.kuali.rice.ken.service.ProcessingResult; //导入依赖的package包/类
/**
* Test resolution of notifications
* This test resolves UNRESOLVED notification ids #3 and #4 in the test data. An artificial exception is generated for notification #3.
* For notification #4, the recipients are defined to be the Rice Team and testuser1. This results in 8 recipient resolutions, two of which
* are Email deliveries for jaf30 and ag266.
* If you change the test data this test should be updated to reflect the expected results.
*/
@Test
public void testResolveNotificationMessageDeliveries() throws Exception {
NotificationMessageDeliveryResolverService nSvc = getResolverService();
ProcessingResult result = nSvc.resolveNotificationMessageDeliveries();
Thread.sleep(20000);
assertEquals(EXPECTED_SUCCESSES, result.getSuccesses().size());
MessageService ms = (MessageService) GlobalKCBServiceLocator.getInstance().getMessageService();
assertEquals(result.getSuccesses().size(), ms.getAllMessages().size());
assertProcessResults();
}
示例8: processAutoRemovalOfDeliveredNotificationMessageDeliveries
import org.kuali.rice.ken.service.ProcessingResult; //导入依赖的package包/类
/**
* This implementation looks up all UNDELIVERED/DELIVERED message deliveries with an autoRemoveDateTime <= current date time and then iterates
* over each to call the appropriate functions to do the "auto-removal" by "canceling" each associated notification
* workflow document.
* @see org.kuali.rice.ken.service.NotificationMessageDeliveryDispatchService#processAutoRemovalOfDeliveredNotificationMessageDeliveries()
*/
public ProcessingResult processAutoRemovalOfDeliveredNotificationMessageDeliveries() {
LOG.debug("[" + new Timestamp(System.currentTimeMillis()).toString() + "] STARTING NOTIFICATION AUTO-REMOVAL PROCESSING");
ProcessingResult result = run();
LOG.debug("[" + new Timestamp(System.currentTimeMillis()).toString() + "] FINISHED NOTIFICATION AUTO-REMOVAL PROCESSING - Successes = " + result.getSuccesses().size() + ", Failures = " + result.getFailures().size());
return result;
}