IntegratedDelegator extends BaseDelegator implements IIntegratedDelegator { @Override public List<IFileSpec> getSubmittedIntegrations(final List<IFileSpec> fileSpecs, final String branchSpec, final boolean reverseMappings) throws ConnectionException, RequestException, AccessException { try { GetSubmittedIntegrationsOptions submittedIntegrationsOptions = new GetSubmittedIntegrationsOptions( branchSpec, reverseMappings); return getSubmittedIntegrations(fileSpecs, submittedIntegrationsOptions); } catch (final ConnectionException | AccessException | RequestException exc) { throw exc; } catch (P4JavaException exc) { throw new RequestException(exc.getMessage(), exc); } } IntegratedDelegator(final IOptionsServer server); @Override List<IFileSpec> getSubmittedIntegrations(final List<IFileSpec> fileSpecs,
            final String branchSpec, final boolean reverseMappings); @Override List<IFileSpec> getSubmittedIntegrations(final List<IFileSpec> fileSpecs,
            final GetSubmittedIntegrationsOptions opts);  }
@Test(expected = AccessException.class) public void testIntegratedOptAccessException() throws P4JavaException { when(server.execMapCmdList(eq(INTEGRATED.toString()), argThat(SIMPLE_MATCHER), eq(null))) .thenThrow(AccessException.AccessExceptionForTests.class); List<IFileSpec> specs = FileSpecBuilder.makeFileSpecList(FILE_SPEC); integratedDelegator.getSubmittedIntegrations(specs, new GetSubmittedIntegrationsOptions()); }
@Test(expected = AccessException.class) public void testIntegratedAccessException() throws P4JavaException { when(server.execMapCmdList(eq(INTEGRATED.toString()), argThat(SIMPLE_MATCHER), eq(null))) .thenThrow(AccessException.AccessExceptionForTests.class); List<IFileSpec> specs = FileSpecBuilder.makeFileSpecList(FILE_SPEC); integratedDelegator.getSubmittedIntegrations(specs, null, false); }
@Test(expected = ConnectionException.class) public void testIntegratedOptConnectionException() throws P4JavaException { when(server.execMapCmdList(eq(INTEGRATED.toString()), argThat(SIMPLE_MATCHER), eq((Map<String, Object>)null))) .thenThrow(ConnectionException.class); List<IFileSpec> specs = FileSpecBuilder.makeFileSpecList(FILE_SPEC); integratedDelegator.getSubmittedIntegrations(specs, new GetSubmittedIntegrationsOptions()); }
@Test(expected = ConnectionException.class) public void testIntegratedConnectionException() throws P4JavaException { when(server.execMapCmdList(eq(INTEGRATED.toString()), argThat(SIMPLE_MATCHER), eq((Map<String, Object>)null))) .thenThrow(ConnectionException.class); List<IFileSpec> specs = FileSpecBuilder.makeFileSpecList(FILE_SPEC); integratedDelegator.getSubmittedIntegrations(specs, null, false); }
@Test(expected = AccessException.class) public void testIntegratedOptAccessException() throws P4JavaException { when(server.execMapCmdList(eq(INTEGRATED.toString()), argThat(SIMPLE_MATCHER), eq((Map<String, Object>)null))) .thenThrow(AccessException.class); List<IFileSpec> specs = FileSpecBuilder.makeFileSpecList(FILE_SPEC); integratedDelegator.getSubmittedIntegrations(specs, new GetSubmittedIntegrationsOptions()); }
@Test(expected = AccessException.class) public void testIntegratedAccessException() throws P4JavaException { when(server.execMapCmdList(eq(INTEGRATED.toString()), argThat(SIMPLE_MATCHER), eq((Map<String, Object>)null))) .thenThrow(AccessException.class); List<IFileSpec> specs = FileSpecBuilder.makeFileSpecList(FILE_SPEC); integratedDelegator.getSubmittedIntegrations(specs, null, false); }
@Test(expected = RequestException.class) public void testIntegratedOptRequestException() throws P4JavaException { when(server.execMapCmdList(eq(INTEGRATED.toString()), argThat(SIMPLE_MATCHER), eq((Map<String, Object>)null))) .thenThrow(RequestException.class); List<IFileSpec> specs = FileSpecBuilder.makeFileSpecList(FILE_SPEC); integratedDelegator.getSubmittedIntegrations(specs, new GetSubmittedIntegrationsOptions()); }
@Test(expected = RequestException.class) public void testIntegratedRequestException() throws P4JavaException { when(server.execMapCmdList(eq(INTEGRATED.toString()), argThat(SIMPLE_MATCHER), eq((Map<String, Object>)null))) .thenThrow(RequestException.class); List<IFileSpec> specs = FileSpecBuilder.makeFileSpecList(FILE_SPEC); integratedDelegator.getSubmittedIntegrations(specs, null, false); }
@Test(expected = P4JavaException.class) public void testIntegratedOptP4JavaException() throws P4JavaException { when(server.execMapCmdList(eq(INTEGRATED.toString()), argThat(SIMPLE_MATCHER), eq((Map<String, Object>)null))) .thenThrow(P4JavaException.class); List<IFileSpec> specs = FileSpecBuilder.makeFileSpecList(FILE_SPEC); integratedDelegator.getSubmittedIntegrations(specs, new GetSubmittedIntegrationsOptions()); }
@Test(expected = P4JavaException.class) public void testIntegratedP4JavaException() throws P4JavaException { when(server.execMapCmdList(eq(INTEGRATED.toString()), argThat(SIMPLE_MATCHER), eq((Map<String, Object>)null))) .thenThrow(P4JavaException.class); List<IFileSpec> specs = FileSpecBuilder.makeFileSpecList(FILE_SPEC); integratedDelegator.getSubmittedIntegrations(specs, null, false); }
@Test public void testIntegratedOpt() throws P4JavaException { when(server.execMapCmdList(eq(INTEGRATED.toString()), argThat(SIMPLE_MATCHER), eq((Map<String, Object>)null))) .thenReturn(buildValidResultMap()); List<IFileSpec> specs = FileSpecBuilder.makeFileSpecList(FILE_SPEC); List<IFileSpec> result = integratedDelegator.getSubmittedIntegrations(specs, new GetSubmittedIntegrationsOptions()); verify(server).execMapCmdList(eq(INTEGRATED.toString()), argThat(SIMPLE_MATCHER), eq((Map<String, Object>)null)); assertFileSpecs(result); }
@Test public void testIntegrated() throws P4JavaException { when(server.execMapCmdList(eq(INTEGRATED.toString()), argThat(SIMPLE_MATCHER), eq((Map<String, Object>)null))) .thenReturn(buildValidResultMap()); List<IFileSpec> specs = FileSpecBuilder.makeFileSpecList(FILE_SPEC); List<IFileSpec> result = integratedDelegator.getSubmittedIntegrations(specs, null, false); verify(server).execMapCmdList(eq(INTEGRATED.toString()), argThat(SIMPLE_MATCHER), eq((Map<String, Object>)null)); assertFileSpecs(result); }
@Test(expected = ConnectionException.class) public void testIntegratedOptConnectionException() throws P4JavaException { when(server.execMapCmdList(eq(INTEGRATED.toString()), argThat(SIMPLE_MATCHER), eq(null))) .thenThrow(ConnectionException.class); List<IFileSpec> specs = FileSpecBuilder.makeFileSpecList(FILE_SPEC); integratedDelegator.getSubmittedIntegrations(specs, new GetSubmittedIntegrationsOptions()); }
@Test(expected = ConnectionException.class) public void testIntegratedConnectionException() throws P4JavaException { when(server.execMapCmdList(eq(INTEGRATED.toString()), argThat(SIMPLE_MATCHER), eq(null))) .thenThrow(ConnectionException.class); List<IFileSpec> specs = FileSpecBuilder.makeFileSpecList(FILE_SPEC); integratedDelegator.getSubmittedIntegrations(specs, null, false); }
@Test(expected = AccessException.class) public void testIntegratedOptAccessException() throws P4JavaException { when(server.execMapCmdList(eq(INTEGRATED.toString()), argThat(SIMPLE_MATCHER), eq(null))) .thenThrow(AccessException.class); List<IFileSpec> specs = FileSpecBuilder.makeFileSpecList(FILE_SPEC); integratedDelegator.getSubmittedIntegrations(specs, new GetSubmittedIntegrationsOptions()); }
@Test(expected = AccessException.class) public void testIntegratedAccessException() throws P4JavaException { when(server.execMapCmdList(eq(INTEGRATED.toString()), argThat(SIMPLE_MATCHER), eq(null))) .thenThrow(AccessException.class); List<IFileSpec> specs = FileSpecBuilder.makeFileSpecList(FILE_SPEC); integratedDelegator.getSubmittedIntegrations(specs, null, false); }
@Test(expected = RequestException.class) public void testIntegratedOptRequestException() throws P4JavaException { when(server.execMapCmdList(eq(INTEGRATED.toString()), argThat(SIMPLE_MATCHER), eq(null))) .thenThrow(RequestException.class); List<IFileSpec> specs = FileSpecBuilder.makeFileSpecList(FILE_SPEC); integratedDelegator.getSubmittedIntegrations(specs, new GetSubmittedIntegrationsOptions()); }
@Test(expected = RequestException.class) public void testIntegratedRequestException() throws P4JavaException { when(server.execMapCmdList(eq(INTEGRATED.toString()), argThat(SIMPLE_MATCHER), eq(null))) .thenThrow(RequestException.class); List<IFileSpec> specs = FileSpecBuilder.makeFileSpecList(FILE_SPEC); integratedDelegator.getSubmittedIntegrations(specs, null, false); }
@Test(expected = P4JavaException.class) public void testIntegratedOptP4JavaException() throws P4JavaException { when(server.execMapCmdList(eq(INTEGRATED.toString()), argThat(SIMPLE_MATCHER), eq(null))) .thenThrow(P4JavaException.class); List<IFileSpec> specs = FileSpecBuilder.makeFileSpecList(FILE_SPEC); integratedDelegator.getSubmittedIntegrations(specs, new GetSubmittedIntegrationsOptions()); }
@Test(expected = P4JavaException.class) public void testIntegratedP4JavaException() throws P4JavaException { when(server.execMapCmdList(eq(INTEGRATED.toString()), argThat(SIMPLE_MATCHER), eq(null))) .thenThrow(P4JavaException.class); List<IFileSpec> specs = FileSpecBuilder.makeFileSpecList(FILE_SPEC); integratedDelegator.getSubmittedIntegrations(specs, null, false); }
@Test public void testIntegratedOpt() throws P4JavaException { when(server.execMapCmdList(eq(INTEGRATED.toString()), argThat(SIMPLE_MATCHER), eq(null))) .thenReturn(buildValidResultMap()); List<IFileSpec> specs = FileSpecBuilder.makeFileSpecList(FILE_SPEC); List<IFileSpec> result = integratedDelegator.getSubmittedIntegrations(specs, new GetSubmittedIntegrationsOptions()); verify(server).execMapCmdList(eq(INTEGRATED.toString()), argThat(SIMPLE_MATCHER), eq(null)); assertFileSpecs(result); }
@Test public void testIntegrated() throws P4JavaException { when(server.execMapCmdList(eq(INTEGRATED.toString()), argThat(SIMPLE_MATCHER), eq(null))) .thenReturn(buildValidResultMap()); List<IFileSpec> specs = FileSpecBuilder.makeFileSpecList(FILE_SPEC); List<IFileSpec> result = integratedDelegator.getSubmittedIntegrations(specs, null, false); verify(server).execMapCmdList(eq(INTEGRATED.toString()), argThat(SIMPLE_MATCHER), eq(null)); assertFileSpecs(result); }