SymbolizerTypeAnalyzer extends ParametersAnalyzer { public boolean validateGraphic(Graphic g){ if(g instanceof MarkGraphic){ MarkGraphic mg = (MarkGraphic) g; Halo h = mg.getHalo(); boolean b = validateStrokeAndFill(mg.getStroke(),mg.getFill()); if(h!=null){ return b && validateFill(h.getFill()); } else { return b; } } else { return false; } }  boolean validateFill(Fill f); boolean validateStroke(Stroke s); boolean validateStrokeAndFill(Stroke s, Fill f); boolean validateGraphic(Graphic g);  }
@Test public void testValidGraphic() throws Exception { SymbolizerTypeAnalyzer sta = new SymbolizerTypeAnalyzer(); MarkGraphic mg = new MarkGraphic(); assertTrue(sta.validateGraphic(mg)); }
@Test public void testInvalidGraphic() throws Exception { SymbolizerTypeAnalyzer sta = new SymbolizerTypeAnalyzer(); MarkGraphic mg = new MarkGraphic(); mg.setFill(new GraphicFill()); assertFalse(sta.validateGraphic(mg)); }
@Test public void testInvalidGraphic2() throws Exception { SymbolizerTypeAnalyzer sta = new SymbolizerTypeAnalyzer(); MarkGraphic mg = new MarkGraphic(); mg.setStroke(new GraphicStroke()); assertFalse(sta.validateGraphic(mg)); }
@Test public void testInvalidGraphic3() throws Exception { SymbolizerTypeAnalyzer sta = new SymbolizerTypeAnalyzer(); MarkGraphic mg = new MarkGraphic(); PenStroke ps = new PenStroke(); ps.setFill(new GraphicFill()); mg.setStroke(ps); assertFalse(sta.validateGraphic(mg)); }
@Test public void testInvalidGraphic4() throws Exception { SymbolizerTypeAnalyzer sta = new SymbolizerTypeAnalyzer(); assertFalse(sta.validateGraphic(new PieChart())); }