1 package org.kuali.ole.docstore.process;
2
3 import org.apache.camel.Exchange;
4 import org.apache.camel.ExchangePattern;
5 import org.apache.camel.impl.DefaultCamelContext;
6 import org.apache.camel.impl.DefaultExchange;
7 import org.junit.Test;
8 import org.kuali.ole.BaseTestCase;
9 import org.slf4j.Logger;
10 import org.slf4j.LoggerFactory;
11
12
13
14
15
16
17
18
19
20 public class BulkIngestNIndexRouteBuilder_UT extends BaseTestCase {
21
22 private static final Logger LOG = LoggerFactory.getLogger(BulkIngestNIndexRouteBuilder_UT.class);
23 Exchange exchange = new DefaultExchange(new DefaultCamelContext(), ExchangePattern.InOut);
24
25 @Test
26 public void testBodyAggregator() {
27 BodyAggregator bodyAggregator = new BodyAggregator();
28 bodyAggregator.setFileIngestStatistics(bodyAggregator.getFileIngestStatistics());
29 exchange.setProperty("CamelSplitIndex", new Integer("0"));
30 bodyAggregator.aggregate(null, exchange);
31 }
32
33 @Test
34 public void testBulkIngestNIndexProcessor() throws Exception {
35 BulkIngestNIndexProcessor bulkIngestNIndexProcessor = new BulkIngestNIndexProcessor("user", "action");
36 bulkIngestNIndexProcessor.setBulkLoadStatistics(bulkIngestNIndexProcessor.getBulkLoadStatistics());
37 bulkIngestNIndexProcessor.setBulkProcessRequest(bulkIngestNIndexProcessor.getBulkProcessRequest());
38
39 }
40
41 @Test
42 public void testSplitPredicate() {
43 SplitPredicate splitPredicate = new SplitPredicate(new Integer("1000"));
44 exchange.setProperty("CamelFileExchangeFile", new String("CamelFileExchangeFile"));
45 exchange.setProperty("CamelSplitComplete", new Boolean("true"));
46 exchange.setProperty("CamelAggregatedSize", new Integer("000"));
47 splitPredicate.matches(exchange);
48 exchange.setProperty("CamelFileExchangeFile", new String("CamelFileExchangeFile"));
49 exchange.setProperty("CamelSplitComplete", new String("CamelSplitComplete"));
50 exchange.setProperty("CamelAggregatedSize", new Integer("1000"));
51 splitPredicate.matches(exchange);
52 exchange.setProperty("CamelFileExchangeFile", new String("CamelFileExchangeFile"));
53 exchange.setProperty("CamelSplitComplete", new String("CamelSplitComplete"));
54 exchange.setProperty("CamelAggregatedSize", new Integer("000"));
55 splitPredicate.matches(exchange);
56 }
57
58 }