@Test public void testFedAlreadyExistsPrintsSpecificError() throws Exception { execute(MEMORY_MEMBER_ID1, FED_ID, MEMORY_MEMBER_ID2); verifyFailure(MEMORY_MEMBER_ID1 + " already exists."); }
@Override public void execute(String... parameters) throws IOException { if (parameters.length < 4) { consoleIO.writeln(getHelpLong()); } else { LinkedList<String> plist = new LinkedList<>(Arrays.asList(parameters)); plist.remove(); boolean distinct = getOptionalParamValue(plist, "distinct", false); boolean readonly = getOptionalParamValue(plist, "readonly", true); if (distinctValues(plist)) { String fedID = plist.pop(); federate(distinct, readonly, fedID, plist); } else { consoleIO.writeError("Duplicate repository id's specified."); } } }
Federate extends ConsoleCommand { @Override public void execute(String... parameters) throws IOException { if (parameters.length < 4) { consoleIO.writeln(getHelpLong()); } else { LinkedList<String> plist = new LinkedList<>(Arrays.asList(parameters)); plist.remove(); boolean distinct = getOptionalParamValue(plist, "distinct", false); boolean readonly = getOptionalParamValue(plist, "readonly", true); if (distinctValues(plist)) { String fedID = plist.pop(); federate(distinct, readonly, fedID, plist); } else { consoleIO.writeError("Duplicate repository id's specified."); } } } }
Federate extends ConsoleCommand { @Override public void execute(String... parameters) throws IOException { if (parameters.length < 4) { consoleIO.writeln(getHelpLong()); } else { LinkedList<String> plist = new LinkedList<>(Arrays.asList(parameters)); plist.remove(); boolean distinct = getOptionalParamValue(plist, "distinct", false); boolean readonly = getOptionalParamValue(plist, "readonly", true); if (distinctValues(plist)) { String fedID = plist.pop(); federate(distinct, readonly, fedID, plist); } else { consoleIO.writeError("Duplicate repository id's specified."); } } } Federate(ConsoleIO consoleIO, ConsoleState state); }
Federate extends ConsoleCommand { @Override public void execute(String... parameters) throws IOException { if (parameters.length < 4) { consoleIO.writeln(getHelpLong()); } else { LinkedList<String> plist = new LinkedList<>(Arrays.asList(parameters)); plist.remove(); boolean distinct = getOptionalParamValue(plist, "distinct", false); boolean readonly = getOptionalParamValue(plist, "readonly", true); if (distinctValues(plist)) { String fedID = plist.pop(); federate(distinct, readonly, fedID, plist); } else { consoleIO.writeError("Duplicate repository id's specified."); } } } Federate(ConsoleIO consoleIO, ConsoleState state); @Override String getName(); @Override String getHelpShort(); @Override String getHelpLong(); @Override void execute(String... parameters); }
Federate extends ConsoleCommand { @Override public void execute(String... parameters) throws IOException { if (parameters.length < 4) { consoleIO.writeln(getHelpLong()); } else { LinkedList<String> plist = new LinkedList<>(Arrays.asList(parameters)); plist.remove(); boolean distinct = getOptionalParamValue(plist, "distinct", false); boolean readonly = getOptionalParamValue(plist, "readonly", true); if (distinctValues(plist)) { String fedID = plist.pop(); federate(distinct, readonly, fedID, plist); } else { consoleIO.writeError("Duplicate repository id's specified."); } } } Federate(ConsoleIO consoleIO, ConsoleState state); @Override String getName(); @Override String getHelpShort(); @Override String getHelpLong(); @Override void execute(String... parameters);  }