Code example for ResourceArrayPropertyEditor

Methods: setAsText, getValue

0
 
	private MultiResourcePartitioner partitioner = new MultiResourcePartitioner();
 
	@Before 
	public void setUp() { 
		ResourceArrayPropertyEditor editor = new ResourceArrayPropertyEditor();
		editor.setAsText("classpath:baseContext.xml");
		partitioner.setResources((Resource[]) editor.getValue());
	} 
 
	@Test(expected = IllegalStateException.class)
	public void testMissingResource() { 
		partitioner.setResources(new Resource[] { new FileSystemResource("does-not-exist") });
		partitioner.partition(0);
	} 
 
	@Test
	public void testPartitionSizeAndKey() { 
		Map<String, ExecutionContext> partition = partitioner.partition(0);
		assertEquals(1, partition.size());
Connect your IDE to all the code out there  Get Codota for Java