@Test(expected = AssertionError.class) public void getFromFileNameNotExisting() { JavaParserUtils.getFromFileName("not_existing"); }
public static CompilationUnit getFromFileName(String fileName) { try { final InputStream resource = Thread.currentThread().getContextClassLoader().getResourceAsStream(fileName); return StaticJavaParser.parse(resource); } catch (ParseProblemException e) { throw new KiePMMLInternalException(String.format("Failed to parse %s due to %s", fileName, e.getMessage()), e); } catch (Exception e) { throw new ExternalException(String.format("Failed to read %s due to %s", fileName, e.getMessage()), e); } }
JavaParserUtils { public static CompilationUnit getFromFileName(String fileName) { try { final InputStream resource = Thread.currentThread().getContextClassLoader().getResourceAsStream(fileName); return StaticJavaParser.parse(resource); } catch (ParseProblemException e) { throw new KiePMMLInternalException(String.format("Failed to parse %s due to %s", fileName, e.getMessage()), e); } catch (Exception e) { throw new ExternalException(String.format("Failed to read %s due to %s", fileName, e.getMessage()), e); } } }
JavaParserUtils { public static CompilationUnit getFromFileName(String fileName) { try { final InputStream resource = Thread.currentThread().getContextClassLoader().getResourceAsStream(fileName); return StaticJavaParser.parse(resource); } catch (ParseProblemException e) { throw new KiePMMLInternalException(String.format("Failed to parse %s due to %s", fileName, e.getMessage()), e); } catch (Exception e) { throw new ExternalException(String.format("Failed to read %s due to %s", fileName, e.getMessage()), e); } } private  JavaParserUtils(); }
JavaParserUtils { public static CompilationUnit getFromFileName(String fileName) { try { final InputStream resource = Thread.currentThread().getContextClassLoader().getResourceAsStream(fileName); return StaticJavaParser.parse(resource); } catch (ParseProblemException e) { throw new KiePMMLInternalException(String.format("Failed to parse %s due to %s", fileName, e.getMessage()), e); } catch (Exception e) { throw new ExternalException(String.format("Failed to read %s due to %s", fileName, e.getMessage()), e); } } private  JavaParserUtils(); static CompilationUnit getFromFileName(String fileName); static CompilationUnit getKiePMMLModelCompilationUnit(final String className,
                                                                 final String packageName,
                                                                 final String javaTemplate,
                                                                 final String modelClassName); static String getFullClassName(final CompilationUnit cu); }
JavaParserUtils { public static CompilationUnit getFromFileName(String fileName) { try { final InputStream resource = Thread.currentThread().getContextClassLoader().getResourceAsStream(fileName); return StaticJavaParser.parse(resource); } catch (ParseProblemException e) { throw new KiePMMLInternalException(String.format("Failed to parse %s due to %s", fileName, e.getMessage()), e); } catch (Exception e) { throw new ExternalException(String.format("Failed to read %s due to %s", fileName, e.getMessage()), e); } } private  JavaParserUtils(); static CompilationUnit getFromFileName(String fileName); static CompilationUnit getKiePMMLModelCompilationUnit(final String className,
                                                                 final String packageName,
                                                                 final String javaTemplate,
                                                                 final String modelClassName); static String getFullClassName(final CompilationUnit cu); static final String MAIN_CLASS_NOT_FOUND; }