ShelveFilesOptions extends Options { public List<String> processOptions(IServer server) throws OptionsException { optionList = processFields(OPTIONS_SPECS, isForceShelve(), isReplaceFiles(), isDeleteFiles(), isPromotesShelvedChangeIfDistributedConfigured()); return optionList; } ShelveFilesOptions();  ShelveFilesOptions(String... options);  ShelveFilesOptions(final boolean forceShelve,
                            final boolean replaceFiles,
                            final boolean deleteFiles,
                            final boolean promotesShelvedChangeIfDistributedConfigured); List<String> processOptions(IServer server); boolean isForceShelve(); ShelveFilesOptions setForceShelve(boolean forceShelve); boolean isReplaceFiles(); ShelveFilesOptions setReplaceFiles(boolean replaceFiles); boolean isPromotesShelvedChangeIfDistributedConfigured(); ShelveFilesOptions setPromotesShelvedChangeIfDistributedConfigured(boolean promotesShelvedChangeIfDistributedConfigured); boolean isDeleteFiles(); ShelveFilesOptions setDeleteFiles(boolean deleteFiles); static final String OPTIONS_SPECS; }
@Test public void processNoOptions() throws Exception { ShelveFilesOptions opts = new ShelveFilesOptions(); List<String> optsList = opts.processOptions(null); assertTrue(optsList != null); assertTrue(optsList.size() == 0); }
@Test public void processSomeOptions() throws Exception { final int four = 4; final int three = 3; ShelveFilesOptions opts = new ShelveFilesOptions(true, true, true, true); List<String> optsList = opts.processOptions(null); assertTrue(optsList != null); assertTrue(optsList.size() == four); assertTrue(optsList.containsAll( Arrays.asList(new String[] { "-f", "-r", "-d", "-p" }))); opts = new ShelveFilesOptions(false, true, true, true); optsList = opts.processOptions(null); assertTrue(optsList != null); assertTrue(optsList.size() == three); assertTrue(optsList.containsAll( Arrays.asList(new String[] { "-r", "-d", "-p" }))); opts = new ShelveFilesOptions(false, false, true, true); optsList = opts.processOptions(null); assertTrue(optsList != null); assertTrue(optsList.size() == 2); assertTrue(optsList.containsAll(Arrays.asList(new String[] { "-d", "-p" }))); opts = new ShelveFilesOptions(false, false, false, true); optsList = opts.processOptions(null); assertTrue(optsList != null); assertTrue(optsList.size() == 1); assertTrue(optsList.containsAll(Arrays.asList(new String[] { "-p" }))); opts = new ShelveFilesOptions(true, false, false, true); optsList = opts.processOptions(null); assertTrue(optsList != null); assertTrue(optsList.size() == 2); assertTrue(optsList.containsAll(Arrays.asList(new String[] { "-f", "-p" }))); }