@Test public void testShowRational() throws IOException { final Rational r = new Rational(123456,43211); JsonArrayBuilder b = this.handler.showRational(r); buildJson(b); handler.close(); String result = outString.toString(); LOGGER.info(FIND + result); final String expected = "{\"ARRAY\":[123456,43211]}"; assertEquals(expected, result); }
protected JsonArrayBuilder showRational(Rational r) { JsonArrayBuilder rationalBuilder = Json.createArrayBuilder(); long numer = r.getNumerator(); long denom = r.getDenominator(); rationalBuilder.add(numer); rationalBuilder.add(denom); return rationalBuilder; }
JsonHandler extends HandlerBase { protected JsonArrayBuilder showRational(Rational r) { JsonArrayBuilder rationalBuilder = Json.createArrayBuilder(); long numer = r.getNumerator(); long denom = r.getDenominator(); rationalBuilder.add(numer); rationalBuilder.add(denom); return rationalBuilder; } }
JsonHandler extends HandlerBase { protected JsonArrayBuilder showRational(Rational r) { JsonArrayBuilder rationalBuilder = Json.createArrayBuilder(); long numer = r.getNumerator(); long denom = r.getDenominator(); rationalBuilder.add(numer); rationalBuilder.add(denom); return rationalBuilder; } JsonHandler();  JsonHandler(String name, String release, int[] date, String note, String rights); }
JsonHandler extends HandlerBase { protected JsonArrayBuilder showRational(Rational r) { JsonArrayBuilder rationalBuilder = Json.createArrayBuilder(); long numer = r.getNumerator(); long denom = r.getDenominator(); rationalBuilder.add(numer); rationalBuilder.add(denom); return rationalBuilder; } JsonHandler();  JsonHandler(String name, String release, int[] date, String note, String rights); @Override void show(); @Override void show(App app); @Override void show(OutputHandler handler); @Override void show(Module module); @Override void show(RepInfo info); @Override void showFooter(); @Override void showHeader(); }
JsonHandler extends HandlerBase { protected JsonArrayBuilder showRational(Rational r) { JsonArrayBuilder rationalBuilder = Json.createArrayBuilder(); long numer = r.getNumerator(); long denom = r.getDenominator(); rationalBuilder.add(numer); rationalBuilder.add(denom); return rationalBuilder; } JsonHandler();  JsonHandler(String name, String release, int[] date, String note, String rights); @Override void show(); @Override void show(App app); @Override void show(OutputHandler handler); @Override void show(Module module); @Override void show(RepInfo info); @Override void showFooter(); @Override void showHeader();  }