XStreamFlowConfigurationDAO extends XStreamDAO<FlowConfiguration> implements
        FlowManagerConfigurationDAO { public FileBasedFlowConfiguration find(FlowConfiguration exampleInstance, boolean lock) throws IOException { return find(exampleInstance.getId(), lock); } XStreamFlowConfigurationDAO(String directory, Alias alias); FileBasedFlowConfiguration find(FlowConfiguration exampleInstance, boolean lock); FileBasedFlowConfiguration find(String id, boolean lock);  }
@Test public void testDAO() throws IOException { Resource resource = context.getResource("data"); File dir = resource.getFile(); assertTrue(dir.exists()); File file = new File(dir, "flow1.xml"); assertTrue(file.exists()); XStreamFlowConfigurationDAO dao = new XStreamFlowConfigurationDAO(dir.getAbsolutePath(), createAlias()); FileBasedFlowConfiguration fbfc = dao.find("flow1", false); assertNotNull(fbfc); assertEquals(fbfc.getId(), "flow1"); assertEquals(fbfc.getName(), "flow1name"); assertEquals(fbfc.getDescription(), "flow1desc"); FileBasedEventGeneratorConfiguration fbegc = (FileBasedEventGeneratorConfiguration) fbfc .getEventGeneratorConfiguration(); assertNotNull(fbegc); FileBasedEventConsumerConfiguration fbecc = (FileBasedEventConsumerConfiguration) fbfc .getEventConsumerConfiguration(); assertNotNull(fbecc); List<? extends ActionConfiguration> lac = fbecc.getActions(); assertNull(lac); }