SimpleComponentFactory implements ComponentFactory { public ProcessingItem createPi(Processor processor, int paralellism) { return new SimpleProcessingItem(processor, paralellism); }  ProcessingItem createPi(Processor processor, int paralellism); ProcessingItem createPi(Processor processor); EntranceProcessingItem createEntrancePi(EntranceProcessor processor); Stream createStream(IProcessingItem sourcePi); Topology createTopology(String topoName);  }
@Test public void testCreatePiNoParallelism() { ProcessingItem pi = factory.createPi(processor); assertNotNull("ProcessingItem created is null.",pi); assertEquals("ProcessingItem created is not a SimpleProcessingItem.",SimpleProcessingItem.class,pi.getClass()); assertEquals("Parallelism of PI is not 1",1,pi.getParallelism(),0); }
@Test public void testCreatePiWithParallelism() { ProcessingItem pi = factory.createPi(processor,parallelism); assertNotNull("ProcessingItem created is null.",pi); assertEquals("ProcessingItem created is not a SimpleProcessingItem.",SimpleProcessingItem.class,pi.getClass()); assertEquals("Parallelism of PI is not ",parallelism,pi.getParallelism(),0); }