private void assertArgsHaveBundle(ResourceBundle orig, List<? extends ArgSpec> args) { assertFalse("args should not be empty", args.isEmpty()); for (ArgSpec arg : args) { assertNotNull("Messages for " + arg.toString(), arg.messages()); assertSame(arg.toString(), orig, arg.messages().resourceBundle()); } }
private void assertArgsHaveBundle(ResourceBundle orig, List<? extends ArgSpec> args) { assertFalse("args should not be empty", args.isEmpty()); for (ArgSpec arg : args) { assertNotNull("Messages for " + arg.toString(), arg.messages()); assertSame(arg.toString(), orig, arg.messages().resourceBundle()); } }
/** Returns the ResourceBundle of the specified Messages object or {@code null} if the specified Messages object is {@code null}. */ public static ResourceBundle resourceBundle(Messages messages) { return messages == null ? null : messages.resourceBundle(); } /** Returns the ResourceBundle of this object or {@code null}. */
@Test public void testMessagesCopyNonNull() { Messages orig = new Messages(CommandSpec.create(), null); Messages copy = Messages.copy(CommandSpec.create(), orig); assertNull(copy.resourceBundle()); }
/** Returns the resource bundle for this command. * @return the resource bundle from the {@linkplain UsageMessageSpec#messages()} * @since 3.6 */ public ResourceBundle resourceBundle() { return Messages.resourceBundle(usageMessage.messages()); } /** Initializes the resource bundle for this command: sets the {@link UsageMessageSpec#messages(Messages) UsageMessageSpec.messages} to
/** Returns the ResourceBundle of the specified Messages object or {@code null} if the specified Messages object is {@code null}. */ public static ResourceBundle resourceBundle(Messages messages) { return messages == null ? null : messages.resourceBundle(); } /** Returns the base name of the ResourceBundle of this object or {@code null}.
/** Returns the resource bundle for this command. * @return the resource bundle from the {@linkplain UsageMessageSpec#messages()} * @since 3.6 */ public ResourceBundle resourceBundle() { return Messages.resourceBundle(usageMessage.messages()); } /** Initializes the resource bundle for this command: sets the {@link UsageMessageSpec#messages(Messages) UsageMessageSpec.messages} to
@Test public void testMessagesCopyNonNull() { Messages orig = new Messages(CommandSpec.create(), (ResourceBundle) null); Messages copy = Messages.copy(CommandSpec.create(), orig); assertNull(copy.resourceBundle()); }