/** * Create a cross reference table from source to dest. * * @param source The methods that refer to dest * @param dest The methods that are being referred to * @return A mapping of source methods to destination methods. * @throws Exception */ public static Map<MethodDef, List<MethodDef>> getCrossRef(Collection<Clazz> source, Collection<Clazz> dest) throws Exception { final Map<MethodDef, List<MethodDef>> catalog = buildCatalog(dest); crossRef(source, catalog); return catalog; }
@Override public void write(OutputStream out) throws IOException { try { Map<MethodDef, List<MethodDef>> table = getCrossRef(testsuite, service); Tag coverage = toTag(table); PrintWriter pw = new PrintWriter(new OutputStreamWriter(out, Constants.DEFAULT_CHARSET)); try { coverage.print(0, pw); } finally { pw.flush(); } } catch (Exception e) { e.printStackTrace(); } }
public static Tag toTag(Map<MethodDef, List<MethodDef>> catalog) { Tag coverage = new Tag("coverage"); String currentClass = null; Tag classTag = null; for (Map.Entry<MethodDef, List<MethodDef>> m : catalog.entrySet()) { String className = m.getKey().clazz; if (!className.equals(currentClass)) { classTag = new Tag("class"); classTag.addAttribute("name", className); classTag.addAttribute("package", Clazz.getPackage(className)); classTag.addAttribute("short", Clazz.getShortName(className)); coverage.addContent(classTag); currentClass = className; } Tag method = doMethod(new Tag("method"), m.getKey()); classTag.addContent(method); for (MethodDef r : m.getValue()) { Tag ref = doMethod(new Tag("ref"), r); method.addContent(ref); } } return coverage; }
/** * Create a cross reference table from source to dest. * * @param source The methods that refer to dest * @param dest The methods that are being referred to * @return A mapping of source methods to destination methods. * @throws Exception */ public static Map<MethodDef, List<MethodDef>> getCrossRef(Collection<Clazz> source, Collection<Clazz> dest) throws Exception { final Map<MethodDef, List<MethodDef>> catalog = buildCatalog(dest); crossRef(source, catalog); return catalog; }
@Override public void write(OutputStream out) throws IOException { try { Map<MethodDef, List<MethodDef>> table = getCrossRef(testsuite, service); Tag coverage = toTag(table); PrintWriter pw = new PrintWriter(new OutputStreamWriter(out, Constants.DEFAULT_CHARSET)); try { coverage.print(0, pw); } finally { pw.flush(); } } catch (Exception e) { e.printStackTrace(); } }
public static Tag toTag(Map<MethodDef, List<MethodDef>> catalog) { Tag coverage = new Tag("coverage"); String currentClass = null; Tag classTag = null; for (Map.Entry<MethodDef, List<MethodDef>> m : catalog.entrySet()) { String className = m.getKey() .getContainingClass() .getFQN(); if (!className.equals(currentClass)) { classTag = new Tag("class"); classTag.addAttribute("name", className); classTag.addAttribute("package", Descriptors.getPackage(className)); classTag.addAttribute("short", Descriptors.getShortName(className)); coverage.addContent(classTag); currentClass = className; } Tag method = doMethod(new Tag("method"), m.getKey()); if (classTag != null) classTag.addContent(method); for (MethodDef r : m.getValue()) { Tag ref = doMethod(new Tag("ref"), r); method.addContent(ref); } } return coverage; }
/** * Create a cross reference table from source to dest. * * @param source * The methods that refer to dest * @param dest * The methods that are being referred to * @return A mapping of source methods to destination methods. * @throws IOException */ public static Map<MethodDef,List<MethodDef>> getCrossRef(Collection<Clazz> source, Collection<Clazz> dest) throws Exception { final Map<MethodDef,List<MethodDef>> catalog = buildCatalog(dest); crossRef(source, catalog); return catalog; }
@Override public void write(OutputStream out) throws IOException { try { Map<MethodDef,List<MethodDef>> table = getCrossRef(testsuite, service); Tag coverage = toTag(table); PrintWriter pw = new PrintWriter(new OutputStreamWriter(out, Constants.DEFAULT_CHARSET)); try { coverage.print(0, pw); } finally { pw.flush(); } } catch (Exception e) { e.printStackTrace(); } }
public static Tag toTag(Map<MethodDef,List<MethodDef>> catalog) { Tag coverage = new Tag("coverage"); String currentClass = null; Tag classTag = null; for (Map.Entry<MethodDef,List<MethodDef>> m : catalog.entrySet()) { String className = m.getKey().getContainingClass().getFQN(); if (!className.equals(currentClass)) { classTag = new Tag("class"); classTag.addAttribute("name", className); classTag.addAttribute("package", Descriptors.getPackage(className)); classTag.addAttribute("short", Descriptors.getShortName(className)); coverage.addContent(classTag); currentClass = className; } Tag method = doMethod(new Tag("method"), m.getKey()); if ( classTag != null) classTag.addContent(method); for (MethodDef r : m.getValue()) { Tag ref = doMethod(new Tag("ref"), r); method.addContent(ref); } } return coverage; }
/** * Create a cross reference table from source to dest. * * @param source * The methods that refer to dest * @param dest * The methods that are being referred to * @return A mapping of source methods to destination methods. * @throws IOException */ public static Map<MethodDef,List<MethodDef>> getCrossRef(Collection<Clazz> source, Collection<Clazz> dest) throws Exception { final Map<MethodDef,List<MethodDef>> catalog = buildCatalog(dest); crossRef(source, catalog); return catalog; }
@Override public void write(OutputStream out) throws IOException { try { Map<MethodDef,List<MethodDef>> table = getCrossRef(testsuite, service); Tag coverage = toTag(table); PrintWriter pw = new PrintWriter(new OutputStreamWriter(out, Constants.DEFAULT_CHARSET)); try { coverage.print(0, pw); } finally { pw.flush(); } } catch (Exception e) { e.printStackTrace(); } }
public static Tag toTag(Map<MethodDef,List<MethodDef>> catalog) { Tag coverage = new Tag("coverage"); String currentClass = null; Tag classTag = null; for (Map.Entry<MethodDef,List<MethodDef>> m : catalog.entrySet()) { String className = m.getKey().getContainingClass().getFQN(); if (!className.equals(currentClass)) { classTag = new Tag("class"); classTag.addAttribute("name", className); classTag.addAttribute("package", Descriptors.getPackage(className)); classTag.addAttribute("short", Descriptors.getShortName(className)); coverage.addContent(classTag); currentClass = className; } Tag method = doMethod(new Tag("method"), m.getKey()); if ( classTag != null) classTag.addContent(method); for (MethodDef r : m.getValue()) { Tag ref = doMethod(new Tag("ref"), r); method.addContent(ref); } } return coverage; }
/** * Create a cross reference table from source to dest. * * @param source * The methods that refer to dest * @param dest * The methods that are being referred to * @return A mapping of source methods to destination methods. * @throws IOException */ public static Map<MethodDef,List<MethodDef>> getCrossRef(Collection<Clazz> source, Collection<Clazz> dest) throws Exception { final Map<MethodDef,List<MethodDef>> catalog = buildCatalog(dest); crossRef(source, catalog); return catalog; }
@Override public void write(OutputStream out) throws IOException { try { Map<MethodDef,List<MethodDef>> table = getCrossRef(testsuite, service); Tag coverage = toTag(table); PrintWriter pw = new PrintWriter(new OutputStreamWriter(out, Constants.DEFAULT_CHARSET)); try { coverage.print(0, pw); } finally { pw.flush(); } } catch (Exception e) { e.printStackTrace(); } }
public static Tag toTag(Map<MethodDef, List<MethodDef>> catalog) { Tag coverage = new Tag("coverage"); String currentClass = null; Tag classTag = null; for (Map.Entry<MethodDef, List<MethodDef>> m : catalog.entrySet()) { String className = m.getKey() .getContainingClass() .getFQN(); if (!className.equals(currentClass)) { classTag = new Tag("class"); classTag.addAttribute("name", className); classTag.addAttribute("package", Descriptors.getPackage(className)); classTag.addAttribute("short", Descriptors.getShortName(className)); coverage.addContent(classTag); currentClass = className; } Tag method = doMethod(new Tag("method"), m.getKey()); if (classTag != null) classTag.addContent(method); for (MethodDef r : m.getValue()) { Tag ref = doMethod(new Tag("ref"), r); method.addContent(ref); } } return coverage; }
/** * Create a cross reference table from source to dest. * * @param source * The methods that refer to dest * @param dest * The methods that are being referred to * @return A mapping of source methods to destination methods. * @throws IOException */ public static Map<MethodDef, List<MethodDef>> getCrossRef( Collection<Clazz> source, Collection<Clazz> dest) throws Exception { final Map<MethodDef, List<MethodDef>> catalog = buildCatalog(dest); crossRef(source, catalog); return catalog; }
@Override public void write(OutputStream out) throws IOException { try { Map<MethodDef, List<MethodDef>> table = getCrossRef(testsuite, service); Tag coverage = toTag(table); PrintWriter pw = new PrintWriter(new OutputStreamWriter(out, Constants.DEFAULT_CHARSET)); try { coverage.print(0, pw); } finally { pw.flush(); } } catch (Exception e) { e.printStackTrace(); } }
public static Tag toTag(Map<MethodDef,List<MethodDef>> catalog) { Tag coverage = new Tag("coverage"); String currentClass = null; Tag classTag = null; for (Map.Entry<MethodDef,List<MethodDef>> m : catalog.entrySet()) { String className = m.getKey().getContainingClass().getFQN(); if (!className.equals(currentClass)) { classTag = new Tag("class"); classTag.addAttribute("name", className); classTag.addAttribute("package", Descriptors.getPackage(className)); classTag.addAttribute("short", Descriptors.getShortName(className)); coverage.addContent(classTag); currentClass = className; } Tag method = doMethod(new Tag("method"), m.getKey()); if ( classTag != null) classTag.addContent(method); for (MethodDef r : m.getValue()) { Tag ref = doMethod(new Tag("ref"), r); method.addContent(ref); } } return coverage; }