DescribeDelegator extends BaseDelegator implements IDescribeDelegator { @Override public List<IFileSpec> getShelvedFiles(final int changelistId) throws P4JavaException { List<Map<String, Object>> resultMaps = execMapCmdList(DESCRIBE, new String[]{"-s", "-S", String.valueOf(changelistId)}, null); return ResultMapParser.parseCommandResultMapAsFileSpecs(changelistId, server, resultMaps); } DescribeDelegator(IOptionsServer server); @Override InputStream getChangelistDiffs(final int changelistId,
	                                      final GetChangelistDiffsOptions opts); @Override InputStream getChangelistDiffsStream(final int id, final DescribeOptions options); @Override List<IFileSpec> getShelvedFiles(final int changelistId); @Override List<IFileSpec> getShelvedFiles(final int changelistId, final int max); InputStream getChangelistDiffs(final int id, final DiffType diffType); @Override List<IFileSpec> getChangelistFiles(final int id); @Override List<IFileSpec> getChangelistFiles(final int id, final int max); List<IFileSpec> getCommitFiles(final String repo, final String commit);  }
@Test public void testShelvedFilesList() throws P4JavaException { when(server.execMapCmdList(eq(DESCRIBE.toString()), argThat(new CommandLineArgumentMatcher( new String[] { "-s", "-S", String.valueOf(mockChangelistId) })), eq((Map<String,Object>)null))).thenReturn(resultMaps); when(resultMap.get("id")).thenReturn(String.valueOf(mockChangelistId)); when(resultMap.get("rev0")).thenReturn("present"); List<IFileSpec> shelvedFiles = describeDelegator.getShelvedFiles(mockChangelistId); assertEquals(mockChangelistId, shelvedFiles.get(0).getChangelistId()); }
@Test public void testShelvedFilesList() throws P4JavaException { when(server.execMapCmdList(eq(DESCRIBE.toString()), argThat(new CommandLineArgumentMatcher( new String[] { "-s", "-S", String.valueOf(mockChangelistId) })), eq(null))).thenReturn(resultMaps); when(resultMap.get("id")).thenReturn(String.valueOf(mockChangelistId)); when(resultMap.get("rev0")).thenReturn("present"); List<IFileSpec> shelvedFiles = describeDelegator.getShelvedFiles(mockChangelistId); assertEquals(mockChangelistId, shelvedFiles.get(0).getChangelistId()); }