@Test public void parseDirectFilePathFromHeader() throws MalformedURLException { Bundle bundle = mock(Bundle.class); Hashtable<String, String> properties = new Hashtable<String, String>(); String path = "process.bpmn"; properties.put(BUNDLE_PROCESS_DEFINITIONS_HEADER, path); when(bundle.getHeaders()).thenReturn(properties); URL url = new URL("file: when(bundle.getEntry(eq(path))).thenReturn(url); List<URL> processes = ProcessDefinitionParser.scanForProcesses(bundle); assertThat(processes.size(), is(1)); assertThat(processes, hasItem(url)); }
public static List<URL> scanForProcesses(Bundle bundle) { LOGGER.log(Level.FINE, "Scanning bundle {} for process", bundle.getSymbolicName()); String processDefHeader = bundle.getHeaders().get( BUNDLE_PROCESS_DEFINITIONS_HEADER); if (processDefHeader == null) { processDefHeader = BUNDLE_PROCESS_DEFINTIONS_DEFAULT; } List<PathElement> paths = HeaderParser.parseHeader(processDefHeader); List<URL> pathList = parsePaths(paths, bundle); return pathList; }
ProcessDefinitionParser { public static List<URL> scanForProcesses(Bundle bundle) { LOGGER.log(Level.FINE, "Scanning bundle {} for process", bundle.getSymbolicName()); String processDefHeader = bundle.getHeaders().get( BUNDLE_PROCESS_DEFINITIONS_HEADER); if (processDefHeader == null) { processDefHeader = BUNDLE_PROCESS_DEFINTIONS_DEFAULT; } List<PathElement> paths = HeaderParser.parseHeader(processDefHeader); List<URL> pathList = parsePaths(paths, bundle); return pathList; } }
ProcessDefinitionParser { public static List<URL> scanForProcesses(Bundle bundle) { LOGGER.log(Level.FINE, "Scanning bundle {} for process", bundle.getSymbolicName()); String processDefHeader = bundle.getHeaders().get( BUNDLE_PROCESS_DEFINITIONS_HEADER); if (processDefHeader == null) { processDefHeader = BUNDLE_PROCESS_DEFINTIONS_DEFAULT; } List<PathElement> paths = HeaderParser.parseHeader(processDefHeader); List<URL> pathList = parsePaths(paths, bundle); return pathList; } private  ProcessDefinitionParser(); }
ProcessDefinitionParser { public static List<URL> scanForProcesses(Bundle bundle) { LOGGER.log(Level.FINE, "Scanning bundle {} for process", bundle.getSymbolicName()); String processDefHeader = bundle.getHeaders().get( BUNDLE_PROCESS_DEFINITIONS_HEADER); if (processDefHeader == null) { processDefHeader = BUNDLE_PROCESS_DEFINTIONS_DEFAULT; } List<PathElement> paths = HeaderParser.parseHeader(processDefHeader); List<URL> pathList = parsePaths(paths, bundle); return pathList; } private  ProcessDefinitionParser(); static List<URL> scanForProcesses(Bundle bundle); }
ProcessDefinitionParser { public static List<URL> scanForProcesses(Bundle bundle) { LOGGER.log(Level.FINE, "Scanning bundle {} for process", bundle.getSymbolicName()); String processDefHeader = bundle.getHeaders().get( BUNDLE_PROCESS_DEFINITIONS_HEADER); if (processDefHeader == null) { processDefHeader = BUNDLE_PROCESS_DEFINTIONS_DEFAULT; } List<PathElement> paths = HeaderParser.parseHeader(processDefHeader); List<URL> pathList = parsePaths(paths, bundle); return pathList; } private  ProcessDefinitionParser(); static List<URL> scanForProcesses(Bundle bundle);  }