BindTag tag = new BindTag();
tag.setPageContext(pc);
tag.setPath("tb");
assertTrue("Correct doStartTag return value", tag.doStartTag() == Tag.EVAL_BODY_INCLUDE);
BindStatus status = (BindStatus) pc.getAttribute(BindTag.STATUS_VARIABLE_NAME, PageContext.REQUEST_SCOPE);
assertTrue("Has status variable", status != null);
assertTrue("Correct expression", status.getExpression() == null);
assertTrue("Correct value", status.getValue() == null);
assertTrue("Correct displayValue", "".equals(status.getDisplayValue()));
assertTrue("Correct isError", status.isError());
assertTrue("Correct errorMessages", status.getErrorMessages().length == 1);
assertTrue("Correct errorMessage", "message1".equals(status.getErrorMessage()));
assertTrue("Correct errorMessagesAsString", "message1".equals(status.getErrorMessagesAsString(",")));
tag = new BindTag();
tag.setPageContext(pc);
tag.setPath("tb.*");
assertTrue("Correct doStartTag return value", tag.doStartTag() == Tag.EVAL_BODY_INCLUDE);
status = (BindStatus) pc.getAttribute(BindTag.STATUS_VARIABLE_NAME, PageContext.REQUEST_SCOPE);
assertTrue("Has status variable", status != null);
assertTrue("Correct expression", "*".equals(status.getExpression()));
assertTrue("Correct value", status.getValue() == null);
assertTrue("Correct displayValue", "".equals(status.getDisplayValue()));
assertTrue("Correct isError", status.isError());
assertTrue("Correct errorMessages", status.getErrorMessages().length == 1);
assertTrue("Correct errorMessage", "message1".equals(status.getErrorMessage()));
assertTrue("Correct errorMessagesAsString", "message1".equals(status.getErrorMessagesAsString(",")));
}