PmMessageApi { public static List<PmMessage> getMessages(PmObject pm) { return pm.getPmConversation().getPmMessages(pm, null); }  static PmMessage addMessage(PmObject pm, Severity severity, String key, Object... resArgs); static PmMessage addStringMessage(PmObject pm, Severity severity, String msgString); static PmResourceData makeRequiredMessageResData(PmAttr<?> pm); @Deprecated static PmResourceData addRequiredMessage(PmAttr<?> pm); static List<PmMessage> getMessages(PmObject pm); static List<PmMessage> getMessages(PmObject pm, Severity severity); static List<PmMessage> clearPmTreeMessages(PmObject pm); static List<PmMessage> getPmTreeMessages(PmObject pm, Severity minSeverity);  }
@Test public void testRequiredDefaultMessage() { PmValidationApi.validate(testPm); Assert.assertEquals("Please enter a value into \"Attr 1\".", PmMessageApi.getMessages(testPm.attrWithDefaultRequiredMessage).get(0).getTitle()); }
@Test public void testRequiredResourceDefinedSpecialMessage() { PmValidationApi.validate(testPm); Assert.assertEquals("The attribute Attr 2 is really required ;-)", PmMessageApi.getMessages(testPm.attrWithIndividualRequiredMessage).get(0).getTitle()); }