target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test public void uri_resource_path_ends_with_question_mark_returns_path_removed_with_question_mark(){ final String expectedResourcePath = "/foo/bar"; final String pathWithEmptyStaticQueryParams = expectedResourcePath + "?"; Assert.assertEquals(expectedResourcePath, UriResourcePathUtils .addStaticQueryParamtersToReques... | public static String addStaticQueryParamtersToRequest(final Request<?> request, final String uriResourcePath) { if (request == null || uriResourcePath == null) { return null; } String resourcePath = uriResourcePath; int index = resourcePath.indexOf("?"); if (index != -1) { String queryString = resourcePath.substring(in... | UriResourcePathUtils { public static String addStaticQueryParamtersToRequest(final Request<?> request, final String uriResourcePath) { if (request == null || uriResourcePath == null) { return null; } String resourcePath = uriResourcePath; int index = resourcePath.indexOf("?"); if (index != -1) { String queryString = re... | UriResourcePathUtils { public static String addStaticQueryParamtersToRequest(final Request<?> request, final String uriResourcePath) { if (request == null || uriResourcePath == null) { return null; } String resourcePath = uriResourcePath; int index = resourcePath.indexOf("?"); if (index != -1) { String queryString = re... | UriResourcePathUtils { public static String addStaticQueryParamtersToRequest(final Request<?> request, final String uriResourcePath) { if (request == null || uriResourcePath == null) { return null; } String resourcePath = uriResourcePath; int index = resourcePath.indexOf("?"); if (index != -1) { String queryString = re... | UriResourcePathUtils { public static String addStaticQueryParamtersToRequest(final Request<?> request, final String uriResourcePath) { if (request == null || uriResourcePath == null) { return null; } String resourcePath = uriResourcePath; int index = resourcePath.indexOf("?"); if (index != -1) { String queryString = re... |
@Test public void queryparam_value_empty_adds_parameter_with_empty_string_to_request() { final String uriResourcePath = "/foo/bar"; final String uriResourcePathWithParams = uriResourcePath + "?param1="; final Request<Object> request = new DefaultRequest<Object> (null, null); Assert.assertEquals(uriResourcePath, UriReso... | public static String addStaticQueryParamtersToRequest(final Request<?> request, final String uriResourcePath) { if (request == null || uriResourcePath == null) { return null; } String resourcePath = uriResourcePath; int index = resourcePath.indexOf("?"); if (index != -1) { String queryString = resourcePath.substring(in... | UriResourcePathUtils { public static String addStaticQueryParamtersToRequest(final Request<?> request, final String uriResourcePath) { if (request == null || uriResourcePath == null) { return null; } String resourcePath = uriResourcePath; int index = resourcePath.indexOf("?"); if (index != -1) { String queryString = re... | UriResourcePathUtils { public static String addStaticQueryParamtersToRequest(final Request<?> request, final String uriResourcePath) { if (request == null || uriResourcePath == null) { return null; } String resourcePath = uriResourcePath; int index = resourcePath.indexOf("?"); if (index != -1) { String queryString = re... | UriResourcePathUtils { public static String addStaticQueryParamtersToRequest(final Request<?> request, final String uriResourcePath) { if (request == null || uriResourcePath == null) { return null; } String resourcePath = uriResourcePath; int index = resourcePath.indexOf("?"); if (index != -1) { String queryString = re... | UriResourcePathUtils { public static String addStaticQueryParamtersToRequest(final Request<?> request, final String uriResourcePath) { if (request == null || uriResourcePath == null) { return null; } String resourcePath = uriResourcePath; int index = resourcePath.indexOf("?"); if (index != -1) { String queryString = re... |
@Test public void static_queryparams_in_path_added_to_request(){ final String uriResourcePath = "/foo/bar"; final String uriResourcePathWithParams = uriResourcePath + "?param1=value1¶m2=value2"; final Request<Object> request = new DefaultRequest<Object> (null, null); Assert.assertEquals(uriResourcePath, UriResource... | public static String addStaticQueryParamtersToRequest(final Request<?> request, final String uriResourcePath) { if (request == null || uriResourcePath == null) { return null; } String resourcePath = uriResourcePath; int index = resourcePath.indexOf("?"); if (index != -1) { String queryString = resourcePath.substring(in... | UriResourcePathUtils { public static String addStaticQueryParamtersToRequest(final Request<?> request, final String uriResourcePath) { if (request == null || uriResourcePath == null) { return null; } String resourcePath = uriResourcePath; int index = resourcePath.indexOf("?"); if (index != -1) { String queryString = re... | UriResourcePathUtils { public static String addStaticQueryParamtersToRequest(final Request<?> request, final String uriResourcePath) { if (request == null || uriResourcePath == null) { return null; } String resourcePath = uriResourcePath; int index = resourcePath.indexOf("?"); if (index != -1) { String queryString = re... | UriResourcePathUtils { public static String addStaticQueryParamtersToRequest(final Request<?> request, final String uriResourcePath) { if (request == null || uriResourcePath == null) { return null; } String resourcePath = uriResourcePath; int index = resourcePath.indexOf("?"); if (index != -1) { String queryString = re... | UriResourcePathUtils { public static String addStaticQueryParamtersToRequest(final Request<?> request, final String uriResourcePath) { if (request == null || uriResourcePath == null) { return null; } String resourcePath = uriResourcePath; int index = resourcePath.indexOf("?"); if (index != -1) { String queryString = re... |
@Test public void queryparam_without_value_returns_list_containing_null_value() { final String uriResourcePath = "/foo/bar"; final String uriResourcePathWithParams = uriResourcePath + "?param"; final Request<Object> request = new DefaultRequest<Object>(null, null); Assert.assertEquals(uriResourcePath, UriResourcePathUt... | public static String addStaticQueryParamtersToRequest(final Request<?> request, final String uriResourcePath) { if (request == null || uriResourcePath == null) { return null; } String resourcePath = uriResourcePath; int index = resourcePath.indexOf("?"); if (index != -1) { String queryString = resourcePath.substring(in... | UriResourcePathUtils { public static String addStaticQueryParamtersToRequest(final Request<?> request, final String uriResourcePath) { if (request == null || uriResourcePath == null) { return null; } String resourcePath = uriResourcePath; int index = resourcePath.indexOf("?"); if (index != -1) { String queryString = re... | UriResourcePathUtils { public static String addStaticQueryParamtersToRequest(final Request<?> request, final String uriResourcePath) { if (request == null || uriResourcePath == null) { return null; } String resourcePath = uriResourcePath; int index = resourcePath.indexOf("?"); if (index != -1) { String queryString = re... | UriResourcePathUtils { public static String addStaticQueryParamtersToRequest(final Request<?> request, final String uriResourcePath) { if (request == null || uriResourcePath == null) { return null; } String resourcePath = uriResourcePath; int index = resourcePath.indexOf("?"); if (index != -1) { String queryString = re... | UriResourcePathUtils { public static String addStaticQueryParamtersToRequest(final Request<?> request, final String uriResourcePath) { if (request == null || uriResourcePath == null) { return null; } String resourcePath = uriResourcePath; int index = resourcePath.indexOf("?"); if (index != -1) { String queryString = re... |
@Test public void testInfoLogCallsMadeForStartTransfer() throws Exception { PowerMockito .when( TransferListener.getInstance(null, null) ).thenReturn(mockTransferListener); PowerMockito .when( faspmanager2.startTransfer(anyString(), isNull(String.class), anyString(), any(TransferListener.class)) ).thenReturn(3L); when(... | public long startTransfer(final String xferId, final String transferSpecStr) { log.info("Starting transfer with xferId [" + xferId + "]"); if (log.isDebugEnabled()) { log.debug("Transfer Spec for Session with xferId [" + xferId + "]"); log.debug(AsperaTransferManagerUtils.getRedactedJsonString( transferSpecStr, "token"... | AsperaFaspManagerWrapper { public long startTransfer(final String xferId, final String transferSpecStr) { log.info("Starting transfer with xferId [" + xferId + "]"); if (log.isDebugEnabled()) { log.debug("Transfer Spec for Session with xferId [" + xferId + "]"); log.debug(AsperaTransferManagerUtils.getRedactedJsonStrin... | AsperaFaspManagerWrapper { public long startTransfer(final String xferId, final String transferSpecStr) { log.info("Starting transfer with xferId [" + xferId + "]"); if (log.isDebugEnabled()) { log.debug("Transfer Spec for Session with xferId [" + xferId + "]"); log.debug(AsperaTransferManagerUtils.getRedactedJsonStrin... | AsperaFaspManagerWrapper { public long startTransfer(final String xferId, final String transferSpecStr) { log.info("Starting transfer with xferId [" + xferId + "]"); if (log.isDebugEnabled()) { log.debug("Transfer Spec for Session with xferId [" + xferId + "]"); log.debug(AsperaTransferManagerUtils.getRedactedJsonStrin... | AsperaFaspManagerWrapper { public long startTransfer(final String xferId, final String transferSpecStr) { log.info("Starting transfer with xferId [" + xferId + "]"); if (log.isDebugEnabled()) { log.debug("Transfer Spec for Session with xferId [" + xferId + "]"); log.debug(AsperaTransferManagerUtils.getRedactedJsonStrin... |
@Test public void testDebugLogCallsMadeForStartTransfer() throws Exception { PowerMockito .when( TransferListener.getInstance(null, null) ).thenReturn(mockTransferListener); PowerMockito .when( faspmanager2.startTransfer(anyString(), isNull(String.class), anyString(), any(TransferListener.class)) ).thenReturn(3L); when... | public long startTransfer(final String xferId, final String transferSpecStr) { log.info("Starting transfer with xferId [" + xferId + "]"); if (log.isDebugEnabled()) { log.debug("Transfer Spec for Session with xferId [" + xferId + "]"); log.debug(AsperaTransferManagerUtils.getRedactedJsonString( transferSpecStr, "token"... | AsperaFaspManagerWrapper { public long startTransfer(final String xferId, final String transferSpecStr) { log.info("Starting transfer with xferId [" + xferId + "]"); if (log.isDebugEnabled()) { log.debug("Transfer Spec for Session with xferId [" + xferId + "]"); log.debug(AsperaTransferManagerUtils.getRedactedJsonStrin... | AsperaFaspManagerWrapper { public long startTransfer(final String xferId, final String transferSpecStr) { log.info("Starting transfer with xferId [" + xferId + "]"); if (log.isDebugEnabled()) { log.debug("Transfer Spec for Session with xferId [" + xferId + "]"); log.debug(AsperaTransferManagerUtils.getRedactedJsonStrin... | AsperaFaspManagerWrapper { public long startTransfer(final String xferId, final String transferSpecStr) { log.info("Starting transfer with xferId [" + xferId + "]"); if (log.isDebugEnabled()) { log.debug("Transfer Spec for Session with xferId [" + xferId + "]"); log.debug(AsperaTransferManagerUtils.getRedactedJsonStrin... | AsperaFaspManagerWrapper { public long startTransfer(final String xferId, final String transferSpecStr) { log.info("Starting transfer with xferId [" + xferId + "]"); if (log.isDebugEnabled()) { log.debug("Transfer Spec for Session with xferId [" + xferId + "]"); log.debug(AsperaTransferManagerUtils.getRedactedJsonStrin... |
@Test public void testTraceLogCallsMadeForStartTransfer() throws Exception { PowerMockito .when( TransferListener.getInstance(null, null) ).thenReturn(mockTransferListener); PowerMockito .when( faspmanager2.startTransfer(anyString(), isNull(String.class), anyString(), any(TransferListener.class)) ).thenReturn(3L); when... | public long startTransfer(final String xferId, final String transferSpecStr) { log.info("Starting transfer with xferId [" + xferId + "]"); if (log.isDebugEnabled()) { log.debug("Transfer Spec for Session with xferId [" + xferId + "]"); log.debug(AsperaTransferManagerUtils.getRedactedJsonString( transferSpecStr, "token"... | AsperaFaspManagerWrapper { public long startTransfer(final String xferId, final String transferSpecStr) { log.info("Starting transfer with xferId [" + xferId + "]"); if (log.isDebugEnabled()) { log.debug("Transfer Spec for Session with xferId [" + xferId + "]"); log.debug(AsperaTransferManagerUtils.getRedactedJsonStrin... | AsperaFaspManagerWrapper { public long startTransfer(final String xferId, final String transferSpecStr) { log.info("Starting transfer with xferId [" + xferId + "]"); if (log.isDebugEnabled()) { log.debug("Transfer Spec for Session with xferId [" + xferId + "]"); log.debug(AsperaTransferManagerUtils.getRedactedJsonStrin... | AsperaFaspManagerWrapper { public long startTransfer(final String xferId, final String transferSpecStr) { log.info("Starting transfer with xferId [" + xferId + "]"); if (log.isDebugEnabled()) { log.debug("Transfer Spec for Session with xferId [" + xferId + "]"); log.debug(AsperaTransferManagerUtils.getRedactedJsonStrin... | AsperaFaspManagerWrapper { public long startTransfer(final String xferId, final String transferSpecStr) { log.info("Starting transfer with xferId [" + xferId + "]"); if (log.isDebugEnabled()) { log.debug("Transfer Spec for Session with xferId [" + xferId + "]"); log.debug(AsperaTransferManagerUtils.getRedactedJsonStrin... |
@Test public void testInfoLogCallsMadeForPause() throws Exception { PowerMockito .when( TransferListener.getInstance(null, null) ).thenReturn(mockTransferListener); PowerMockito .when( faspmanager2.modifyTransfer(anyString(), anyInt(), anyLong()) ).thenReturn(true); when(mockLog.isDebugEnabled()).thenReturn(false); Asp... | public boolean pause(final String xferId) { log.info("Pausing transfer with xferId [" + xferId + "]"); log.trace("Calling method [modifyTransfer] with parameters [\"" + xferId + "\", 4, 0]"); boolean rtn = faspmanager2.modifyTransfer(xferId, 4, 0); log.trace("Method [modifyTransfer] returned for xferId [\"" + xferId + ... | AsperaFaspManagerWrapper { public boolean pause(final String xferId) { log.info("Pausing transfer with xferId [" + xferId + "]"); log.trace("Calling method [modifyTransfer] with parameters [\"" + xferId + "\", 4, 0]"); boolean rtn = faspmanager2.modifyTransfer(xferId, 4, 0); log.trace("Method [modifyTransfer] returned ... | AsperaFaspManagerWrapper { public boolean pause(final String xferId) { log.info("Pausing transfer with xferId [" + xferId + "]"); log.trace("Calling method [modifyTransfer] with parameters [\"" + xferId + "\", 4, 0]"); boolean rtn = faspmanager2.modifyTransfer(xferId, 4, 0); log.trace("Method [modifyTransfer] returned ... | AsperaFaspManagerWrapper { public boolean pause(final String xferId) { log.info("Pausing transfer with xferId [" + xferId + "]"); log.trace("Calling method [modifyTransfer] with parameters [\"" + xferId + "\", 4, 0]"); boolean rtn = faspmanager2.modifyTransfer(xferId, 4, 0); log.trace("Method [modifyTransfer] returned ... | AsperaFaspManagerWrapper { public boolean pause(final String xferId) { log.info("Pausing transfer with xferId [" + xferId + "]"); log.trace("Calling method [modifyTransfer] with parameters [\"" + xferId + "\", 4, 0]"); boolean rtn = faspmanager2.modifyTransfer(xferId, 4, 0); log.trace("Method [modifyTransfer] returned ... |
@Test public void unmarshall_ValidJsonContent_UnmarshallsCorrectly() throws Exception { CustomException ase = (CustomException) unmarshaller.unmarshall(JSON); assertEquals("Some error message", ase.getErrorMessage()); assertEquals("This is a customField", ase.getCustomField()); assertEquals(Integer.valueOf(42), ase.get... | @Override public AmazonServiceException unmarshall(JsonNode jsonContent) throws Exception { return MAPPER.treeToValue(jsonContent, exceptionClass); } | JsonErrorUnmarshaller extends AbstractErrorUnmarshaller<JsonNode> { @Override public AmazonServiceException unmarshall(JsonNode jsonContent) throws Exception { return MAPPER.treeToValue(jsonContent, exceptionClass); } } | JsonErrorUnmarshaller extends AbstractErrorUnmarshaller<JsonNode> { @Override public AmazonServiceException unmarshall(JsonNode jsonContent) throws Exception { return MAPPER.treeToValue(jsonContent, exceptionClass); } JsonErrorUnmarshaller(Class<? extends AmazonServiceException> exceptionClass, String handledErrorCode)... | JsonErrorUnmarshaller extends AbstractErrorUnmarshaller<JsonNode> { @Override public AmazonServiceException unmarshall(JsonNode jsonContent) throws Exception { return MAPPER.treeToValue(jsonContent, exceptionClass); } JsonErrorUnmarshaller(Class<? extends AmazonServiceException> exceptionClass, String handledErrorCode)... | JsonErrorUnmarshaller extends AbstractErrorUnmarshaller<JsonNode> { @Override public AmazonServiceException unmarshall(JsonNode jsonContent) throws Exception { return MAPPER.treeToValue(jsonContent, exceptionClass); } JsonErrorUnmarshaller(Class<? extends AmazonServiceException> exceptionClass, String handledErrorCode)... |
@Test public void unmarshall_InvalidCaseJsonContent_DoesNotUnmarshallCustomFields() throws Exception { CustomException ase = (CustomException) unmarshaller.unmarshall(INVALID_CASE_JSON); assertEquals("Some error message", ase.getErrorMessage()); assertNull(ase.getCustomField()); assertNull(ase.getCustomInt()); } | @Override public AmazonServiceException unmarshall(JsonNode jsonContent) throws Exception { return MAPPER.treeToValue(jsonContent, exceptionClass); } | JsonErrorUnmarshaller extends AbstractErrorUnmarshaller<JsonNode> { @Override public AmazonServiceException unmarshall(JsonNode jsonContent) throws Exception { return MAPPER.treeToValue(jsonContent, exceptionClass); } } | JsonErrorUnmarshaller extends AbstractErrorUnmarshaller<JsonNode> { @Override public AmazonServiceException unmarshall(JsonNode jsonContent) throws Exception { return MAPPER.treeToValue(jsonContent, exceptionClass); } JsonErrorUnmarshaller(Class<? extends AmazonServiceException> exceptionClass, String handledErrorCode)... | JsonErrorUnmarshaller extends AbstractErrorUnmarshaller<JsonNode> { @Override public AmazonServiceException unmarshall(JsonNode jsonContent) throws Exception { return MAPPER.treeToValue(jsonContent, exceptionClass); } JsonErrorUnmarshaller(Class<? extends AmazonServiceException> exceptionClass, String handledErrorCode)... | JsonErrorUnmarshaller extends AbstractErrorUnmarshaller<JsonNode> { @Override public AmazonServiceException unmarshall(JsonNode jsonContent) throws Exception { return MAPPER.treeToValue(jsonContent, exceptionClass); } JsonErrorUnmarshaller(Class<? extends AmazonServiceException> exceptionClass, String handledErrorCode)... |
@Test public void testTraceLogCallsMadeForPause() throws Exception { PowerMockito .when( TransferListener.getInstance(null, null) ).thenReturn(mockTransferListener); PowerMockito .when( faspmanager2.modifyTransfer(anyString(), anyInt(), anyLong()) ).thenReturn(true); when(mockLog.isDebugEnabled()).thenReturn(true); Asp... | public boolean pause(final String xferId) { log.info("Pausing transfer with xferId [" + xferId + "]"); log.trace("Calling method [modifyTransfer] with parameters [\"" + xferId + "\", 4, 0]"); boolean rtn = faspmanager2.modifyTransfer(xferId, 4, 0); log.trace("Method [modifyTransfer] returned for xferId [\"" + xferId + ... | AsperaFaspManagerWrapper { public boolean pause(final String xferId) { log.info("Pausing transfer with xferId [" + xferId + "]"); log.trace("Calling method [modifyTransfer] with parameters [\"" + xferId + "\", 4, 0]"); boolean rtn = faspmanager2.modifyTransfer(xferId, 4, 0); log.trace("Method [modifyTransfer] returned ... | AsperaFaspManagerWrapper { public boolean pause(final String xferId) { log.info("Pausing transfer with xferId [" + xferId + "]"); log.trace("Calling method [modifyTransfer] with parameters [\"" + xferId + "\", 4, 0]"); boolean rtn = faspmanager2.modifyTransfer(xferId, 4, 0); log.trace("Method [modifyTransfer] returned ... | AsperaFaspManagerWrapper { public boolean pause(final String xferId) { log.info("Pausing transfer with xferId [" + xferId + "]"); log.trace("Calling method [modifyTransfer] with parameters [\"" + xferId + "\", 4, 0]"); boolean rtn = faspmanager2.modifyTransfer(xferId, 4, 0); log.trace("Method [modifyTransfer] returned ... | AsperaFaspManagerWrapper { public boolean pause(final String xferId) { log.info("Pausing transfer with xferId [" + xferId + "]"); log.trace("Calling method [modifyTransfer] with parameters [\"" + xferId + "\", 4, 0]"); boolean rtn = faspmanager2.modifyTransfer(xferId, 4, 0); log.trace("Method [modifyTransfer] returned ... |
@Test public void testInfoLogCallsMadeForResume() throws Exception { PowerMockito .when( TransferListener.getInstance(null, null) ).thenReturn(mockTransferListener); PowerMockito .when( faspmanager2.modifyTransfer(anyString(), anyInt(), anyLong()) ).thenReturn(true); when(mockLog.isDebugEnabled()).thenReturn(false); As... | public boolean resume(final String xferId) { log.info("Resuming transfer with xferId [" + xferId + "]"); log.trace("Calling method [modifyTransfer] with parameters [\"" + xferId + "\", 5, 0]"); boolean rtn = faspmanager2.modifyTransfer(xferId, 5, 0); log.trace("Method [modifyTransfer] returned for xferId [\"" + xferId ... | AsperaFaspManagerWrapper { public boolean resume(final String xferId) { log.info("Resuming transfer with xferId [" + xferId + "]"); log.trace("Calling method [modifyTransfer] with parameters [\"" + xferId + "\", 5, 0]"); boolean rtn = faspmanager2.modifyTransfer(xferId, 5, 0); log.trace("Method [modifyTransfer] returne... | AsperaFaspManagerWrapper { public boolean resume(final String xferId) { log.info("Resuming transfer with xferId [" + xferId + "]"); log.trace("Calling method [modifyTransfer] with parameters [\"" + xferId + "\", 5, 0]"); boolean rtn = faspmanager2.modifyTransfer(xferId, 5, 0); log.trace("Method [modifyTransfer] returne... | AsperaFaspManagerWrapper { public boolean resume(final String xferId) { log.info("Resuming transfer with xferId [" + xferId + "]"); log.trace("Calling method [modifyTransfer] with parameters [\"" + xferId + "\", 5, 0]"); boolean rtn = faspmanager2.modifyTransfer(xferId, 5, 0); log.trace("Method [modifyTransfer] returne... | AsperaFaspManagerWrapper { public boolean resume(final String xferId) { log.info("Resuming transfer with xferId [" + xferId + "]"); log.trace("Calling method [modifyTransfer] with parameters [\"" + xferId + "\", 5, 0]"); boolean rtn = faspmanager2.modifyTransfer(xferId, 5, 0); log.trace("Method [modifyTransfer] returne... |
@Test public void clientConfigurationCopyConstructor_CopiesAllValues() throws Exception { ClientConfiguration customConfig = new ClientConfiguration(); for (Field field : ClientConfiguration.class.getDeclaredFields()) { if (isStaticField(field)) { continue; } field.setAccessible(true); final Class<?> clzz = field.getTy... | public ApacheHttpClientConfig getApacheHttpClientConfig() { return apacheHttpClientConfig; } | ClientConfiguration { public ApacheHttpClientConfig getApacheHttpClientConfig() { return apacheHttpClientConfig; } } | ClientConfiguration { public ApacheHttpClientConfig getApacheHttpClientConfig() { return apacheHttpClientConfig; } ClientConfiguration(); ClientConfiguration(ClientConfiguration other); } | ClientConfiguration { public ApacheHttpClientConfig getApacheHttpClientConfig() { return apacheHttpClientConfig; } ClientConfiguration(); ClientConfiguration(ClientConfiguration other); Protocol getProtocol(); void setProtocol(Protocol protocol); ClientConfiguration withProtocol(Protocol protocol); int getMaxConnectio... | ClientConfiguration { public ApacheHttpClientConfig getApacheHttpClientConfig() { return apacheHttpClientConfig; } ClientConfiguration(); ClientConfiguration(ClientConfiguration other); Protocol getProtocol(); void setProtocol(Protocol protocol); ClientConfiguration withProtocol(Protocol protocol); int getMaxConnectio... |
@Test public void copyConstructorUsesAccessors() { ClientConfiguration config = new ClientConfiguration() { @Override public int getSocketTimeout() { return Integer.MAX_VALUE; } }; assertThat(new ClientConfiguration(config).getSocketTimeout(), equalTo(Integer.MAX_VALUE)); } | public int getSocketTimeout() { return socketTimeout; } | ClientConfiguration { public int getSocketTimeout() { return socketTimeout; } } | ClientConfiguration { public int getSocketTimeout() { return socketTimeout; } ClientConfiguration(); ClientConfiguration(ClientConfiguration other); } | ClientConfiguration { public int getSocketTimeout() { return socketTimeout; } ClientConfiguration(); ClientConfiguration(ClientConfiguration other); Protocol getProtocol(); void setProtocol(Protocol protocol); ClientConfiguration withProtocol(Protocol protocol); int getMaxConnections(); void setMaxConnections(int maxC... | ClientConfiguration { public int getSocketTimeout() { return socketTimeout; } ClientConfiguration(); ClientConfiguration(ClientConfiguration other); Protocol getProtocol(); void setProtocol(Protocol protocol); ClientConfiguration withProtocol(Protocol protocol); int getMaxConnections(); void setMaxConnections(int maxC... |
@Test public void copyBaseTo() { final ProgressListener listener = new SyncProgressListener() { @Override public void progressChanged(ProgressEvent progressEvent) { } }; final AWSCredentials credentials = new BasicAWSCredentials("accesskey", "accessid"); final RequestMetricCollector collector = new RequestMetricCollect... | protected final <T extends AmazonWebServiceRequest> T copyBaseTo(T target) { if (customRequestHeaders != null) { for (Map.Entry<String, String> e : customRequestHeaders.entrySet()) target.putCustomRequestHeader(e.getKey(), e.getValue()); } if (customQueryParameters != null) { for (Map.Entry<String, List<String>> e : cu... | AmazonWebServiceRequest implements Cloneable, ReadLimitInfo, HandlerContextAware { protected final <T extends AmazonWebServiceRequest> T copyBaseTo(T target) { if (customRequestHeaders != null) { for (Map.Entry<String, String> e : customRequestHeaders.entrySet()) target.putCustomRequestHeader(e.getKey(), e.getValue());... | AmazonWebServiceRequest implements Cloneable, ReadLimitInfo, HandlerContextAware { protected final <T extends AmazonWebServiceRequest> T copyBaseTo(T target) { if (customRequestHeaders != null) { for (Map.Entry<String, String> e : customRequestHeaders.entrySet()) target.putCustomRequestHeader(e.getKey(), e.getValue());... | AmazonWebServiceRequest implements Cloneable, ReadLimitInfo, HandlerContextAware { protected final <T extends AmazonWebServiceRequest> T copyBaseTo(T target) { if (customRequestHeaders != null) { for (Map.Entry<String, String> e : customRequestHeaders.entrySet()) target.putCustomRequestHeader(e.getKey(), e.getValue());... | AmazonWebServiceRequest implements Cloneable, ReadLimitInfo, HandlerContextAware { protected final <T extends AmazonWebServiceRequest> T copyBaseTo(T target) { if (customRequestHeaders != null) { for (Map.Entry<String, String> e : customRequestHeaders.entrySet()) target.putCustomRequestHeader(e.getKey(), e.getValue());... |
@Test public void getLegacyRetryPolicy_ReturnsSamePolicy() { assertEquals(legacyPolicy, adapter.getLegacyRetryPolicy()); } | public RetryPolicy getLegacyRetryPolicy() { return this.legacyRetryPolicy; } | RetryPolicyAdapter implements com.ibm.cloud.objectstorage.retry.v2.RetryPolicy { public RetryPolicy getLegacyRetryPolicy() { return this.legacyRetryPolicy; } } | RetryPolicyAdapter implements com.ibm.cloud.objectstorage.retry.v2.RetryPolicy { public RetryPolicy getLegacyRetryPolicy() { return this.legacyRetryPolicy; } RetryPolicyAdapter(RetryPolicy legacyRetryPolicy, ClientConfiguration clientConfiguration); } | RetryPolicyAdapter implements com.ibm.cloud.objectstorage.retry.v2.RetryPolicy { public RetryPolicy getLegacyRetryPolicy() { return this.legacyRetryPolicy; } RetryPolicyAdapter(RetryPolicy legacyRetryPolicy, ClientConfiguration clientConfiguration); @Override long computeDelayBeforeNextRetry(RetryPolicyContext context)... | RetryPolicyAdapter implements com.ibm.cloud.objectstorage.retry.v2.RetryPolicy { public RetryPolicy getLegacyRetryPolicy() { return this.legacyRetryPolicy; } RetryPolicyAdapter(RetryPolicy legacyRetryPolicy, ClientConfiguration clientConfiguration); @Override long computeDelayBeforeNextRetry(RetryPolicyContext context)... |
@Test public void computeDelayBeforeNextRetry_DelegatesToLegacyPolicy() { final RetryPolicyContext context = RetryPolicyContexts.LEGACY; adapter.computeDelayBeforeNextRetry(context); verify(backoffStrategy).delayBeforeNextRetry( eq((AmazonWebServiceRequest) context.originalRequest()), eq((AmazonClientException) context... | @Override public long computeDelayBeforeNextRetry(RetryPolicyContext context) { return legacyRetryPolicy.getBackoffStrategy().delayBeforeNextRetry( (AmazonWebServiceRequest) context.originalRequest(), (AmazonClientException) context.exception(), context.retriesAttempted()); } | RetryPolicyAdapter implements com.ibm.cloud.objectstorage.retry.v2.RetryPolicy { @Override public long computeDelayBeforeNextRetry(RetryPolicyContext context) { return legacyRetryPolicy.getBackoffStrategy().delayBeforeNextRetry( (AmazonWebServiceRequest) context.originalRequest(), (AmazonClientException) context.except... | RetryPolicyAdapter implements com.ibm.cloud.objectstorage.retry.v2.RetryPolicy { @Override public long computeDelayBeforeNextRetry(RetryPolicyContext context) { return legacyRetryPolicy.getBackoffStrategy().delayBeforeNextRetry( (AmazonWebServiceRequest) context.originalRequest(), (AmazonClientException) context.except... | RetryPolicyAdapter implements com.ibm.cloud.objectstorage.retry.v2.RetryPolicy { @Override public long computeDelayBeforeNextRetry(RetryPolicyContext context) { return legacyRetryPolicy.getBackoffStrategy().delayBeforeNextRetry( (AmazonWebServiceRequest) context.originalRequest(), (AmazonClientException) context.except... | RetryPolicyAdapter implements com.ibm.cloud.objectstorage.retry.v2.RetryPolicy { @Override public long computeDelayBeforeNextRetry(RetryPolicyContext context) { return legacyRetryPolicy.getBackoffStrategy().delayBeforeNextRetry( (AmazonWebServiceRequest) context.originalRequest(), (AmazonClientException) context.except... |
@Test public void shouldRetry_MaxErrorRetryReached() { assertFalse(adapter.shouldRetry(RetryPolicyContexts.withRetriesAttempted(3))); } | @Override public boolean shouldRetry(RetryPolicyContext context) { return !maxRetriesExceeded(context) && isRetryable(context); } | RetryPolicyAdapter implements com.ibm.cloud.objectstorage.retry.v2.RetryPolicy { @Override public boolean shouldRetry(RetryPolicyContext context) { return !maxRetriesExceeded(context) && isRetryable(context); } } | RetryPolicyAdapter implements com.ibm.cloud.objectstorage.retry.v2.RetryPolicy { @Override public boolean shouldRetry(RetryPolicyContext context) { return !maxRetriesExceeded(context) && isRetryable(context); } RetryPolicyAdapter(RetryPolicy legacyRetryPolicy, ClientConfiguration clientConfiguration); } | RetryPolicyAdapter implements com.ibm.cloud.objectstorage.retry.v2.RetryPolicy { @Override public boolean shouldRetry(RetryPolicyContext context) { return !maxRetriesExceeded(context) && isRetryable(context); } RetryPolicyAdapter(RetryPolicy legacyRetryPolicy, ClientConfiguration clientConfiguration); @Override long co... | RetryPolicyAdapter implements com.ibm.cloud.objectstorage.retry.v2.RetryPolicy { @Override public boolean shouldRetry(RetryPolicyContext context) { return !maxRetriesExceeded(context) && isRetryable(context); } RetryPolicyAdapter(RetryPolicy legacyRetryPolicy, ClientConfiguration clientConfiguration); @Override long co... |
@Test public void shouldRetry_MaxErrorInClientConfigHonored_DoesNotUseMaxErrorInPolicy() { when(retryCondition.shouldRetry(any(AmazonWebServiceRequest.class), any(AmazonClientException.class), anyInt())) .thenReturn(true); legacyPolicy = new RetryPolicy(retryCondition, backoffStrategy, 3, true); adapter = new RetryPoli... | @Override public boolean shouldRetry(RetryPolicyContext context) { return !maxRetriesExceeded(context) && isRetryable(context); } | RetryPolicyAdapter implements com.ibm.cloud.objectstorage.retry.v2.RetryPolicy { @Override public boolean shouldRetry(RetryPolicyContext context) { return !maxRetriesExceeded(context) && isRetryable(context); } } | RetryPolicyAdapter implements com.ibm.cloud.objectstorage.retry.v2.RetryPolicy { @Override public boolean shouldRetry(RetryPolicyContext context) { return !maxRetriesExceeded(context) && isRetryable(context); } RetryPolicyAdapter(RetryPolicy legacyRetryPolicy, ClientConfiguration clientConfiguration); } | RetryPolicyAdapter implements com.ibm.cloud.objectstorage.retry.v2.RetryPolicy { @Override public boolean shouldRetry(RetryPolicyContext context) { return !maxRetriesExceeded(context) && isRetryable(context); } RetryPolicyAdapter(RetryPolicy legacyRetryPolicy, ClientConfiguration clientConfiguration); @Override long co... | RetryPolicyAdapter implements com.ibm.cloud.objectstorage.retry.v2.RetryPolicy { @Override public boolean shouldRetry(RetryPolicyContext context) { return !maxRetriesExceeded(context) && isRetryable(context); } RetryPolicyAdapter(RetryPolicy legacyRetryPolicy, ClientConfiguration clientConfiguration); @Override long co... |
@Test public void shouldRetry_MaxErrorNotExceeded_DelegatesToLegacyRetryCondition() { final RetryPolicyContext context = RetryPolicyContexts.LEGACY; adapter.shouldRetry(context); verify(retryCondition).shouldRetry( eq((AmazonWebServiceRequest) context.originalRequest()), eq((AmazonClientException) context.exception()),... | @Override public boolean shouldRetry(RetryPolicyContext context) { return !maxRetriesExceeded(context) && isRetryable(context); } | RetryPolicyAdapter implements com.ibm.cloud.objectstorage.retry.v2.RetryPolicy { @Override public boolean shouldRetry(RetryPolicyContext context) { return !maxRetriesExceeded(context) && isRetryable(context); } } | RetryPolicyAdapter implements com.ibm.cloud.objectstorage.retry.v2.RetryPolicy { @Override public boolean shouldRetry(RetryPolicyContext context) { return !maxRetriesExceeded(context) && isRetryable(context); } RetryPolicyAdapter(RetryPolicy legacyRetryPolicy, ClientConfiguration clientConfiguration); } | RetryPolicyAdapter implements com.ibm.cloud.objectstorage.retry.v2.RetryPolicy { @Override public boolean shouldRetry(RetryPolicyContext context) { return !maxRetriesExceeded(context) && isRetryable(context); } RetryPolicyAdapter(RetryPolicy legacyRetryPolicy, ClientConfiguration clientConfiguration); @Override long co... | RetryPolicyAdapter implements com.ibm.cloud.objectstorage.retry.v2.RetryPolicy { @Override public boolean shouldRetry(RetryPolicyContext context) { return !maxRetriesExceeded(context) && isRetryable(context); } RetryPolicyAdapter(RetryPolicy legacyRetryPolicy, ClientConfiguration clientConfiguration); @Override long co... |
@Test public void testTraceLogCallsMadeForResume() throws Exception { PowerMockito .when( TransferListener.getInstance(null, null) ).thenReturn(mockTransferListener); PowerMockito .when( faspmanager2.modifyTransfer(anyString(), anyInt(), anyLong()) ).thenReturn(true); when(mockLog.isDebugEnabled()).thenReturn(true); As... | public boolean resume(final String xferId) { log.info("Resuming transfer with xferId [" + xferId + "]"); log.trace("Calling method [modifyTransfer] with parameters [\"" + xferId + "\", 5, 0]"); boolean rtn = faspmanager2.modifyTransfer(xferId, 5, 0); log.trace("Method [modifyTransfer] returned for xferId [\"" + xferId ... | AsperaFaspManagerWrapper { public boolean resume(final String xferId) { log.info("Resuming transfer with xferId [" + xferId + "]"); log.trace("Calling method [modifyTransfer] with parameters [\"" + xferId + "\", 5, 0]"); boolean rtn = faspmanager2.modifyTransfer(xferId, 5, 0); log.trace("Method [modifyTransfer] returne... | AsperaFaspManagerWrapper { public boolean resume(final String xferId) { log.info("Resuming transfer with xferId [" + xferId + "]"); log.trace("Calling method [modifyTransfer] with parameters [\"" + xferId + "\", 5, 0]"); boolean rtn = faspmanager2.modifyTransfer(xferId, 5, 0); log.trace("Method [modifyTransfer] returne... | AsperaFaspManagerWrapper { public boolean resume(final String xferId) { log.info("Resuming transfer with xferId [" + xferId + "]"); log.trace("Calling method [modifyTransfer] with parameters [\"" + xferId + "\", 5, 0]"); boolean rtn = faspmanager2.modifyTransfer(xferId, 5, 0); log.trace("Method [modifyTransfer] returne... | AsperaFaspManagerWrapper { public boolean resume(final String xferId) { log.info("Resuming transfer with xferId [" + xferId + "]"); log.trace("Calling method [modifyTransfer] with parameters [\"" + xferId + "\", 5, 0]"); boolean rtn = faspmanager2.modifyTransfer(xferId, 5, 0); log.trace("Method [modifyTransfer] returne... |
@Test public void testRegionHeaderIsAddedToExcpetion() throws XMLStreamException { String region = "myDummyRegion"; String strResponse = "<Error><Code>PermanentRedirect</Code><Message>The bucket is in this region: null. Please use this region to retry the request</Message></Error>"; ByteArrayInputStream content = new B... | @Override public AmazonServiceException handle(HttpResponse httpResponse) throws XMLStreamException { final AmazonServiceException exception = createException(httpResponse); exception.setHttpHeaders(httpResponse.getHeaders()); return exception; } | S3ErrorResponseHandler implements
HttpResponseHandler<AmazonServiceException> { @Override public AmazonServiceException handle(HttpResponse httpResponse) throws XMLStreamException { final AmazonServiceException exception = createException(httpResponse); exception.setHttpHeaders(httpResponse.getHeaders()); retur... | S3ErrorResponseHandler implements
HttpResponseHandler<AmazonServiceException> { @Override public AmazonServiceException handle(HttpResponse httpResponse) throws XMLStreamException { final AmazonServiceException exception = createException(httpResponse); exception.setHttpHeaders(httpResponse.getHeaders()); retur... | S3ErrorResponseHandler implements
HttpResponseHandler<AmazonServiceException> { @Override public AmazonServiceException handle(HttpResponse httpResponse) throws XMLStreamException { final AmazonServiceException exception = createException(httpResponse); exception.setHttpHeaders(httpResponse.getHeaders()); retur... | S3ErrorResponseHandler implements
HttpResponseHandler<AmazonServiceException> { @Override public AmazonServiceException handle(HttpResponse httpResponse) throws XMLStreamException { final AmazonServiceException exception = createException(httpResponse); exception.setHttpHeaders(httpResponse.getHeaders()); retur... |
@Test public void testInfoLogCallsMadeForCancel() throws Exception { PowerMockito .when( TransferListener.getInstance(null, null) ).thenReturn(mockTransferListener); PowerMockito .when( faspmanager2.stopTransfer(anyString()) ).thenReturn(true); when(mockLog.isDebugEnabled()).thenReturn(false); AsperaFaspManagerWrapper ... | public boolean cancel(final String xferId) { log.info("Cancel transfer with xferId [" + xferId + "]"); log.trace("Calling method [stopTransfer] with parameters [\"" + xferId + "\", 8, 0]"); boolean rtn = faspmanager2.stopTransfer(xferId); log.trace("Method [stopTransfer] returned for xferId [\"" + xferId + "\"] with re... | AsperaFaspManagerWrapper { public boolean cancel(final String xferId) { log.info("Cancel transfer with xferId [" + xferId + "]"); log.trace("Calling method [stopTransfer] with parameters [\"" + xferId + "\", 8, 0]"); boolean rtn = faspmanager2.stopTransfer(xferId); log.trace("Method [stopTransfer] returned for xferId [... | AsperaFaspManagerWrapper { public boolean cancel(final String xferId) { log.info("Cancel transfer with xferId [" + xferId + "]"); log.trace("Calling method [stopTransfer] with parameters [\"" + xferId + "\", 8, 0]"); boolean rtn = faspmanager2.stopTransfer(xferId); log.trace("Method [stopTransfer] returned for xferId [... | AsperaFaspManagerWrapper { public boolean cancel(final String xferId) { log.info("Cancel transfer with xferId [" + xferId + "]"); log.trace("Calling method [stopTransfer] with parameters [\"" + xferId + "\", 8, 0]"); boolean rtn = faspmanager2.stopTransfer(xferId); log.trace("Method [stopTransfer] returned for xferId [... | AsperaFaspManagerWrapper { public boolean cancel(final String xferId) { log.info("Cancel transfer with xferId [" + xferId + "]"); log.trace("Calling method [stopTransfer] with parameters [\"" + xferId + "\", 8, 0]"); boolean rtn = faspmanager2.stopTransfer(xferId); log.trace("Method [stopTransfer] returned for xferId [... |
@Test public void testTraceLogCallsMadeForCancel() throws Exception { PowerMockito .when( TransferListener.getInstance(null, null) ).thenReturn(mockTransferListener); PowerMockito .when( faspmanager2.stopTransfer(anyString()) ).thenReturn(true); when(mockLog.isDebugEnabled()).thenReturn(true); AsperaFaspManagerWrapper ... | public boolean cancel(final String xferId) { log.info("Cancel transfer with xferId [" + xferId + "]"); log.trace("Calling method [stopTransfer] with parameters [\"" + xferId + "\", 8, 0]"); boolean rtn = faspmanager2.stopTransfer(xferId); log.trace("Method [stopTransfer] returned for xferId [\"" + xferId + "\"] with re... | AsperaFaspManagerWrapper { public boolean cancel(final String xferId) { log.info("Cancel transfer with xferId [" + xferId + "]"); log.trace("Calling method [stopTransfer] with parameters [\"" + xferId + "\", 8, 0]"); boolean rtn = faspmanager2.stopTransfer(xferId); log.trace("Method [stopTransfer] returned for xferId [... | AsperaFaspManagerWrapper { public boolean cancel(final String xferId) { log.info("Cancel transfer with xferId [" + xferId + "]"); log.trace("Calling method [stopTransfer] with parameters [\"" + xferId + "\", 8, 0]"); boolean rtn = faspmanager2.stopTransfer(xferId); log.trace("Method [stopTransfer] returned for xferId [... | AsperaFaspManagerWrapper { public boolean cancel(final String xferId) { log.info("Cancel transfer with xferId [" + xferId + "]"); log.trace("Calling method [stopTransfer] with parameters [\"" + xferId + "\", 8, 0]"); boolean rtn = faspmanager2.stopTransfer(xferId); log.trace("Method [stopTransfer] returned for xferId [... | AsperaFaspManagerWrapper { public boolean cancel(final String xferId) { log.info("Cancel transfer with xferId [" + xferId + "]"); log.trace("Calling method [stopTransfer] with parameters [\"" + xferId + "\", 8, 0]"); boolean rtn = faspmanager2.stopTransfer(xferId); log.trace("Method [stopTransfer] returned for xferId [... |
@Test public void testTraceLogCallsMadeForIsRunning() throws Exception { PowerMockito .when( TransferListener.getInstance(null, null) ).thenReturn(mockTransferListener); PowerMockito .when( faspmanager2.isRunning(anyString()) ).thenReturn(true); when(mockLog.isDebugEnabled()).thenReturn(true); AsperaFaspManagerWrapper ... | public boolean isRunning(final String xferId) { log.trace("Calling method [isRunning] with parameters [\"" + xferId + "\"]"); boolean rtn = faspmanager2.isRunning(xferId); log.trace("Method [isRunning] returned for xferId [\"" + xferId + "\"] with result: [" + rtn + "]"); return rtn; } | AsperaFaspManagerWrapper { public boolean isRunning(final String xferId) { log.trace("Calling method [isRunning] with parameters [\"" + xferId + "\"]"); boolean rtn = faspmanager2.isRunning(xferId); log.trace("Method [isRunning] returned for xferId [\"" + xferId + "\"] with result: [" + rtn + "]"); return rtn; } } | AsperaFaspManagerWrapper { public boolean isRunning(final String xferId) { log.trace("Calling method [isRunning] with parameters [\"" + xferId + "\"]"); boolean rtn = faspmanager2.isRunning(xferId); log.trace("Method [isRunning] returned for xferId [\"" + xferId + "\"] with result: [" + rtn + "]"); return rtn; } Aspera... | AsperaFaspManagerWrapper { public boolean isRunning(final String xferId) { log.trace("Calling method [isRunning] with parameters [\"" + xferId + "\"]"); boolean rtn = faspmanager2.isRunning(xferId); log.trace("Method [isRunning] returned for xferId [\"" + xferId + "\"] with result: [" + rtn + "]"); return rtn; } Aspera... | AsperaFaspManagerWrapper { public boolean isRunning(final String xferId) { log.trace("Calling method [isRunning] with parameters [\"" + xferId + "\"]"); boolean rtn = faspmanager2.isRunning(xferId); log.trace("Method [isRunning] returned for xferId [\"" + xferId + "\"] with result: [" + rtn + "]"); return rtn; } Aspera... |
@Test public void isThrottlingException_TrueWhenErrorCodeMatchesKnownCodes() throws Exception { AmazonServiceException ase = new AmazonServiceException("msg"); ase.setErrorCode("ThrottlingException"); assertTrue("ThrottlingException error code should be true", RetryUtils.isThrottlingException(ase)); } | @Deprecated public static boolean isThrottlingException(AmazonServiceException exception) { return isThrottlingException((SdkBaseException) exception); } | RetryUtils { @Deprecated public static boolean isThrottlingException(AmazonServiceException exception) { return isThrottlingException((SdkBaseException) exception); } } | RetryUtils { @Deprecated public static boolean isThrottlingException(AmazonServiceException exception) { return isThrottlingException((SdkBaseException) exception); } } | RetryUtils { @Deprecated public static boolean isThrottlingException(AmazonServiceException exception) { return isThrottlingException((SdkBaseException) exception); } @Deprecated static boolean isRetryableServiceException(AmazonServiceException exception); static boolean isRetryableServiceException(SdkBaseException ex... | RetryUtils { @Deprecated public static boolean isThrottlingException(AmazonServiceException exception) { return isThrottlingException((SdkBaseException) exception); } @Deprecated static boolean isRetryableServiceException(AmazonServiceException exception); static boolean isRetryableServiceException(SdkBaseException ex... |
@Test public void isThrottlingException_TrueWhenStatusCodeIs429() throws Exception { AmazonServiceException ase = new AmazonServiceException("msg"); ase.setStatusCode(429); assertTrue("ThrottlingException error code should be true", RetryUtils.isThrottlingException(ase)); } | @Deprecated public static boolean isThrottlingException(AmazonServiceException exception) { return isThrottlingException((SdkBaseException) exception); } | RetryUtils { @Deprecated public static boolean isThrottlingException(AmazonServiceException exception) { return isThrottlingException((SdkBaseException) exception); } } | RetryUtils { @Deprecated public static boolean isThrottlingException(AmazonServiceException exception) { return isThrottlingException((SdkBaseException) exception); } } | RetryUtils { @Deprecated public static boolean isThrottlingException(AmazonServiceException exception) { return isThrottlingException((SdkBaseException) exception); } @Deprecated static boolean isRetryableServiceException(AmazonServiceException exception); static boolean isRetryableServiceException(SdkBaseException ex... | RetryUtils { @Deprecated public static boolean isThrottlingException(AmazonServiceException exception) { return isThrottlingException((SdkBaseException) exception); } @Deprecated static boolean isRetryableServiceException(AmazonServiceException exception); static boolean isRetryableServiceException(SdkBaseException ex... |
@Test public void isThrottlingException_FalseWhenErrorAndStatusCodeDoNotMatch() throws Exception { AmazonServiceException ase = new AmazonServiceException("msg"); ase.setStatusCode(500); ase.setErrorCode("InternalFailure"); assertFalse("InternalFailure error code should be false", RetryUtils.isThrottlingException(ase))... | @Deprecated public static boolean isThrottlingException(AmazonServiceException exception) { return isThrottlingException((SdkBaseException) exception); } | RetryUtils { @Deprecated public static boolean isThrottlingException(AmazonServiceException exception) { return isThrottlingException((SdkBaseException) exception); } } | RetryUtils { @Deprecated public static boolean isThrottlingException(AmazonServiceException exception) { return isThrottlingException((SdkBaseException) exception); } } | RetryUtils { @Deprecated public static boolean isThrottlingException(AmazonServiceException exception) { return isThrottlingException((SdkBaseException) exception); } @Deprecated static boolean isRetryableServiceException(AmazonServiceException exception); static boolean isRetryableServiceException(SdkBaseException ex... | RetryUtils { @Deprecated public static boolean isThrottlingException(AmazonServiceException exception) { return isThrottlingException((SdkBaseException) exception); } @Deprecated static boolean isRetryableServiceException(AmazonServiceException exception); static boolean isRetryableServiceException(SdkBaseException ex... |
@Test public void testTraceLogCallsMadeForConfigureLogLocation() throws Exception { PowerMockito .when( TransferListener.getInstance(null, null) ).thenReturn(mockTransferListener); PowerMockito .when( faspmanager2.configureLogLocation(anyString()) ).thenReturn(true); when(mockLog.isDebugEnabled()).thenReturn(true); Asp... | public boolean configureLogLocation(final String ascpLogPath) { log.trace("Calling method [configureLogLocation] with parameters [\"" + ascpLogPath + "\"]"); boolean rtn = faspmanager2.configureLogLocation(ascpLogPath); log.trace("Method [configureLogLocation] returned for ascpLogPath [\"" + ascpLogPath + "\"] with res... | AsperaFaspManagerWrapper { public boolean configureLogLocation(final String ascpLogPath) { log.trace("Calling method [configureLogLocation] with parameters [\"" + ascpLogPath + "\"]"); boolean rtn = faspmanager2.configureLogLocation(ascpLogPath); log.trace("Method [configureLogLocation] returned for ascpLogPath [\"" + ... | AsperaFaspManagerWrapper { public boolean configureLogLocation(final String ascpLogPath) { log.trace("Calling method [configureLogLocation] with parameters [\"" + ascpLogPath + "\"]"); boolean rtn = faspmanager2.configureLogLocation(ascpLogPath); log.trace("Method [configureLogLocation] returned for ascpLogPath [\"" + ... | AsperaFaspManagerWrapper { public boolean configureLogLocation(final String ascpLogPath) { log.trace("Calling method [configureLogLocation] with parameters [\"" + ascpLogPath + "\"]"); boolean rtn = faspmanager2.configureLogLocation(ascpLogPath); log.trace("Method [configureLogLocation] returned for ascpLogPath [\"" + ... | AsperaFaspManagerWrapper { public boolean configureLogLocation(final String ascpLogPath) { log.trace("Calling method [configureLogLocation] with parameters [\"" + ascpLogPath + "\"]"); boolean rtn = faspmanager2.configureLogLocation(ascpLogPath); log.trace("Method [configureLogLocation] returned for ascpLogPath [\"" + ... |
@Test public void readResourceWithDefaultRetryPolicy_DoesNotRetry_ForIoException() throws IOException { Mockito.when(mockConnection.connectToEndpoint(eq(endpoint), any(Map.class), eq("GET"))).thenThrow(new IOException()); try { new DefaultEC2ResourceFetcher(mockConnection).readResource(endpoint); fail("Expected an IOex... | public abstract String readResource(URI endpoint, CredentialsEndpointRetryPolicy retryPolicy, Map<String, String> headers); | EC2ResourceFetcher { public abstract String readResource(URI endpoint, CredentialsEndpointRetryPolicy retryPolicy, Map<String, String> headers); } | EC2ResourceFetcher { public abstract String readResource(URI endpoint, CredentialsEndpointRetryPolicy retryPolicy, Map<String, String> headers); EC2ResourceFetcher(); @SdkTestInternalApi EC2ResourceFetcher(ConnectionUtils connectionUtils); } | EC2ResourceFetcher { public abstract String readResource(URI endpoint, CredentialsEndpointRetryPolicy retryPolicy, Map<String, String> headers); EC2ResourceFetcher(); @SdkTestInternalApi EC2ResourceFetcher(ConnectionUtils connectionUtils); static EC2ResourceFetcher defaultResourceFetcher(); abstract String readResourc... | EC2ResourceFetcher { public abstract String readResource(URI endpoint, CredentialsEndpointRetryPolicy retryPolicy, Map<String, String> headers); EC2ResourceFetcher(); @SdkTestInternalApi EC2ResourceFetcher(ConnectionUtils connectionUtils); static EC2ResourceFetcher defaultResourceFetcher(); abstract String readResourc... |
@Test public void readResourceWithCustomRetryPolicy_DoesRetry_ForIoException() throws IOException { Mockito.when(mockConnection.connectToEndpoint(eq(endpoint), any(Map.class), eq("GET"))).thenThrow(new IOException()); try { new DefaultEC2ResourceFetcher(mockConnection).readResource(endpoint, customRetryPolicy); fail("E... | public abstract String readResource(URI endpoint, CredentialsEndpointRetryPolicy retryPolicy, Map<String, String> headers); | EC2ResourceFetcher { public abstract String readResource(URI endpoint, CredentialsEndpointRetryPolicy retryPolicy, Map<String, String> headers); } | EC2ResourceFetcher { public abstract String readResource(URI endpoint, CredentialsEndpointRetryPolicy retryPolicy, Map<String, String> headers); EC2ResourceFetcher(); @SdkTestInternalApi EC2ResourceFetcher(ConnectionUtils connectionUtils); } | EC2ResourceFetcher { public abstract String readResource(URI endpoint, CredentialsEndpointRetryPolicy retryPolicy, Map<String, String> headers); EC2ResourceFetcher(); @SdkTestInternalApi EC2ResourceFetcher(ConnectionUtils connectionUtils); static EC2ResourceFetcher defaultResourceFetcher(); abstract String readResourc... | EC2ResourceFetcher { public abstract String readResource(URI endpoint, CredentialsEndpointRetryPolicy retryPolicy, Map<String, String> headers); EC2ResourceFetcher(); @SdkTestInternalApi EC2ResourceFetcher(ConnectionUtils connectionUtils); static EC2ResourceFetcher defaultResourceFetcher(); abstract String readResourc... |
@Test public void testJarIsCreatedSuccessfully() throws IOException, URISyntaxException { JarFile jar = AsperaLibraryLoader.createJar(); assertNotNull(jar); } | public static JarFile createJar() throws IOException, URISyntaxException { URL location = faspmanager2.class.getProtectionDomain().getCodeSource().getLocation(); return new JarFile(new File(location.toURI())); } | AsperaLibraryLoader { public static JarFile createJar() throws IOException, URISyntaxException { URL location = faspmanager2.class.getProtectionDomain().getCodeSource().getLocation(); return new JarFile(new File(location.toURI())); } } | AsperaLibraryLoader { public static JarFile createJar() throws IOException, URISyntaxException { URL location = faspmanager2.class.getProtectionDomain().getCodeSource().getLocation(); return new JarFile(new File(location.toURI())); } } | AsperaLibraryLoader { public static JarFile createJar() throws IOException, URISyntaxException { URL location = faspmanager2.class.getProtectionDomain().getCodeSource().getLocation(); return new JarFile(new File(location.toURI())); } static String load(); static JarFile createJar(); static String jarVersion(JarFile ja... | AsperaLibraryLoader { public static JarFile createJar() throws IOException, URISyntaxException { URL location = faspmanager2.class.getProtectionDomain().getCodeSource().getLocation(); return new JarFile(new File(location.toURI())); } static String load(); static JarFile createJar(); static String jarVersion(JarFile ja... |
@Test public void readResourceWithCustomRetryPolicy_DoesNotRetry_ForNonIoException() throws IOException { generateStub(500, "Non Json error body"); try { ec2ResourceFetcher.readResource(endpoint, customRetryPolicy, new HashMap<String, String>()); fail("Expected an AmazonServiceException"); } catch (AmazonServiceExcepti... | public abstract String readResource(URI endpoint, CredentialsEndpointRetryPolicy retryPolicy, Map<String, String> headers); | EC2ResourceFetcher { public abstract String readResource(URI endpoint, CredentialsEndpointRetryPolicy retryPolicy, Map<String, String> headers); } | EC2ResourceFetcher { public abstract String readResource(URI endpoint, CredentialsEndpointRetryPolicy retryPolicy, Map<String, String> headers); EC2ResourceFetcher(); @SdkTestInternalApi EC2ResourceFetcher(ConnectionUtils connectionUtils); } | EC2ResourceFetcher { public abstract String readResource(URI endpoint, CredentialsEndpointRetryPolicy retryPolicy, Map<String, String> headers); EC2ResourceFetcher(); @SdkTestInternalApi EC2ResourceFetcher(ConnectionUtils connectionUtils); static EC2ResourceFetcher defaultResourceFetcher(); abstract String readResourc... | EC2ResourceFetcher { public abstract String readResource(URI endpoint, CredentialsEndpointRetryPolicy retryPolicy, Map<String, String> headers); EC2ResourceFetcher(); @SdkTestInternalApi EC2ResourceFetcher(ConnectionUtils connectionUtils); static EC2ResourceFetcher defaultResourceFetcher(); abstract String readResourc... |
@Test public void testInputStreamAbortedIsCalled(){ SdkFilterInputStream in = mock(SdkFilterInputStream.class); SdkFilterInputStream sdkFilterInputStream = spy(new SdkFilterInputStream(in)); sdkFilterInputStream.abort(); verify(in, times(1)).abort(); } | public void abort() { if (in instanceof SdkFilterInputStream) { ((SdkFilterInputStream) in).abort(); } aborted = true; } | SdkFilterInputStream extends FilterInputStream implements
MetricAware, Releasable { public void abort() { if (in instanceof SdkFilterInputStream) { ((SdkFilterInputStream) in).abort(); } aborted = true; } } | SdkFilterInputStream extends FilterInputStream implements
MetricAware, Releasable { public void abort() { if (in instanceof SdkFilterInputStream) { ((SdkFilterInputStream) in).abort(); } aborted = true; } protected SdkFilterInputStream(InputStream in); } | SdkFilterInputStream extends FilterInputStream implements
MetricAware, Releasable { public void abort() { if (in instanceof SdkFilterInputStream) { ((SdkFilterInputStream) in).abort(); } aborted = true; } protected SdkFilterInputStream(InputStream in); @SdkProtectedApi InputStream getDelegateStream(); @Overrid... | SdkFilterInputStream extends FilterInputStream implements
MetricAware, Releasable { public void abort() { if (in instanceof SdkFilterInputStream) { ((SdkFilterInputStream) in).abort(); } aborted = true; } protected SdkFilterInputStream(InputStream in); @SdkProtectedApi InputStream getDelegateStream(); @Overrid... |
@Ignore @Test public void headersArePassedAsPartOfRequest() throws IOException { HttpURLConnection connection = sut.connectToEndpoint(URI.create("http: connection.getResponseCode(); mockServer.verify(getRequestedFor(urlMatching("/")).withHeader("HeaderA", equalTo("ValueA"))); } | public HttpURLConnection connectToEndpoint(URI endpoint, Map<String, String> headers) throws IOException { return connectToEndpoint(endpoint, headers, "GET"); } | ConnectionUtils { public HttpURLConnection connectToEndpoint(URI endpoint, Map<String, String> headers) throws IOException { return connectToEndpoint(endpoint, headers, "GET"); } } | ConnectionUtils { public HttpURLConnection connectToEndpoint(URI endpoint, Map<String, String> headers) throws IOException { return connectToEndpoint(endpoint, headers, "GET"); } private ConnectionUtils(); } | ConnectionUtils { public HttpURLConnection connectToEndpoint(URI endpoint, Map<String, String> headers) throws IOException { return connectToEndpoint(endpoint, headers, "GET"); } private ConnectionUtils(); static ConnectionUtils getInstance(); HttpURLConnection connectToEndpoint(URI endpoint, Map<String, String> heade... | ConnectionUtils { public HttpURLConnection connectToEndpoint(URI endpoint, Map<String, String> headers) throws IOException { return connectToEndpoint(endpoint, headers, "GET"); } private ConnectionUtils(); static ConnectionUtils getInstance(); HttpURLConnection connectToEndpoint(URI endpoint, Map<String, String> heade... |
@Test public void testOSLibIsReturned() { String OS = System.getProperty("os.name").toLowerCase(); List<String> osNativeLibraries = AsperaLibraryLoader.osLibs(); assertNotNull(osNativeLibraries); if (OS.indexOf("win") >= 0){ assertTrue(osNativeLibraries.contains("faspmanager2.dll")); } else if (OS.indexOf("mac") >= 0) ... | public static List<String> osLibs() { String OS = System.getProperty("os.name").toLowerCase(); if (OS.indexOf("win") >= 0){ return WINDOWS_DYNAMIC_LIBS; } else if (OS.indexOf("mac") >= 0) { return MAC_DYNAMIC_LIBS; } else if (OS.indexOf("nix") >= 0 || OS.indexOf("nux") >= 0 || OS.indexOf("aix") > 0 ) { return UNIX_DYNA... | AsperaLibraryLoader { public static List<String> osLibs() { String OS = System.getProperty("os.name").toLowerCase(); if (OS.indexOf("win") >= 0){ return WINDOWS_DYNAMIC_LIBS; } else if (OS.indexOf("mac") >= 0) { return MAC_DYNAMIC_LIBS; } else if (OS.indexOf("nix") >= 0 || OS.indexOf("nux") >= 0 || OS.indexOf("aix") > ... | AsperaLibraryLoader { public static List<String> osLibs() { String OS = System.getProperty("os.name").toLowerCase(); if (OS.indexOf("win") >= 0){ return WINDOWS_DYNAMIC_LIBS; } else if (OS.indexOf("mac") >= 0) { return MAC_DYNAMIC_LIBS; } else if (OS.indexOf("nix") >= 0 || OS.indexOf("nux") >= 0 || OS.indexOf("aix") > ... | AsperaLibraryLoader { public static List<String> osLibs() { String OS = System.getProperty("os.name").toLowerCase(); if (OS.indexOf("win") >= 0){ return WINDOWS_DYNAMIC_LIBS; } else if (OS.indexOf("mac") >= 0) { return MAC_DYNAMIC_LIBS; } else if (OS.indexOf("nix") >= 0 || OS.indexOf("nux") >= 0 || OS.indexOf("aix") > ... | AsperaLibraryLoader { public static List<String> osLibs() { String OS = System.getProperty("os.name").toLowerCase(); if (OS.indexOf("win") >= 0){ return WINDOWS_DYNAMIC_LIBS; } else if (OS.indexOf("mac") >= 0) { return MAC_DYNAMIC_LIBS; } else if (OS.indexOf("nix") >= 0 || OS.indexOf("nux") >= 0 || OS.indexOf("aix") > ... |
@Test public void testAsperaTransactionIsDoneERROR(){ transferListener = TransferListener.getInstance(xferId, null); AsperaTransfer asperaTransaction = new AsperaTransactionImpl(xferId, null, null, null, null, null); transferListener.transferReporter(xferId, msgQueued); transferListener.transferReporter(xferId, msgStat... | @Override public boolean isDone() { return (doesStatusMatch(DONE)||doesStatusMatch(ERROR)||doesStatusMatch(STOP)||doesStatusMatch(ARGSTOP)); } | AsperaTransactionImpl implements AsperaTransaction { @Override public boolean isDone() { return (doesStatusMatch(DONE)||doesStatusMatch(ERROR)||doesStatusMatch(STOP)||doesStatusMatch(ARGSTOP)); } } | AsperaTransactionImpl implements AsperaTransaction { @Override public boolean isDone() { return (doesStatusMatch(DONE)||doesStatusMatch(ERROR)||doesStatusMatch(STOP)||doesStatusMatch(ARGSTOP)); } AsperaTransactionImpl(String xferid, String bucketName, String key, String fileName, TransferProgress transferProgress, Prog... | AsperaTransactionImpl implements AsperaTransaction { @Override public boolean isDone() { return (doesStatusMatch(DONE)||doesStatusMatch(ERROR)||doesStatusMatch(STOP)||doesStatusMatch(ARGSTOP)); } AsperaTransactionImpl(String xferid, String bucketName, String key, String fileName, TransferProgress transferProgress, Prog... | AsperaTransactionImpl implements AsperaTransaction { @Override public boolean isDone() { return (doesStatusMatch(DONE)||doesStatusMatch(ERROR)||doesStatusMatch(STOP)||doesStatusMatch(ARGSTOP)); } AsperaTransactionImpl(String xferid, String bucketName, String key, String fileName, TransferProgress transferProgress, Prog... |
@Test public void testAsperaTransactionIsDoneSuccess(){ transferListener = TransferListener.getInstance(xferId, null); AsperaTransfer asperaTransaction = new AsperaTransactionImpl(xferId, null, null, null, null, null); transferListener.transferReporter(xferId, msgQueued); transferListener.transferReporter(xferId, msgSt... | @Override public boolean isDone() { return (doesStatusMatch(DONE)||doesStatusMatch(ERROR)||doesStatusMatch(STOP)||doesStatusMatch(ARGSTOP)); } | AsperaTransactionImpl implements AsperaTransaction { @Override public boolean isDone() { return (doesStatusMatch(DONE)||doesStatusMatch(ERROR)||doesStatusMatch(STOP)||doesStatusMatch(ARGSTOP)); } } | AsperaTransactionImpl implements AsperaTransaction { @Override public boolean isDone() { return (doesStatusMatch(DONE)||doesStatusMatch(ERROR)||doesStatusMatch(STOP)||doesStatusMatch(ARGSTOP)); } AsperaTransactionImpl(String xferid, String bucketName, String key, String fileName, TransferProgress transferProgress, Prog... | AsperaTransactionImpl implements AsperaTransaction { @Override public boolean isDone() { return (doesStatusMatch(DONE)||doesStatusMatch(ERROR)||doesStatusMatch(STOP)||doesStatusMatch(ARGSTOP)); } AsperaTransactionImpl(String xferid, String bucketName, String key, String fileName, TransferProgress transferProgress, Prog... | AsperaTransactionImpl implements AsperaTransaction { @Override public boolean isDone() { return (doesStatusMatch(DONE)||doesStatusMatch(ERROR)||doesStatusMatch(STOP)||doesStatusMatch(ARGSTOP)); } AsperaTransactionImpl(String xferid, String bucketName, String key, String fileName, TransferProgress transferProgress, Prog... |
@Test public void testAsperaTransactionIsProgress(){ transferListener = TransferListener.getInstance(xferId, null); AsperaTransfer asperaTransaction = new AsperaTransactionImpl(xferId, null, null, null, null, null); transferListener.transferReporter(xferId, msgQueued); transferListener.transferReporter(xferId, msgStats... | @Override public boolean progress() { return doesStatusMatch(PROGRESS); } | AsperaTransactionImpl implements AsperaTransaction { @Override public boolean progress() { return doesStatusMatch(PROGRESS); } } | AsperaTransactionImpl implements AsperaTransaction { @Override public boolean progress() { return doesStatusMatch(PROGRESS); } AsperaTransactionImpl(String xferid, String bucketName, String key, String fileName, TransferProgress transferProgress, ProgressListenerChain listenerChain); } | AsperaTransactionImpl implements AsperaTransaction { @Override public boolean progress() { return doesStatusMatch(PROGRESS); } AsperaTransactionImpl(String xferid, String bucketName, String key, String fileName, TransferProgress transferProgress, ProgressListenerChain listenerChain); @Override boolean pause(); @Overrid... | AsperaTransactionImpl implements AsperaTransaction { @Override public boolean progress() { return doesStatusMatch(PROGRESS); } AsperaTransactionImpl(String xferid, String bucketName, String key, String fileName, TransferProgress transferProgress, ProgressListenerChain listenerChain); @Override boolean pause(); @Overrid... |
@Test public void disableCertChecking_FlagEnabled_TurnsOffCertChecking() { System.setProperty(DISABLE_CERT_CHECKING_SYSTEM_PROPERTY, ""); assertTrue(SDKGlobalConfiguration.isCertCheckingDisabled()); } | public static boolean isCertCheckingDisabled() { return isPropertyEnabled(System.getProperty(DISABLE_CERT_CHECKING_SYSTEM_PROPERTY)); } | SDKGlobalConfiguration { public static boolean isCertCheckingDisabled() { return isPropertyEnabled(System.getProperty(DISABLE_CERT_CHECKING_SYSTEM_PROPERTY)); } } | SDKGlobalConfiguration { public static boolean isCertCheckingDisabled() { return isPropertyEnabled(System.getProperty(DISABLE_CERT_CHECKING_SYSTEM_PROPERTY)); } } | SDKGlobalConfiguration { public static boolean isCertCheckingDisabled() { return isPropertyEnabled(System.getProperty(DISABLE_CERT_CHECKING_SYSTEM_PROPERTY)); } @Deprecated static void setGlobalTimeOffset(int timeOffset); @Deprecated static int getGlobalTimeOffset(); static boolean isInRegionOptimizedModeEnabled(); st... | SDKGlobalConfiguration { public static boolean isCertCheckingDisabled() { return isPropertyEnabled(System.getProperty(DISABLE_CERT_CHECKING_SYSTEM_PROPERTY)); } @Deprecated static void setGlobalTimeOffset(int timeOffset); @Deprecated static int getGlobalTimeOffset(); static boolean isInRegionOptimizedModeEnabled(); st... |
@Test public void disableCertChecking_PropertySetToTrue_TurnsOffCertChecking() { System.setProperty(DISABLE_CERT_CHECKING_SYSTEM_PROPERTY, "true"); assertTrue(SDKGlobalConfiguration.isCertCheckingDisabled()); } | public static boolean isCertCheckingDisabled() { return isPropertyEnabled(System.getProperty(DISABLE_CERT_CHECKING_SYSTEM_PROPERTY)); } | SDKGlobalConfiguration { public static boolean isCertCheckingDisabled() { return isPropertyEnabled(System.getProperty(DISABLE_CERT_CHECKING_SYSTEM_PROPERTY)); } } | SDKGlobalConfiguration { public static boolean isCertCheckingDisabled() { return isPropertyEnabled(System.getProperty(DISABLE_CERT_CHECKING_SYSTEM_PROPERTY)); } } | SDKGlobalConfiguration { public static boolean isCertCheckingDisabled() { return isPropertyEnabled(System.getProperty(DISABLE_CERT_CHECKING_SYSTEM_PROPERTY)); } @Deprecated static void setGlobalTimeOffset(int timeOffset); @Deprecated static int getGlobalTimeOffset(); static boolean isInRegionOptimizedModeEnabled(); st... | SDKGlobalConfiguration { public static boolean isCertCheckingDisabled() { return isPropertyEnabled(System.getProperty(DISABLE_CERT_CHECKING_SYSTEM_PROPERTY)); } @Deprecated static void setGlobalTimeOffset(int timeOffset); @Deprecated static int getGlobalTimeOffset(); static boolean isInRegionOptimizedModeEnabled(); st... |
@Test public void disableCertChecking_PropertySet_TurnsOffCertChecking() { System.setProperty(DISABLE_CERT_CHECKING_SYSTEM_PROPERTY, "anything"); assertTrue(SDKGlobalConfiguration.isCertCheckingDisabled()); } | public static boolean isCertCheckingDisabled() { return isPropertyEnabled(System.getProperty(DISABLE_CERT_CHECKING_SYSTEM_PROPERTY)); } | SDKGlobalConfiguration { public static boolean isCertCheckingDisabled() { return isPropertyEnabled(System.getProperty(DISABLE_CERT_CHECKING_SYSTEM_PROPERTY)); } } | SDKGlobalConfiguration { public static boolean isCertCheckingDisabled() { return isPropertyEnabled(System.getProperty(DISABLE_CERT_CHECKING_SYSTEM_PROPERTY)); } } | SDKGlobalConfiguration { public static boolean isCertCheckingDisabled() { return isPropertyEnabled(System.getProperty(DISABLE_CERT_CHECKING_SYSTEM_PROPERTY)); } @Deprecated static void setGlobalTimeOffset(int timeOffset); @Deprecated static int getGlobalTimeOffset(); static boolean isInRegionOptimizedModeEnabled(); st... | SDKGlobalConfiguration { public static boolean isCertCheckingDisabled() { return isPropertyEnabled(System.getProperty(DISABLE_CERT_CHECKING_SYSTEM_PROPERTY)); } @Deprecated static void setGlobalTimeOffset(int timeOffset); @Deprecated static int getGlobalTimeOffset(); static boolean isInRegionOptimizedModeEnabled(); st... |
@Test public void disableCertChecking_PropertySetToFalse_TurnsOffCertChecking() { System.setProperty(DISABLE_CERT_CHECKING_SYSTEM_PROPERTY, "false"); assertFalse(SDKGlobalConfiguration.isCertCheckingDisabled()); } | public static boolean isCertCheckingDisabled() { return isPropertyEnabled(System.getProperty(DISABLE_CERT_CHECKING_SYSTEM_PROPERTY)); } | SDKGlobalConfiguration { public static boolean isCertCheckingDisabled() { return isPropertyEnabled(System.getProperty(DISABLE_CERT_CHECKING_SYSTEM_PROPERTY)); } } | SDKGlobalConfiguration { public static boolean isCertCheckingDisabled() { return isPropertyEnabled(System.getProperty(DISABLE_CERT_CHECKING_SYSTEM_PROPERTY)); } } | SDKGlobalConfiguration { public static boolean isCertCheckingDisabled() { return isPropertyEnabled(System.getProperty(DISABLE_CERT_CHECKING_SYSTEM_PROPERTY)); } @Deprecated static void setGlobalTimeOffset(int timeOffset); @Deprecated static int getGlobalTimeOffset(); static boolean isInRegionOptimizedModeEnabled(); st... | SDKGlobalConfiguration { public static boolean isCertCheckingDisabled() { return isPropertyEnabled(System.getProperty(DISABLE_CERT_CHECKING_SYSTEM_PROPERTY)); } @Deprecated static void setGlobalTimeOffset(int timeOffset); @Deprecated static int getGlobalTimeOffset(); static boolean isInRegionOptimizedModeEnabled(); st... |
@Test public void disableCertChecking_PropertySetToFalseMixedCase_TurnsOffCertChecking() { System.setProperty(DISABLE_CERT_CHECKING_SYSTEM_PROPERTY, "FaLsE"); assertFalse(SDKGlobalConfiguration.isCertCheckingDisabled()); } | public static boolean isCertCheckingDisabled() { return isPropertyEnabled(System.getProperty(DISABLE_CERT_CHECKING_SYSTEM_PROPERTY)); } | SDKGlobalConfiguration { public static boolean isCertCheckingDisabled() { return isPropertyEnabled(System.getProperty(DISABLE_CERT_CHECKING_SYSTEM_PROPERTY)); } } | SDKGlobalConfiguration { public static boolean isCertCheckingDisabled() { return isPropertyEnabled(System.getProperty(DISABLE_CERT_CHECKING_SYSTEM_PROPERTY)); } } | SDKGlobalConfiguration { public static boolean isCertCheckingDisabled() { return isPropertyEnabled(System.getProperty(DISABLE_CERT_CHECKING_SYSTEM_PROPERTY)); } @Deprecated static void setGlobalTimeOffset(int timeOffset); @Deprecated static int getGlobalTimeOffset(); static boolean isInRegionOptimizedModeEnabled(); st... | SDKGlobalConfiguration { public static boolean isCertCheckingDisabled() { return isPropertyEnabled(System.getProperty(DISABLE_CERT_CHECKING_SYSTEM_PROPERTY)); } @Deprecated static void setGlobalTimeOffset(int timeOffset); @Deprecated static int getGlobalTimeOffset(); static boolean isInRegionOptimizedModeEnabled(); st... |
@Test public void credentialsNotExplicitlySet_UsesDefaultCredentialChain() throws Exception { AwsAsyncClientParams params = builderWithRegion().build().getAsyncParams(); assertThat(params.getCredentialsProvider(), instanceOf(DefaultAWSCredentialsProviderChain.class)); } | public abstract TypeToBuild build(); | AwsClientBuilder { public abstract TypeToBuild build(); } | AwsClientBuilder { public abstract TypeToBuild build(); protected AwsClientBuilder(ClientConfigurationFactory clientConfigFactory); @SdkTestInternalApi protected AwsClientBuilder(ClientConfigurationFactory clientConfigFactory,
AwsRegionProvider regionProvider); } | AwsClientBuilder { public abstract TypeToBuild build(); protected AwsClientBuilder(ClientConfigurationFactory clientConfigFactory); @SdkTestInternalApi protected AwsClientBuilder(ClientConfigurationFactory clientConfigFactory,
AwsRegionProvider regionProvider); final AWSCredentialsProvi... | AwsClientBuilder { public abstract TypeToBuild build(); protected AwsClientBuilder(ClientConfigurationFactory clientConfigFactory); @SdkTestInternalApi protected AwsClientBuilder(ClientConfigurationFactory clientConfigFactory,
AwsRegionProvider regionProvider); final AWSCredentialsProvi... |
@Test public void metricCollectorNotExplicitlySet_UsesNullMetricsCollector() throws Exception { assertNull(builderWithRegion().build().getAsyncParams().getRequestMetricCollector()); } | public abstract TypeToBuild build(); | AwsClientBuilder { public abstract TypeToBuild build(); } | AwsClientBuilder { public abstract TypeToBuild build(); protected AwsClientBuilder(ClientConfigurationFactory clientConfigFactory); @SdkTestInternalApi protected AwsClientBuilder(ClientConfigurationFactory clientConfigFactory,
AwsRegionProvider regionProvider); } | AwsClientBuilder { public abstract TypeToBuild build(); protected AwsClientBuilder(ClientConfigurationFactory clientConfigFactory); @SdkTestInternalApi protected AwsClientBuilder(ClientConfigurationFactory clientConfigFactory,
AwsRegionProvider regionProvider); final AWSCredentialsProvi... | AwsClientBuilder { public abstract TypeToBuild build(); protected AwsClientBuilder(ClientConfigurationFactory clientConfigFactory); @SdkTestInternalApi protected AwsClientBuilder(ClientConfigurationFactory clientConfigFactory,
AwsRegionProvider regionProvider); final AWSCredentialsProvi... |
@Test public void defaultClientConfigAndNoExplicitExecutor_UsesDefaultExecutorBasedOnMaxConns() { ExecutorService executor = builderWithRegion().build().getAsyncParams().getExecutor(); assertThat(executor, instanceOf(ThreadPoolExecutor.class)); assertEquals(PredefinedClientConfigurations.defaultConfig().getMaxConnectio... | public abstract TypeToBuild build(); | AwsClientBuilder { public abstract TypeToBuild build(); } | AwsClientBuilder { public abstract TypeToBuild build(); protected AwsClientBuilder(ClientConfigurationFactory clientConfigFactory); @SdkTestInternalApi protected AwsClientBuilder(ClientConfigurationFactory clientConfigFactory,
AwsRegionProvider regionProvider); } | AwsClientBuilder { public abstract TypeToBuild build(); protected AwsClientBuilder(ClientConfigurationFactory clientConfigFactory); @SdkTestInternalApi protected AwsClientBuilder(ClientConfigurationFactory clientConfigFactory,
AwsRegionProvider regionProvider); final AWSCredentialsProvi... | AwsClientBuilder { public abstract TypeToBuild build(); protected AwsClientBuilder(ClientConfigurationFactory clientConfigFactory); @SdkTestInternalApi protected AwsClientBuilder(ClientConfigurationFactory clientConfigFactory,
AwsRegionProvider regionProvider); final AWSCredentialsProvi... |
@Test public void testAsperaTransactionIsQueued(){ transferListener = TransferListener.getInstance(xferId, null); AsperaTransfer asperaTransaction = new AsperaTransactionImpl(xferId, null, null, null, null, null); transferListener.transferReporter(xferId, msgQueued); assertTrue(asperaTransaction.onQueue()); } | @Override public boolean onQueue() { return doesStatusMatch(QUEUED); } | AsperaTransactionImpl implements AsperaTransaction { @Override public boolean onQueue() { return doesStatusMatch(QUEUED); } } | AsperaTransactionImpl implements AsperaTransaction { @Override public boolean onQueue() { return doesStatusMatch(QUEUED); } AsperaTransactionImpl(String xferid, String bucketName, String key, String fileName, TransferProgress transferProgress, ProgressListenerChain listenerChain); } | AsperaTransactionImpl implements AsperaTransaction { @Override public boolean onQueue() { return doesStatusMatch(QUEUED); } AsperaTransactionImpl(String xferid, String bucketName, String key, String fileName, TransferProgress transferProgress, ProgressListenerChain listenerChain); @Override boolean pause(); @Override b... | AsperaTransactionImpl implements AsperaTransaction { @Override public boolean onQueue() { return doesStatusMatch(QUEUED); } AsperaTransactionImpl(String xferid, String bucketName, String key, String fileName, TransferProgress transferProgress, ProgressListenerChain listenerChain); @Override boolean pause(); @Override b... |
@Test public void testHeadersAddedToObjectListing() throws Exception { Unmarshaller<ObjectListing, InputStream> unmarshaller = new Unmarshallers.ListObjectsUnmarshaller(false); S3XmlResponseHandler xmlResponseHandler = new S3XmlResponseHandler<ObjectListing>(unmarshaller); HttpResponse httpResponse = new HttpResponse(n... | public AmazonWebServiceResponse<T> handle(HttpResponse response) throws Exception { AmazonWebServiceResponse<T> awsResponse = parseResponseMetadata(response); responseHeaders = response.getHeaders(); if (responseUnmarshaller != null) { log.trace("Beginning to parse service response XML"); T result = responseUnmarshalle... | S3XmlResponseHandler extends AbstractS3ResponseHandler<T> { public AmazonWebServiceResponse<T> handle(HttpResponse response) throws Exception { AmazonWebServiceResponse<T> awsResponse = parseResponseMetadata(response); responseHeaders = response.getHeaders(); if (responseUnmarshaller != null) { log.trace("Beginning to ... | S3XmlResponseHandler extends AbstractS3ResponseHandler<T> { public AmazonWebServiceResponse<T> handle(HttpResponse response) throws Exception { AmazonWebServiceResponse<T> awsResponse = parseResponseMetadata(response); responseHeaders = response.getHeaders(); if (responseUnmarshaller != null) { log.trace("Beginning to ... | S3XmlResponseHandler extends AbstractS3ResponseHandler<T> { public AmazonWebServiceResponse<T> handle(HttpResponse response) throws Exception { AmazonWebServiceResponse<T> awsResponse = parseResponseMetadata(response); responseHeaders = response.getHeaders(); if (responseUnmarshaller != null) { log.trace("Beginning to ... | S3XmlResponseHandler extends AbstractS3ResponseHandler<T> { public AmazonWebServiceResponse<T> handle(HttpResponse response) throws Exception { AmazonWebServiceResponse<T> awsResponse = parseResponseMetadata(response); responseHeaders = response.getHeaders(); if (responseUnmarshaller != null) { log.trace("Beginning to ... |
@Test public void testGetRegion() { Region region = metadata.getRegion("us-east-1"); Assert.assertNotNull(region); Assert.assertEquals("us-east-1", region.getName()); region = metadata.getRegion("us-west-1"); Assert.assertNotNull(region); Assert.assertEquals("us-west-1", region.getName()); region = metadata.getRegion("... | public Region getRegion(final String name) { return provider.getRegion(name); } | RegionMetadata { public Region getRegion(final String name) { return provider.getRegion(name); } } | RegionMetadata { public Region getRegion(final String name) { return provider.getRegion(name); } RegionMetadata(final List<Region> regions); RegionMetadata(RegionMetadataProvider provider); } | RegionMetadata { public Region getRegion(final String name) { return provider.getRegion(name); } RegionMetadata(final List<Region> regions); RegionMetadata(RegionMetadataProvider provider); List<Region> getRegions(); Region getRegion(final String name); List<Region> getRegionsForService(final String service); @Depreca... | RegionMetadata { public Region getRegion(final String name) { return provider.getRegion(name); } RegionMetadata(final List<Region> regions); RegionMetadata(RegionMetadataProvider provider); List<Region> getRegions(); Region getRegion(final String name); List<Region> getRegionsForService(final String service); @Depreca... |
@Test public void testGetRegionsForService() { List<Region> regions = metadata.getRegionsForService("s3"); Assert.assertNotNull(regions); Assert.assertEquals(2, regions.size()); Assert.assertEquals("us-east-1", regions.get(0).getName()); Assert.assertEquals("us-west-1", regions.get(1).getName()); regions = metadata.get... | public List<Region> getRegionsForService(final String service) { return provider.getRegionsForService(service); } | RegionMetadata { public List<Region> getRegionsForService(final String service) { return provider.getRegionsForService(service); } } | RegionMetadata { public List<Region> getRegionsForService(final String service) { return provider.getRegionsForService(service); } RegionMetadata(final List<Region> regions); RegionMetadata(RegionMetadataProvider provider); } | RegionMetadata { public List<Region> getRegionsForService(final String service) { return provider.getRegionsForService(service); } RegionMetadata(final List<Region> regions); RegionMetadata(RegionMetadataProvider provider); List<Region> getRegions(); Region getRegion(final String name); List<Region> getRegionsForServi... | RegionMetadata { public List<Region> getRegionsForService(final String service) { return provider.getRegionsForService(service); } RegionMetadata(final List<Region> regions); RegionMetadata(RegionMetadataProvider provider); List<Region> getRegions(); Region getRegion(final String name); List<Region> getRegionsForServi... |
@Test public void testGetRegionByEndpoint() { Region region = metadata.getRegionByEndpoint("s3-us-west-1.amazonaws.com"); Assert.assertNotNull(region); Assert.assertEquals("us-west-1", region.getName()); try { metadata.getRegionByEndpoint("bogus-monkeys"); Assert.fail("Expected an IllegalArgumentException"); } catch (I... | @Deprecated public Region getRegionByEndpoint(final String endpoint) { return provider.getRegionByEndpoint(endpoint); } | RegionMetadata { @Deprecated public Region getRegionByEndpoint(final String endpoint) { return provider.getRegionByEndpoint(endpoint); } } | RegionMetadata { @Deprecated public Region getRegionByEndpoint(final String endpoint) { return provider.getRegionByEndpoint(endpoint); } RegionMetadata(final List<Region> regions); RegionMetadata(RegionMetadataProvider provider); } | RegionMetadata { @Deprecated public Region getRegionByEndpoint(final String endpoint) { return provider.getRegionByEndpoint(endpoint); } RegionMetadata(final List<Region> regions); RegionMetadata(RegionMetadataProvider provider); List<Region> getRegions(); Region getRegion(final String name); List<Region> getRegionsFo... | RegionMetadata { @Deprecated public Region getRegionByEndpoint(final String endpoint) { return provider.getRegionByEndpoint(endpoint); } RegionMetadata(final List<Region> regions); RegionMetadata(RegionMetadataProvider provider); List<Region> getRegions(); Region getRegion(final String name); List<Region> getRegionsFo... |
@Test public void testAsperaTransactionPause(){ transferListener = TransferListener.getInstance(xferId, null); AsperaTransfer asperaTransaction = new AsperaTransactionImpl(xferId, null, null, null, null, null); transferListener.transferReporter(xferId, msgQueued); transferListener.transferReporter(xferId, msgStats); as... | @Override public boolean pause() { return asperaFaspManagerWrapper.pause(xferid); } | AsperaTransactionImpl implements AsperaTransaction { @Override public boolean pause() { return asperaFaspManagerWrapper.pause(xferid); } } | AsperaTransactionImpl implements AsperaTransaction { @Override public boolean pause() { return asperaFaspManagerWrapper.pause(xferid); } AsperaTransactionImpl(String xferid, String bucketName, String key, String fileName, TransferProgress transferProgress, ProgressListenerChain listenerChain); } | AsperaTransactionImpl implements AsperaTransaction { @Override public boolean pause() { return asperaFaspManagerWrapper.pause(xferid); } AsperaTransactionImpl(String xferid, String bucketName, String key, String fileName, TransferProgress transferProgress, ProgressListenerChain listenerChain); @Override boolean pause()... | AsperaTransactionImpl implements AsperaTransaction { @Override public boolean pause() { return asperaFaspManagerWrapper.pause(xferid); } AsperaTransactionImpl(String xferid, String bucketName, String key, String fileName, TransferProgress transferProgress, ProgressListenerChain listenerChain); @Override boolean pause()... |
@Test public void shouldAcceptTokenProvider() { TokenProvider tokenProvider = new TokenProviderUtil(); defaultTokenManager = new DefaultTokenManager(tokenProvider); assertEquals(defaultTokenManager.getToken(), ("ProviderAccessToken")); } | @Override public String getToken() { log.debug("DefaultTokenManager getToken()"); if (!checkCache()) { retrieveToken(); } if (token == null) { token = retrieveTokenFromCache(); } if (hasTokenExpired(token)) { token = retrieveTokenFromCache(); } if (isTokenExpiring(token) && !isAsyncInProgress()) { if (null != token.get... | DefaultTokenManager implements TokenManager { @Override public String getToken() { log.debug("DefaultTokenManager getToken()"); if (!checkCache()) { retrieveToken(); } if (token == null) { token = retrieveTokenFromCache(); } if (hasTokenExpired(token)) { token = retrieveTokenFromCache(); } if (isTokenExpiring(token) &&... | DefaultTokenManager implements TokenManager { @Override public String getToken() { log.debug("DefaultTokenManager getToken()"); if (!checkCache()) { retrieveToken(); } if (token == null) { token = retrieveTokenFromCache(); } if (hasTokenExpired(token)) { token = retrieveTokenFromCache(); } if (isTokenExpiring(token) &&... | DefaultTokenManager implements TokenManager { @Override public String getToken() { log.debug("DefaultTokenManager getToken()"); if (!checkCache()) { retrieveToken(); } if (token == null) { token = retrieveTokenFromCache(); } if (hasTokenExpired(token)) { token = retrieveTokenFromCache(); } if (isTokenExpiring(token) &&... | DefaultTokenManager implements TokenManager { @Override public String getToken() { log.debug("DefaultTokenManager getToken()"); if (!checkCache()) { retrieveToken(); } if (token == null) { token = retrieveTokenFromCache(); } if (hasTokenExpired(token)) { token = retrieveTokenFromCache(); } if (isTokenExpiring(token) &&... |
@Test(expected = Exception.class) public void shouldBubbleExceptionUpThroughSDK() { TokenProvider tokenProvider = null; defaultTokenManager = new DefaultTokenManager(tokenProvider); defaultTokenManager.getToken().equals("ProviderAccessToken"); } | @Override public String getToken() { log.debug("DefaultTokenManager getToken()"); if (!checkCache()) { retrieveToken(); } if (token == null) { token = retrieveTokenFromCache(); } if (hasTokenExpired(token)) { token = retrieveTokenFromCache(); } if (isTokenExpiring(token) && !isAsyncInProgress()) { if (null != token.get... | DefaultTokenManager implements TokenManager { @Override public String getToken() { log.debug("DefaultTokenManager getToken()"); if (!checkCache()) { retrieveToken(); } if (token == null) { token = retrieveTokenFromCache(); } if (hasTokenExpired(token)) { token = retrieveTokenFromCache(); } if (isTokenExpiring(token) &&... | DefaultTokenManager implements TokenManager { @Override public String getToken() { log.debug("DefaultTokenManager getToken()"); if (!checkCache()) { retrieveToken(); } if (token == null) { token = retrieveTokenFromCache(); } if (hasTokenExpired(token)) { token = retrieveTokenFromCache(); } if (isTokenExpiring(token) &&... | DefaultTokenManager implements TokenManager { @Override public String getToken() { log.debug("DefaultTokenManager getToken()"); if (!checkCache()) { retrieveToken(); } if (token == null) { token = retrieveTokenFromCache(); } if (hasTokenExpired(token)) { token = retrieveTokenFromCache(); } if (isTokenExpiring(token) &&... | DefaultTokenManager implements TokenManager { @Override public String getToken() { log.debug("DefaultTokenManager getToken()"); if (!checkCache()) { retrieveToken(); } if (token == null) { token = retrieveTokenFromCache(); } if (hasTokenExpired(token)) { token = retrieveTokenFromCache(); } if (isTokenExpiring(token) &&... |
@Test @Ignore public void shouldOnlyCallIAMOnceInMutliThreadForInitialToken() { TokenProvider tokenProviderMock = mock(TokenProvider.class); when(tokenProviderMock.retrieveToken()).thenReturn(token); defaultTokenManager = new DefaultTokenManager(tokenProviderMock); Thread t1 = new Thread(new ManagerThreadUtil(defaultTo... | protected synchronized void retrieveToken() { log.debug("OAuthTokenManager.retrieveToken"); if (token == null || (Long.valueOf(token.getExpiration()) < System.currentTimeMillis() / 1000L)) { log.debug("Token is null, retrieving initial token from provider"); boolean tokenRequest = true; int retryCount = 0; while (token... | DefaultTokenManager implements TokenManager { protected synchronized void retrieveToken() { log.debug("OAuthTokenManager.retrieveToken"); if (token == null || (Long.valueOf(token.getExpiration()) < System.currentTimeMillis() / 1000L)) { log.debug("Token is null, retrieving initial token from provider"); boolean tokenRe... | DefaultTokenManager implements TokenManager { protected synchronized void retrieveToken() { log.debug("OAuthTokenManager.retrieveToken"); if (token == null || (Long.valueOf(token.getExpiration()) < System.currentTimeMillis() / 1000L)) { log.debug("Token is null, retrieving initial token from provider"); boolean tokenRe... | DefaultTokenManager implements TokenManager { protected synchronized void retrieveToken() { log.debug("OAuthTokenManager.retrieveToken"); if (token == null || (Long.valueOf(token.getExpiration()) < System.currentTimeMillis() / 1000L)) { log.debug("Token is null, retrieving initial token from provider"); boolean tokenRe... | DefaultTokenManager implements TokenManager { protected synchronized void retrieveToken() { log.debug("OAuthTokenManager.retrieveToken"); if (token == null || (Long.valueOf(token.getExpiration()) < System.currentTimeMillis() / 1000L)) { log.debug("Token is null, retrieving initial token from provider"); boolean tokenRe... |
@Test(expected = OAuthServiceException.class) public void shouldHandleNullTokenWithCorrectExcpetion() { DefaultTokenManager defaultTokenManager = new DefaultTokenManager(new TokenProviderNull()); defaultTokenManager.getToken(); } | @Override public String getToken() { log.debug("DefaultTokenManager getToken()"); if (!checkCache()) { retrieveToken(); } if (token == null) { token = retrieveTokenFromCache(); } if (hasTokenExpired(token)) { token = retrieveTokenFromCache(); } if (isTokenExpiring(token) && !isAsyncInProgress()) { if (null != token.get... | DefaultTokenManager implements TokenManager { @Override public String getToken() { log.debug("DefaultTokenManager getToken()"); if (!checkCache()) { retrieveToken(); } if (token == null) { token = retrieveTokenFromCache(); } if (hasTokenExpired(token)) { token = retrieveTokenFromCache(); } if (isTokenExpiring(token) &&... | DefaultTokenManager implements TokenManager { @Override public String getToken() { log.debug("DefaultTokenManager getToken()"); if (!checkCache()) { retrieveToken(); } if (token == null) { token = retrieveTokenFromCache(); } if (hasTokenExpired(token)) { token = retrieveTokenFromCache(); } if (isTokenExpiring(token) &&... | DefaultTokenManager implements TokenManager { @Override public String getToken() { log.debug("DefaultTokenManager getToken()"); if (!checkCache()) { retrieveToken(); } if (token == null) { token = retrieveTokenFromCache(); } if (hasTokenExpired(token)) { token = retrieveTokenFromCache(); } if (isTokenExpiring(token) &&... | DefaultTokenManager implements TokenManager { @Override public String getToken() { log.debug("DefaultTokenManager getToken()"); if (!checkCache()) { retrieveToken(); } if (token == null) { token = retrieveTokenFromCache(); } if (hasTokenExpired(token)) { token = retrieveTokenFromCache(); } if (isTokenExpiring(token) &&... |
@Test public void shouldAddProxyToClient() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException{ HttpClientBuilder builder = HttpClientBuilder.create(); ClientConfiguration config = new ClientConfiguration().withProxyHost("127.0.0.1").withProxyPort(8080); HttpClientSettings s... | public static void addProxyConfig(HttpClientBuilder builder, HttpClientSettings settings) { if (settings.isProxyEnabled()) { log.info("Configuring Proxy. Proxy Host: " + settings.getProxyHost() + " " + "Proxy Port: " + settings.getProxyPort()); builder.setRoutePlanner(new SdkProxyRoutePlanner( settings.getProxyHost(), ... | DefaultTokenManager implements TokenManager { public static void addProxyConfig(HttpClientBuilder builder, HttpClientSettings settings) { if (settings.isProxyEnabled()) { log.info("Configuring Proxy. Proxy Host: " + settings.getProxyHost() + " " + "Proxy Port: " + settings.getProxyPort()); builder.setRoutePlanner(new S... | DefaultTokenManager implements TokenManager { public static void addProxyConfig(HttpClientBuilder builder, HttpClientSettings settings) { if (settings.isProxyEnabled()) { log.info("Configuring Proxy. Proxy Host: " + settings.getProxyHost() + " " + "Proxy Port: " + settings.getProxyPort()); builder.setRoutePlanner(new S... | DefaultTokenManager implements TokenManager { public static void addProxyConfig(HttpClientBuilder builder, HttpClientSettings settings) { if (settings.isProxyEnabled()) { log.info("Configuring Proxy. Proxy Host: " + settings.getProxyHost() + " " + "Proxy Port: " + settings.getProxyPort()); builder.setRoutePlanner(new S... | DefaultTokenManager implements TokenManager { public static void addProxyConfig(HttpClientBuilder builder, HttpClientSettings settings) { if (settings.isProxyEnabled()) { log.info("Configuring Proxy. Proxy Host: " + settings.getProxyHost() + " " + "Proxy Port: " + settings.getProxyPort()); builder.setRoutePlanner(new S... |
@Test public void shouldNotAddProxyToClient() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException{ HttpClientBuilder builder = HttpClientBuilder.create(); ClientConfiguration config = new ClientConfiguration(); HttpClientSettings settings = HttpClientSettings.adapt(config); ... | public static void addProxyConfig(HttpClientBuilder builder, HttpClientSettings settings) { if (settings.isProxyEnabled()) { log.info("Configuring Proxy. Proxy Host: " + settings.getProxyHost() + " " + "Proxy Port: " + settings.getProxyPort()); builder.setRoutePlanner(new SdkProxyRoutePlanner( settings.getProxyHost(), ... | DefaultTokenManager implements TokenManager { public static void addProxyConfig(HttpClientBuilder builder, HttpClientSettings settings) { if (settings.isProxyEnabled()) { log.info("Configuring Proxy. Proxy Host: " + settings.getProxyHost() + " " + "Proxy Port: " + settings.getProxyPort()); builder.setRoutePlanner(new S... | DefaultTokenManager implements TokenManager { public static void addProxyConfig(HttpClientBuilder builder, HttpClientSettings settings) { if (settings.isProxyEnabled()) { log.info("Configuring Proxy. Proxy Host: " + settings.getProxyHost() + " " + "Proxy Port: " + settings.getProxyPort()); builder.setRoutePlanner(new S... | DefaultTokenManager implements TokenManager { public static void addProxyConfig(HttpClientBuilder builder, HttpClientSettings settings) { if (settings.isProxyEnabled()) { log.info("Configuring Proxy. Proxy Host: " + settings.getProxyHost() + " " + "Proxy Port: " + settings.getProxyPort()); builder.setRoutePlanner(new S... | DefaultTokenManager implements TokenManager { public static void addProxyConfig(HttpClientBuilder builder, HttpClientSettings settings) { if (settings.isProxyEnabled()) { log.info("Configuring Proxy. Proxy Host: " + settings.getProxyHost() + " " + "Proxy Port: " + settings.getProxyPort()); builder.setRoutePlanner(new S... |
@Test public void testAsperaTransactionResume(){ transferListener = TransferListener.getInstance(xferId, null); AsperaTransfer asperaTransaction = new AsperaTransactionImpl(xferId, null, null, null, null, null); transferListener.transferReporter(xferId, msgQueued); transferListener.transferReporter(xferId, msgStats); a... | @Override public boolean resume() { return asperaFaspManagerWrapper.resume(xferid); } | AsperaTransactionImpl implements AsperaTransaction { @Override public boolean resume() { return asperaFaspManagerWrapper.resume(xferid); } } | AsperaTransactionImpl implements AsperaTransaction { @Override public boolean resume() { return asperaFaspManagerWrapper.resume(xferid); } AsperaTransactionImpl(String xferid, String bucketName, String key, String fileName, TransferProgress transferProgress, ProgressListenerChain listenerChain); } | AsperaTransactionImpl implements AsperaTransaction { @Override public boolean resume() { return asperaFaspManagerWrapper.resume(xferid); } AsperaTransactionImpl(String xferid, String bucketName, String key, String fileName, TransferProgress transferProgress, ProgressListenerChain listenerChain); @Override boolean pause... | AsperaTransactionImpl implements AsperaTransaction { @Override public boolean resume() { return asperaFaspManagerWrapper.resume(xferid); } AsperaTransactionImpl(String xferid, String bucketName, String key, String fileName, TransferProgress transferProgress, ProgressListenerChain listenerChain); @Override boolean pause... |
@Test public void shouldAddBearerToken() { request = MockRequestBuilder.create() .withContent(new ByteArrayInputStream("{\"TableName\": \"foo\"}".getBytes())) .withHeader("Host", "demo.us-east-1.amazonaws.com") .withHeader("x-amz-archive-description", "test test") .withPath("/") .withEndpoint("http: TokenProvider token... | @Override public void sign(SignableRequest<?> request, AWSCredentials credentials) { log.debug("++ OAuth signer"); IBMOAuthCredentials oAuthCreds = (IBMOAuthCredentials)credentials; if (oAuthCreds.getTokenManager() instanceof DefaultTokenManager) { DefaultTokenManager tokenManager = (DefaultTokenManager)oAuthCreds.getT... | IBMOAuthSigner extends AbstractAWSSigner { @Override public void sign(SignableRequest<?> request, AWSCredentials credentials) { log.debug("++ OAuth signer"); IBMOAuthCredentials oAuthCreds = (IBMOAuthCredentials)credentials; if (oAuthCreds.getTokenManager() instanceof DefaultTokenManager) { DefaultTokenManager tokenMan... | IBMOAuthSigner extends AbstractAWSSigner { @Override public void sign(SignableRequest<?> request, AWSCredentials credentials) { log.debug("++ OAuth signer"); IBMOAuthCredentials oAuthCreds = (IBMOAuthCredentials)credentials; if (oAuthCreds.getTokenManager() instanceof DefaultTokenManager) { DefaultTokenManager tokenMan... | IBMOAuthSigner extends AbstractAWSSigner { @Override public void sign(SignableRequest<?> request, AWSCredentials credentials) { log.debug("++ OAuth signer"); IBMOAuthCredentials oAuthCreds = (IBMOAuthCredentials)credentials; if (oAuthCreds.getTokenManager() instanceof DefaultTokenManager) { DefaultTokenManager tokenMan... | IBMOAuthSigner extends AbstractAWSSigner { @Override public void sign(SignableRequest<?> request, AWSCredentials credentials) { log.debug("++ OAuth signer"); IBMOAuthCredentials oAuthCreds = (IBMOAuthCredentials)credentials; if (oAuthCreds.getTokenManager() instanceof DefaultTokenManager) { DefaultTokenManager tokenMan... |
@Test public void constructorShouldAcceptTokenManager() { TokenManager tokenManger = new TokenManagerUtil(); IBMOAuthCredentials oAuthCreds = new BasicIBMOAuthCredentials(tokenManger); assertTrue(oAuthCreds.getTokenManager().getToken().equals("TokenManagerAccessToken")); } | @Override public TokenManager getTokenManager() { return tokenManager; } | BasicIBMOAuthCredentials implements IBMOAuthCredentials { @Override public TokenManager getTokenManager() { return tokenManager; } } | BasicIBMOAuthCredentials implements IBMOAuthCredentials { @Override public TokenManager getTokenManager() { return tokenManager; } BasicIBMOAuthCredentials(String apiKey, String serviceInstanceId); BasicIBMOAuthCredentials(TokenManager tokenManager); BasicIBMOAuthCredentials(TokenManager tokenManager, String serviceI... | BasicIBMOAuthCredentials implements IBMOAuthCredentials { @Override public TokenManager getTokenManager() { return tokenManager; } BasicIBMOAuthCredentials(String apiKey, String serviceInstanceId); BasicIBMOAuthCredentials(TokenManager tokenManager); BasicIBMOAuthCredentials(TokenManager tokenManager, String serviceI... | BasicIBMOAuthCredentials implements IBMOAuthCredentials { @Override public TokenManager getTokenManager() { return tokenManager; } BasicIBMOAuthCredentials(String apiKey, String serviceInstanceId); BasicIBMOAuthCredentials(TokenManager tokenManager); BasicIBMOAuthCredentials(TokenManager tokenManager, String serviceI... |
@Test public void constructorShouldAcceptTokenProvider() { TokenProvider tokenProvider = new TokenProviderUtil(); IBMOAuthCredentials oAuthCreds = new BasicIBMOAuthCredentials(tokenProvider); assertTrue(oAuthCreds.getTokenManager().getToken().equals("ProviderAccessToken")); } | @Override public TokenManager getTokenManager() { return tokenManager; } | BasicIBMOAuthCredentials implements IBMOAuthCredentials { @Override public TokenManager getTokenManager() { return tokenManager; } } | BasicIBMOAuthCredentials implements IBMOAuthCredentials { @Override public TokenManager getTokenManager() { return tokenManager; } BasicIBMOAuthCredentials(String apiKey, String serviceInstanceId); BasicIBMOAuthCredentials(TokenManager tokenManager); BasicIBMOAuthCredentials(TokenManager tokenManager, String serviceI... | BasicIBMOAuthCredentials implements IBMOAuthCredentials { @Override public TokenManager getTokenManager() { return tokenManager; } BasicIBMOAuthCredentials(String apiKey, String serviceInstanceId); BasicIBMOAuthCredentials(TokenManager tokenManager); BasicIBMOAuthCredentials(TokenManager tokenManager, String serviceI... | BasicIBMOAuthCredentials implements IBMOAuthCredentials { @Override public TokenManager getTokenManager() { return tokenManager; } BasicIBMOAuthCredentials(String apiKey, String serviceInstanceId); BasicIBMOAuthCredentials(TokenManager tokenManager); BasicIBMOAuthCredentials(TokenManager tokenManager, String serviceI... |
@Test public void testReusingLastProvider() throws Exception { MockCredentialsProvider provider1 = new MockCredentialsProvider(); provider1.throwException = true; MockCredentialsProvider provider2 = new MockCredentialsProvider(); AWSCredentialsProviderChain chain = new AWSCredentialsProviderChain(provider1, provider2);... | public AWSCredentials getCredentials() { if (reuseLastProvider && lastUsedProvider != null) { return lastUsedProvider.getCredentials(); } for (AWSCredentialsProvider provider : credentialsProviders) { try { AWSCredentials credentials = provider.getCredentials(); if (credentials instanceof IBMOAuthCredentials) { log.deb... | AWSCredentialsProviderChain implements AWSCredentialsProvider { public AWSCredentials getCredentials() { if (reuseLastProvider && lastUsedProvider != null) { return lastUsedProvider.getCredentials(); } for (AWSCredentialsProvider provider : credentialsProviders) { try { AWSCredentials credentials = provider.getCredenti... | AWSCredentialsProviderChain implements AWSCredentialsProvider { public AWSCredentials getCredentials() { if (reuseLastProvider && lastUsedProvider != null) { return lastUsedProvider.getCredentials(); } for (AWSCredentialsProvider provider : credentialsProviders) { try { AWSCredentials credentials = provider.getCredenti... | AWSCredentialsProviderChain implements AWSCredentialsProvider { public AWSCredentials getCredentials() { if (reuseLastProvider && lastUsedProvider != null) { return lastUsedProvider.getCredentials(); } for (AWSCredentialsProvider provider : credentialsProviders) { try { AWSCredentials credentials = provider.getCredenti... | AWSCredentialsProviderChain implements AWSCredentialsProvider { public AWSCredentials getCredentials() { if (reuseLastProvider && lastUsedProvider != null) { return lastUsedProvider.getCredentials(); } for (AWSCredentialsProvider provider : credentialsProviders) { try { AWSCredentials credentials = provider.getCredenti... |
@Test public void testHmac() { JsonCredentialsProvider provider = newProvider(); JsonCredentials credentials = (JsonCredentials) provider.getCredentials(); Assert.assertEquals("vaws_access_key_id", credentials.getAWSAccessKeyId()); Assert.assertEquals("vaws_secret_access_key", credentials.getAWSSecretKey()); Assert.ass... | @Override public AWSCredentials getCredentials() { if (jsonConfigFile == null) { synchronized (this) { if (jsonConfigFile == null) { jsonConfigFile = new JsonConfigFile(); lastRefreshed = System.nanoTime(); } } } long now = System.nanoTime(); long age = now - lastRefreshed; if (age > refreshForceIntervalNanos) { refres... | JsonCredentialsProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { if (jsonConfigFile == null) { synchronized (this) { if (jsonConfigFile == null) { jsonConfigFile = new JsonConfigFile(); lastRefreshed = System.nanoTime(); } } } long now = System.nanoTime(); long age = now - ... | JsonCredentialsProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { if (jsonConfigFile == null) { synchronized (this) { if (jsonConfigFile == null) { jsonConfigFile = new JsonConfigFile(); lastRefreshed = System.nanoTime(); } } } long now = System.nanoTime(); long age = now - ... | JsonCredentialsProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { if (jsonConfigFile == null) { synchronized (this) { if (jsonConfigFile == null) { jsonConfigFile = new JsonConfigFile(); lastRefreshed = System.nanoTime(); } } } long now = System.nanoTime(); long age = now - ... | JsonCredentialsProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { if (jsonConfigFile == null) { synchronized (this) { if (jsonConfigFile == null) { jsonConfigFile = new JsonConfigFile(); lastRefreshed = System.nanoTime(); } } } long now = System.nanoTime(); long age = now - ... |
@Test public void testRefresh() throws Exception { File modifiable = File.createTempFile("UpdatableCredentials", ".json"); copyFile(JsonResourceLoader.basicCredentials().asFile(), modifiable); JsonCredentialsProvider testProvider = new JsonCredentialsProvider(modifiable.getPath()); JsonCredentials credentials = (JsonCr... | @Override public void refresh() { if (jsonConfigFile != null) { jsonConfigFile.refresh(); lastRefreshed = System.nanoTime(); } } | JsonCredentialsProvider implements AWSCredentialsProvider { @Override public void refresh() { if (jsonConfigFile != null) { jsonConfigFile.refresh(); lastRefreshed = System.nanoTime(); } } } | JsonCredentialsProvider implements AWSCredentialsProvider { @Override public void refresh() { if (jsonConfigFile != null) { jsonConfigFile.refresh(); lastRefreshed = System.nanoTime(); } } JsonCredentialsProvider(); JsonCredentialsProvider(String jsonConfigFilePath); JsonCredentialsProvider(JsonConfigFile jsonConfigF... | JsonCredentialsProvider implements AWSCredentialsProvider { @Override public void refresh() { if (jsonConfigFile != null) { jsonConfigFile.refresh(); lastRefreshed = System.nanoTime(); } } JsonCredentialsProvider(); JsonCredentialsProvider(String jsonConfigFilePath); JsonCredentialsProvider(JsonConfigFile jsonConfigF... | JsonCredentialsProvider implements AWSCredentialsProvider { @Override public void refresh() { if (jsonConfigFile != null) { jsonConfigFile.refresh(); lastRefreshed = System.nanoTime(); } } JsonCredentialsProvider(); JsonCredentialsProvider(String jsonConfigFilePath); JsonCredentialsProvider(JsonConfigFile jsonConfigF... |
@Test (expected = AmazonClientException.class) public void testEnvVariableNotSet() { ContainerCredentialsProvider credentialsProvider = new ContainerCredentialsProvider(); credentialsProvider.getCredentials(); } | @Override public AWSCredentials getCredentials() { return credentialsFetcher.getCredentials(); } | ContainerCredentialsProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { return credentialsFetcher.getCredentials(); } } | ContainerCredentialsProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { return credentialsFetcher.getCredentials(); } ContainerCredentialsProvider(); @SdkInternalApi ContainerCredentialsProvider(CredentialsEndpointProvider credentailsEndpointProvider); } | ContainerCredentialsProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { return credentialsFetcher.getCredentials(); } ContainerCredentialsProvider(); @SdkInternalApi ContainerCredentialsProvider(CredentialsEndpointProvider credentailsEndpointProvider); @Override AWSCredentia... | ContainerCredentialsProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { return credentialsFetcher.getCredentials(); } ContainerCredentialsProvider(); @SdkInternalApi ContainerCredentialsProvider(CredentialsEndpointProvider credentailsEndpointProvider); @Override AWSCredentia... |
@Test public void getCredentialsWithCorruptResponseDoesNotIncludeCredentialsInExceptionMessage() { stubForCorruptedSuccessResponse(); try { containerCredentialsProvider.getCredentials(); Assert.fail(); } catch (Exception e) { String stackTrace = ExceptionUtils.getStackTrace(e); Assert.assertFalse(stackTrace.contains("A... | @Override public AWSCredentials getCredentials() { return credentialsFetcher.getCredentials(); } | ContainerCredentialsProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { return credentialsFetcher.getCredentials(); } } | ContainerCredentialsProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { return credentialsFetcher.getCredentials(); } ContainerCredentialsProvider(); @SdkInternalApi ContainerCredentialsProvider(CredentialsEndpointProvider credentailsEndpointProvider); } | ContainerCredentialsProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { return credentialsFetcher.getCredentials(); } ContainerCredentialsProvider(); @SdkInternalApi ContainerCredentialsProvider(CredentialsEndpointProvider credentailsEndpointProvider); @Override AWSCredentia... | ContainerCredentialsProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { return credentialsFetcher.getCredentials(); } ContainerCredentialsProvider(); @SdkInternalApi ContainerCredentialsProvider(CredentialsEndpointProvider credentailsEndpointProvider); @Override AWSCredentia... |
@Test public void testGetCredentialsThrowsAceFor404ErrorResponse() { stubForErrorResponse(404); try { containerCredentialsProvider.getCredentials(); fail("The test should throw an exception"); } catch (AmazonClientException exception) { assertNotNull(exception.getMessage()); } } | @Override public AWSCredentials getCredentials() { return credentialsFetcher.getCredentials(); } | ContainerCredentialsProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { return credentialsFetcher.getCredentials(); } } | ContainerCredentialsProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { return credentialsFetcher.getCredentials(); } ContainerCredentialsProvider(); @SdkInternalApi ContainerCredentialsProvider(CredentialsEndpointProvider credentailsEndpointProvider); } | ContainerCredentialsProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { return credentialsFetcher.getCredentials(); } ContainerCredentialsProvider(); @SdkInternalApi ContainerCredentialsProvider(CredentialsEndpointProvider credentailsEndpointProvider); @Override AWSCredentia... | ContainerCredentialsProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { return credentialsFetcher.getCredentials(); } ContainerCredentialsProvider(); @SdkInternalApi ContainerCredentialsProvider(CredentialsEndpointProvider credentailsEndpointProvider); @Override AWSCredentia... |
@Test public void testGetCredentialsThrowsAseForNon200AndNon404ErrorResponse() { stubForErrorResponse(401); try { containerCredentialsProvider.getCredentials(); fail("The test should have thrown an exception"); } catch (AmazonServiceException exception) { assertEquals(401, exception.getStatusCode()); assertNotNull(exce... | @Override public AWSCredentials getCredentials() { return credentialsFetcher.getCredentials(); } | ContainerCredentialsProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { return credentialsFetcher.getCredentials(); } } | ContainerCredentialsProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { return credentialsFetcher.getCredentials(); } ContainerCredentialsProvider(); @SdkInternalApi ContainerCredentialsProvider(CredentialsEndpointProvider credentailsEndpointProvider); } | ContainerCredentialsProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { return credentialsFetcher.getCredentials(); } ContainerCredentialsProvider(); @SdkInternalApi ContainerCredentialsProvider(CredentialsEndpointProvider credentailsEndpointProvider); @Override AWSCredentia... | ContainerCredentialsProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { return credentialsFetcher.getCredentials(); } ContainerCredentialsProvider(); @SdkInternalApi ContainerCredentialsProvider(CredentialsEndpointProvider credentailsEndpointProvider); @Override AWSCredentia... |
@Test public void testAsperaTransactionCancel(){ transferListener = TransferListener.getInstance(xferId, null); AsperaTransfer asperaTransaction = new AsperaTransactionImpl(xferId, null, null, null, null, null); transferListener.transferReporter(xferId, msgQueued); transferListener.transferReporter(xferId, msgStats); a... | @Override public boolean cancel() { if (asperaFaspManagerWrapper.cancel(xferid)) { transferListener.removeAllTransactionSessions(xferid); return true; } else { return false; } } | AsperaTransactionImpl implements AsperaTransaction { @Override public boolean cancel() { if (asperaFaspManagerWrapper.cancel(xferid)) { transferListener.removeAllTransactionSessions(xferid); return true; } else { return false; } } } | AsperaTransactionImpl implements AsperaTransaction { @Override public boolean cancel() { if (asperaFaspManagerWrapper.cancel(xferid)) { transferListener.removeAllTransactionSessions(xferid); return true; } else { return false; } } AsperaTransactionImpl(String xferid, String bucketName, String key, String fileName, Tran... | AsperaTransactionImpl implements AsperaTransaction { @Override public boolean cancel() { if (asperaFaspManagerWrapper.cancel(xferid)) { transferListener.removeAllTransactionSessions(xferid); return true; } else { return false; } } AsperaTransactionImpl(String xferid, String bucketName, String key, String fileName, Tran... | AsperaTransactionImpl implements AsperaTransaction { @Override public boolean cancel() { if (asperaFaspManagerWrapper.cancel(xferid)) { transferListener.removeAllTransactionSessions(xferid); return true; } else { return false; } } AsperaTransactionImpl(String xferid, String bucketName, String key, String fileName, Tran... |
@Test public void testNoMetadataService() throws Exception { stubForErrorResponse(); TestCredentialsProvider credentialsProvider = new TestCredentialsProvider(); try { credentialsProvider.getCredentials(); fail("Expected an AmazonClientException, but wasn't thrown"); } catch (AmazonClientException ace) { assertNotNull(... | @Override public String toString() { return "ContainerCredentialsFetcher"; } | ContainerCredentialsFetcher extends BaseCredentialsFetcher { @Override public String toString() { return "ContainerCredentialsFetcher"; } } | ContainerCredentialsFetcher extends BaseCredentialsFetcher { @Override public String toString() { return "ContainerCredentialsFetcher"; } ContainerCredentialsFetcher(CredentialsEndpointProvider credentialsEndpointProvider); } | ContainerCredentialsFetcher extends BaseCredentialsFetcher { @Override public String toString() { return "ContainerCredentialsFetcher"; } ContainerCredentialsFetcher(CredentialsEndpointProvider credentialsEndpointProvider); @Override String toString(); } | ContainerCredentialsFetcher extends BaseCredentialsFetcher { @Override public String toString() { return "ContainerCredentialsFetcher"; } ContainerCredentialsFetcher(CredentialsEndpointProvider credentialsEndpointProvider); @Override String toString(); } |
@Test public void emptyClient() { AmazonWebServiceClient client = new AmazonWebServiceClient(new ClientConfiguration()) { }; try { client.getServiceName(); } catch (IllegalStateException exception) { } } | public String getServiceName() { return getServiceNameIntern(); } | AmazonWebServiceClient { public String getServiceName() { return getServiceNameIntern(); } } | AmazonWebServiceClient { public String getServiceName() { return getServiceNameIntern(); } AmazonWebServiceClient(ClientConfiguration clientConfiguration); AmazonWebServiceClient(ClientConfiguration clientConfiguration,
RequestMetricCollector requestMetricCollector); @SdkProtectedApi protected AmazonWebSe... | AmazonWebServiceClient { public String getServiceName() { return getServiceNameIntern(); } AmazonWebServiceClient(ClientConfiguration clientConfiguration); AmazonWebServiceClient(ClientConfiguration clientConfiguration,
RequestMetricCollector requestMetricCollector); @SdkProtectedApi protected AmazonWebSe... | AmazonWebServiceClient { public String getServiceName() { return getServiceNameIntern(); } AmazonWebServiceClient(ClientConfiguration clientConfiguration); AmazonWebServiceClient(ClientConfiguration clientConfiguration,
RequestMetricCollector requestMetricCollector); @SdkProtectedApi protected AmazonWebSe... |
@Test public void testOverrideSigner() { ClientConfiguration config = new ClientConfiguration(); config.setSignerOverride("QueryStringSignerType"); AmazonTestClient client = new AmazonTestClient(config); Assert.assertTrue(client.getSigner() instanceof QueryStringSigner); } | @Deprecated protected Signer getSigner() { return signerProvider.getSigner(SignerProviderContext.builder().build()); } | AmazonWebServiceClient { @Deprecated protected Signer getSigner() { return signerProvider.getSigner(SignerProviderContext.builder().build()); } } | AmazonWebServiceClient { @Deprecated protected Signer getSigner() { return signerProvider.getSigner(SignerProviderContext.builder().build()); } AmazonWebServiceClient(ClientConfiguration clientConfiguration); AmazonWebServiceClient(ClientConfiguration clientConfiguration,
RequestMetricCollector requestMetr... | AmazonWebServiceClient { @Deprecated protected Signer getSigner() { return signerProvider.getSigner(SignerProviderContext.builder().build()); } AmazonWebServiceClient(ClientConfiguration clientConfiguration); AmazonWebServiceClient(ClientConfiguration clientConfiguration,
RequestMetricCollector requestMetr... | AmazonWebServiceClient { @Deprecated protected Signer getSigner() { return signerProvider.getSigner(SignerProviderContext.builder().build()); } AmazonWebServiceClient(ClientConfiguration clientConfiguration); AmazonWebServiceClient(ClientConfiguration clientConfiguration,
RequestMetricCollector requestMetr... |
@Test public void setServiceNameIntern() { AmazonTestClient client = new AmazonTestClient(); assertEquals(client.getServiceName(), client.getServiceNameIntern()); String serviceNameOverride = "foo"; assertFalse(serviceNameOverride.equals(client.getServiceName())); client.setServiceNameIntern(serviceNameOverride); asser... | public final void setServiceNameIntern(String serviceName) { if (serviceName == null) throw new IllegalArgumentException( "The parameter serviceName must be specified!"); this.serviceName = serviceName; } | AmazonWebServiceClient { public final void setServiceNameIntern(String serviceName) { if (serviceName == null) throw new IllegalArgumentException( "The parameter serviceName must be specified!"); this.serviceName = serviceName; } } | AmazonWebServiceClient { public final void setServiceNameIntern(String serviceName) { if (serviceName == null) throw new IllegalArgumentException( "The parameter serviceName must be specified!"); this.serviceName = serviceName; } AmazonWebServiceClient(ClientConfiguration clientConfiguration); AmazonWebServiceClient(C... | AmazonWebServiceClient { public final void setServiceNameIntern(String serviceName) { if (serviceName == null) throw new IllegalArgumentException( "The parameter serviceName must be specified!"); this.serviceName = serviceName; } AmazonWebServiceClient(ClientConfiguration clientConfiguration); AmazonWebServiceClient(C... | AmazonWebServiceClient { public final void setServiceNameIntern(String serviceName) { if (serviceName == null) throw new IllegalArgumentException( "The parameter serviceName must be specified!"); this.serviceName = serviceName; } AmazonWebServiceClient(ClientConfiguration clientConfiguration); AmazonWebServiceClient(C... |
@Test public void setEndpointPrefix() { AmazonTestClient client = new AmazonTestClient(); Assert.assertEquals(client.getServiceName(), client.getEndpointPrefix()); String endpointPrefixOverride = "foo"; Assert.assertNotEquals(endpointPrefixOverride, client.getServiceName()); client.setEndpointPrefix(endpointPrefixOverr... | protected void setEndpointPrefix(String endpointPrefix) { if (endpointPrefix == null) { throw new IllegalArgumentException( "The parameter endpointPrefix must be specified!"); } this.endpointPrefix = endpointPrefix; } | AmazonWebServiceClient { protected void setEndpointPrefix(String endpointPrefix) { if (endpointPrefix == null) { throw new IllegalArgumentException( "The parameter endpointPrefix must be specified!"); } this.endpointPrefix = endpointPrefix; } } | AmazonWebServiceClient { protected void setEndpointPrefix(String endpointPrefix) { if (endpointPrefix == null) { throw new IllegalArgumentException( "The parameter endpointPrefix must be specified!"); } this.endpointPrefix = endpointPrefix; } AmazonWebServiceClient(ClientConfiguration clientConfiguration); AmazonWebSe... | AmazonWebServiceClient { protected void setEndpointPrefix(String endpointPrefix) { if (endpointPrefix == null) { throw new IllegalArgumentException( "The parameter endpointPrefix must be specified!"); } this.endpointPrefix = endpointPrefix; } AmazonWebServiceClient(ClientConfiguration clientConfiguration); AmazonWebSe... | AmazonWebServiceClient { protected void setEndpointPrefix(String endpointPrefix) { if (endpointPrefix == null) { throw new IllegalArgumentException( "The parameter endpointPrefix must be specified!"); } this.endpointPrefix = endpointPrefix; } AmazonWebServiceClient(ClientConfiguration clientConfiguration); AmazonWebSe... |
@Test public void connectionManagersAreUnregisteredFromIdleConnectionReaper() { IdleConnectionReaper.shutdown(); for (int count = 0; count < 100; count++) { new AmazonWebServiceClient(new ClientConfiguration()) { }.shutdown(); } assertEquals(0, IdleConnectionReaper.getRegisteredConnectionManagers().size()); } | public void shutdown() { client.shutdown(); } | AmazonWebServiceClient { public void shutdown() { client.shutdown(); } } | AmazonWebServiceClient { public void shutdown() { client.shutdown(); } AmazonWebServiceClient(ClientConfiguration clientConfiguration); AmazonWebServiceClient(ClientConfiguration clientConfiguration,
RequestMetricCollector requestMetricCollector); @SdkProtectedApi protected AmazonWebServiceClient(ClientCo... | AmazonWebServiceClient { public void shutdown() { client.shutdown(); } AmazonWebServiceClient(ClientConfiguration clientConfiguration); AmazonWebServiceClient(ClientConfiguration clientConfiguration,
RequestMetricCollector requestMetricCollector); @SdkProtectedApi protected AmazonWebServiceClient(ClientCo... | AmazonWebServiceClient { public void shutdown() { client.shutdown(); } AmazonWebServiceClient(ClientConfiguration clientConfiguration); AmazonWebServiceClient(ClientConfiguration clientConfiguration,
RequestMetricCollector requestMetricCollector); @SdkProtectedApi protected AmazonWebServiceClient(ClientCo... |
@Test public void testNullKPHeadersAreHandled() throws Exception { Unmarshaller<ObjectListing, InputStream> unmarshaller = new Unmarshallers.ListObjectsUnmarshaller(false); S3XmlResponseHandler xmlResponseHandler = new S3XmlResponseHandler<ObjectListing>(unmarshaller); HttpResponse httpResponse = new HttpResponse(null,... | public AmazonWebServiceResponse<T> handle(HttpResponse response) throws Exception { AmazonWebServiceResponse<T> awsResponse = parseResponseMetadata(response); responseHeaders = response.getHeaders(); if (responseUnmarshaller != null) { log.trace("Beginning to parse service response XML"); T result = responseUnmarshalle... | S3XmlResponseHandler extends AbstractS3ResponseHandler<T> { public AmazonWebServiceResponse<T> handle(HttpResponse response) throws Exception { AmazonWebServiceResponse<T> awsResponse = parseResponseMetadata(response); responseHeaders = response.getHeaders(); if (responseUnmarshaller != null) { log.trace("Beginning to ... | S3XmlResponseHandler extends AbstractS3ResponseHandler<T> { public AmazonWebServiceResponse<T> handle(HttpResponse response) throws Exception { AmazonWebServiceResponse<T> awsResponse = parseResponseMetadata(response); responseHeaders = response.getHeaders(); if (responseUnmarshaller != null) { log.trace("Beginning to ... | S3XmlResponseHandler extends AbstractS3ResponseHandler<T> { public AmazonWebServiceResponse<T> handle(HttpResponse response) throws Exception { AmazonWebServiceResponse<T> awsResponse = parseResponseMetadata(response); responseHeaders = response.getHeaders(); if (responseUnmarshaller != null) { log.trace("Beginning to ... | S3XmlResponseHandler extends AbstractS3ResponseHandler<T> { public AmazonWebServiceResponse<T> handle(HttpResponse response) throws Exception { AmazonWebServiceResponse<T> awsResponse = parseResponseMetadata(response); responseHeaders = response.getHeaders(); if (responseUnmarshaller != null) { log.trace("Beginning to ... |
@Test public void testEmptyKPHeadersAreHandled() throws Exception { Unmarshaller<ObjectListing, InputStream> unmarshaller = new Unmarshallers.ListObjectsUnmarshaller(false); S3XmlResponseHandler xmlResponseHandler = new S3XmlResponseHandler<ObjectListing>(unmarshaller); HttpResponse httpResponse = new HttpResponse(null... | public AmazonWebServiceResponse<T> handle(HttpResponse response) throws Exception { AmazonWebServiceResponse<T> awsResponse = parseResponseMetadata(response); responseHeaders = response.getHeaders(); if (responseUnmarshaller != null) { log.trace("Beginning to parse service response XML"); T result = responseUnmarshalle... | S3XmlResponseHandler extends AbstractS3ResponseHandler<T> { public AmazonWebServiceResponse<T> handle(HttpResponse response) throws Exception { AmazonWebServiceResponse<T> awsResponse = parseResponseMetadata(response); responseHeaders = response.getHeaders(); if (responseUnmarshaller != null) { log.trace("Beginning to ... | S3XmlResponseHandler extends AbstractS3ResponseHandler<T> { public AmazonWebServiceResponse<T> handle(HttpResponse response) throws Exception { AmazonWebServiceResponse<T> awsResponse = parseResponseMetadata(response); responseHeaders = response.getHeaders(); if (responseUnmarshaller != null) { log.trace("Beginning to ... | S3XmlResponseHandler extends AbstractS3ResponseHandler<T> { public AmazonWebServiceResponse<T> handle(HttpResponse response) throws Exception { AmazonWebServiceResponse<T> awsResponse = parseResponseMetadata(response); responseHeaders = response.getHeaders(); if (responseUnmarshaller != null) { log.trace("Beginning to ... | S3XmlResponseHandler extends AbstractS3ResponseHandler<T> { public AmazonWebServiceResponse<T> handle(HttpResponse response) throws Exception { AmazonWebServiceResponse<T> awsResponse = parseResponseMetadata(response); responseHeaders = response.getHeaders(); if (responseUnmarshaller != null) { log.trace("Beginning to ... |
@Test public void testDelegatingDnsResolverCallsResolveOnDelegate() throws Exception { final AtomicInteger timesCalled = new AtomicInteger(); DnsResolver delegate = new DnsResolver() { @Override public InetAddress[] resolve(String host) throws UnknownHostException { timesCalled.incrementAndGet(); return new InetAddress... | @Override public InetAddress[] resolve(String host) throws UnknownHostException { return delegate.resolve(host); } | DelegatingDnsResolver implements DnsResolver { @Override public InetAddress[] resolve(String host) throws UnknownHostException { return delegate.resolve(host); } } | DelegatingDnsResolver implements DnsResolver { @Override public InetAddress[] resolve(String host) throws UnknownHostException { return delegate.resolve(host); } DelegatingDnsResolver(com.ibm.cloud.objectstorage.DnsResolver delegate); } | DelegatingDnsResolver implements DnsResolver { @Override public InetAddress[] resolve(String host) throws UnknownHostException { return delegate.resolve(host); } DelegatingDnsResolver(com.ibm.cloud.objectstorage.DnsResolver delegate); @Override InetAddress[] resolve(String host); } | DelegatingDnsResolver implements DnsResolver { @Override public InetAddress[] resolve(String host) throws UnknownHostException { return delegate.resolve(host); } DelegatingDnsResolver(com.ibm.cloud.objectstorage.DnsResolver delegate); @Override InetAddress[] resolve(String host); } |
@Test public void testOnlyKPEnabledHeaderIsSet() throws Exception { Unmarshaller<ObjectListing, InputStream> unmarshaller = new Unmarshallers.ListObjectsUnmarshaller(false); S3XmlResponseHandler xmlResponseHandler = new S3XmlResponseHandler<ObjectListing>(unmarshaller); HttpResponse httpResponse = new HttpResponse(null... | public AmazonWebServiceResponse<T> handle(HttpResponse response) throws Exception { AmazonWebServiceResponse<T> awsResponse = parseResponseMetadata(response); responseHeaders = response.getHeaders(); if (responseUnmarshaller != null) { log.trace("Beginning to parse service response XML"); T result = responseUnmarshalle... | S3XmlResponseHandler extends AbstractS3ResponseHandler<T> { public AmazonWebServiceResponse<T> handle(HttpResponse response) throws Exception { AmazonWebServiceResponse<T> awsResponse = parseResponseMetadata(response); responseHeaders = response.getHeaders(); if (responseUnmarshaller != null) { log.trace("Beginning to ... | S3XmlResponseHandler extends AbstractS3ResponseHandler<T> { public AmazonWebServiceResponse<T> handle(HttpResponse response) throws Exception { AmazonWebServiceResponse<T> awsResponse = parseResponseMetadata(response); responseHeaders = response.getHeaders(); if (responseUnmarshaller != null) { log.trace("Beginning to ... | S3XmlResponseHandler extends AbstractS3ResponseHandler<T> { public AmazonWebServiceResponse<T> handle(HttpResponse response) throws Exception { AmazonWebServiceResponse<T> awsResponse = parseResponseMetadata(response); responseHeaders = response.getHeaders(); if (responseUnmarshaller != null) { log.trace("Beginning to ... | S3XmlResponseHandler extends AbstractS3ResponseHandler<T> { public AmazonWebServiceResponse<T> handle(HttpResponse response) throws Exception { AmazonWebServiceResponse<T> awsResponse = parseResponseMetadata(response); responseHeaders = response.getHeaders(); if (responseUnmarshaller != null) { log.trace("Beginning to ... |
@Test public void testOnlyCRKHeaderIsSet() throws Exception { Unmarshaller<ObjectListing, InputStream> unmarshaller = new Unmarshallers.ListObjectsUnmarshaller(false); S3XmlResponseHandler xmlResponseHandler = new S3XmlResponseHandler<ObjectListing>(unmarshaller); HttpResponse httpResponse = new HttpResponse(null, null... | public AmazonWebServiceResponse<T> handle(HttpResponse response) throws Exception { AmazonWebServiceResponse<T> awsResponse = parseResponseMetadata(response); responseHeaders = response.getHeaders(); if (responseUnmarshaller != null) { log.trace("Beginning to parse service response XML"); T result = responseUnmarshalle... | S3XmlResponseHandler extends AbstractS3ResponseHandler<T> { public AmazonWebServiceResponse<T> handle(HttpResponse response) throws Exception { AmazonWebServiceResponse<T> awsResponse = parseResponseMetadata(response); responseHeaders = response.getHeaders(); if (responseUnmarshaller != null) { log.trace("Beginning to ... | S3XmlResponseHandler extends AbstractS3ResponseHandler<T> { public AmazonWebServiceResponse<T> handle(HttpResponse response) throws Exception { AmazonWebServiceResponse<T> awsResponse = parseResponseMetadata(response); responseHeaders = response.getHeaders(); if (responseUnmarshaller != null) { log.trace("Beginning to ... | S3XmlResponseHandler extends AbstractS3ResponseHandler<T> { public AmazonWebServiceResponse<T> handle(HttpResponse response) throws Exception { AmazonWebServiceResponse<T> awsResponse = parseResponseMetadata(response); responseHeaders = response.getHeaders(); if (responseUnmarshaller != null) { log.trace("Beginning to ... | S3XmlResponseHandler extends AbstractS3ResponseHandler<T> { public AmazonWebServiceResponse<T> handle(HttpResponse response) throws Exception { AmazonWebServiceResponse<T> awsResponse = parseResponseMetadata(response); responseHeaders = response.getHeaders(); if (responseUnmarshaller != null) { log.trace("Beginning to ... |
@Test public void testReportFailureIsCalled() throws Exception{ UploadMonitor monitor = mock(UploadMonitor.class); CompleteMultipartUpload completeMultipartCopy = new CompleteMultipartUpload(null, null, null, null, null, null, monitor); try{ completeMultipartCopy.call(); } catch (Exception e){ } verify(monitor, times(1... | @Override public UploadResult call() throws Exception { CompleteMultipartUploadResult res; try { CompleteMultipartUploadRequest req = new CompleteMultipartUploadRequest( origReq.getBucketName(), origReq.getKey(), uploadId, collectPartETags()) .withRequesterPays(origReq.isRequesterPays()) .withGeneralProgressListener(or... | CompleteMultipartUpload implements Callable<UploadResult> { @Override public UploadResult call() throws Exception { CompleteMultipartUploadResult res; try { CompleteMultipartUploadRequest req = new CompleteMultipartUploadRequest( origReq.getBucketName(), origReq.getKey(), uploadId, collectPartETags()) .withRequesterPay... | CompleteMultipartUpload implements Callable<UploadResult> { @Override public UploadResult call() throws Exception { CompleteMultipartUploadResult res; try { CompleteMultipartUploadRequest req = new CompleteMultipartUploadRequest( origReq.getBucketName(), origReq.getKey(), uploadId, collectPartETags()) .withRequesterPay... | CompleteMultipartUpload implements Callable<UploadResult> { @Override public UploadResult call() throws Exception { CompleteMultipartUploadResult res; try { CompleteMultipartUploadRequest req = new CompleteMultipartUploadRequest( origReq.getBucketName(), origReq.getKey(), uploadId, collectPartETags()) .withRequesterPay... | CompleteMultipartUpload implements Callable<UploadResult> { @Override public UploadResult call() throws Exception { CompleteMultipartUploadResult res; try { CompleteMultipartUploadRequest req = new CompleteMultipartUploadRequest( origReq.getBucketName(), origReq.getKey(), uploadId, collectPartETags()) .withRequesterPay... |
@Test public void testReportFailureIsCalled() throws Exception{ CopyMonitor monitor = mock(CopyMonitor.class); CompleteMultipartCopy completeMultipartCopy = new CompleteMultipartCopy(null, null, null, null, null, monitor); try{ completeMultipartCopy.call(); } catch (Exception e){ } verify(monitor, times(1)).reportFailu... | @Override public CopyResult call() throws Exception { CompleteMultipartUploadResult res; try { CompleteMultipartUploadRequest req = new CompleteMultipartUploadRequest( origReq.getDestinationBucketName(), origReq.getDestinationKey(), uploadId, collectPartETags()) .withRequesterPays(origReq.isRequesterPays()) .withGenera... | CompleteMultipartCopy implements Callable<CopyResult> { @Override public CopyResult call() throws Exception { CompleteMultipartUploadResult res; try { CompleteMultipartUploadRequest req = new CompleteMultipartUploadRequest( origReq.getDestinationBucketName(), origReq.getDestinationKey(), uploadId, collectPartETags()) .... | CompleteMultipartCopy implements Callable<CopyResult> { @Override public CopyResult call() throws Exception { CompleteMultipartUploadResult res; try { CompleteMultipartUploadRequest req = new CompleteMultipartUploadRequest( origReq.getDestinationBucketName(), origReq.getDestinationKey(), uploadId, collectPartETags()) .... | CompleteMultipartCopy implements Callable<CopyResult> { @Override public CopyResult call() throws Exception { CompleteMultipartUploadResult res; try { CompleteMultipartUploadRequest req = new CompleteMultipartUploadRequest( origReq.getDestinationBucketName(), origReq.getDestinationKey(), uploadId, collectPartETags()) .... | CompleteMultipartCopy implements Callable<CopyResult> { @Override public CopyResult call() throws Exception { CompleteMultipartUploadResult res; try { CompleteMultipartUploadRequest req = new CompleteMultipartUploadRequest( origReq.getDestinationBucketName(), origReq.getDestinationKey(), uploadId, collectPartETags()) .... |
@Test public void testRouteSimilarity() { String[] urls = new String[]{ "navigation/view1", "navigation/view2", "navigation/view3", "navigation/view4", "navigation/view5", "navigation/view6", "navigation/view7", "navigation/view8", "navigation/view9", "navigation" }; String currentRoutePart = "navigation"; RouteSimilar... | public RouteSimilarity(RouteData routeData, String currentRoute) { this.route = routeData.getNavigationTarget(); this.routeData = routeData; int urlSimilarity = calculateSimilarity(routeData.getUrl(), currentRoute); int routeAliasSimilarity = routeData.getRouteAliases().stream().map(routeAliasData -> calculateSimilarit... | RouteSimilarity { public RouteSimilarity(RouteData routeData, String currentRoute) { this.route = routeData.getNavigationTarget(); this.routeData = routeData; int urlSimilarity = calculateSimilarity(routeData.getUrl(), currentRoute); int routeAliasSimilarity = routeData.getRouteAliases().stream().map(routeAliasData -> ... | RouteSimilarity { public RouteSimilarity(RouteData routeData, String currentRoute) { this.route = routeData.getNavigationTarget(); this.routeData = routeData; int urlSimilarity = calculateSimilarity(routeData.getUrl(), currentRoute); int routeAliasSimilarity = routeData.getRouteAliases().stream().map(routeAliasData -> ... | RouteSimilarity { public RouteSimilarity(RouteData routeData, String currentRoute) { this.route = routeData.getNavigationTarget(); this.routeData = routeData; int urlSimilarity = calculateSimilarity(routeData.getUrl(), currentRoute); int routeAliasSimilarity = routeData.getRouteAliases().stream().map(routeAliasData -> ... | RouteSimilarity { public RouteSimilarity(RouteData routeData, String currentRoute) { this.route = routeData.getNavigationTarget(); this.routeData = routeData; int urlSimilarity = calculateSimilarity(routeData.getUrl(), currentRoute); int routeAliasSimilarity = routeData.getRouteAliases().stream().map(routeAliasData -> ... |
@Test public void testRouteSimilarity2() { String[] urls = new String[]{ "view1", "view2", "view3", "view4", "view5", "view6", "view7", "view8", "view9", "" }; String currentRoutePart = ""; RouteSimilarity r = Arrays.stream(urls) .map(s -> new RouteSimilarity(currentRoutePart, s)) .max(Comparator.comparingInt(RouteSimi... | public String getRouteString() { return routeString; } | RouteSimilarity { public String getRouteString() { return routeString; } } | RouteSimilarity { public String getRouteString() { return routeString; } RouteSimilarity(RouteData routeData, String currentRoute); RouteSimilarity(String url, String currentRouteParts); } | RouteSimilarity { public String getRouteString() { return routeString; } RouteSimilarity(RouteData routeData, String currentRoute); RouteSimilarity(String url, String currentRouteParts); RouteData getRouteData(); Class<? extends Component> getRoute(); String getRouteString(); int getSimilarity(); } | RouteSimilarity { public String getRouteString() { return routeString; } RouteSimilarity(RouteData routeData, String currentRoute); RouteSimilarity(String url, String currentRouteParts); RouteData getRouteData(); Class<? extends Component> getRoute(); String getRouteString(); int getSimilarity(); } |
@Test public void testRouteSimilarity3() { String[] urls = new String[]{ "navigation/view2", "navigation2/view1", "navigation/view1", "navigation/view4", "navigation/view5", "navigation/view6", "navigation/view7", "navigation/view8", "navigation/view9", "navigation", }; String currentRoutePart = "navigation/view1"; Rou... | public String getRouteString() { return routeString; } | RouteSimilarity { public String getRouteString() { return routeString; } } | RouteSimilarity { public String getRouteString() { return routeString; } RouteSimilarity(RouteData routeData, String currentRoute); RouteSimilarity(String url, String currentRouteParts); } | RouteSimilarity { public String getRouteString() { return routeString; } RouteSimilarity(RouteData routeData, String currentRoute); RouteSimilarity(String url, String currentRouteParts); RouteData getRouteData(); Class<? extends Component> getRoute(); String getRouteString(); int getSimilarity(); } | RouteSimilarity { public String getRouteString() { return routeString; } RouteSimilarity(RouteData routeData, String currentRoute); RouteSimilarity(String url, String currentRouteParts); RouteData getRouteData(); Class<? extends Component> getRoute(); String getRouteString(); int getSimilarity(); } |
@Test public void getClosestRoute() { String[] urls = new String[]{ "navigation/view1", "navigation/view2", "navigation/view2/subview", "navigation/view3", "navigation/view4", "navigation/view5", "navigation/view6", "navigation/view7", "navigation/view8", "navigation/view9", "navigation" }; String currentRoutePart = "n... | public static Optional<RouteSimilarity> getClosestRoute(String url, String[] availableRoutes) { if (url.lastIndexOf("/") > 0) { Optional<RouteSimilarity> result = Arrays.stream(availableRoutes) .filter(routeData -> !routeData.equals(url)) .map(routeData -> new RouteSimilarity(routeData, url)) .max(Comparator.comparingI... | UpNavigationHelper implements Serializable { public static Optional<RouteSimilarity> getClosestRoute(String url, String[] availableRoutes) { if (url.lastIndexOf("/") > 0) { Optional<RouteSimilarity> result = Arrays.stream(availableRoutes) .filter(routeData -> !routeData.equals(url)) .map(routeData -> new RouteSimilarit... | UpNavigationHelper implements Serializable { public static Optional<RouteSimilarity> getClosestRoute(String url, String[] availableRoutes) { if (url.lastIndexOf("/") > 0) { Optional<RouteSimilarity> result = Arrays.stream(availableRoutes) .filter(routeData -> !routeData.equals(url)) .map(routeData -> new RouteSimilarit... | UpNavigationHelper implements Serializable { public static Optional<RouteSimilarity> getClosestRoute(String url, String[] availableRoutes) { if (url.lastIndexOf("/") > 0) { Optional<RouteSimilarity> result = Arrays.stream(availableRoutes) .filter(routeData -> !routeData.equals(url)) .map(routeData -> new RouteSimilarit... | UpNavigationHelper implements Serializable { public static Optional<RouteSimilarity> getClosestRoute(String url, String[] availableRoutes) { if (url.lastIndexOf("/") > 0) { Optional<RouteSimilarity> result = Arrays.stream(availableRoutes) .filter(routeData -> !routeData.equals(url)) .map(routeData -> new RouteSimilarit... |
@Test public void valueAnEventHigherThanAnEventThatStartedBefore() { assertEquals(1, comparator.compare(eventInApril, eventInMarch)); assertEquals(-1, comparator.compare(eventInMarch, eventInApril)); assertEquals(0, comparator.compare(eventInMarch, eventInMarch)); } | @Override public int compare(EventAdapter.Item event1, EventAdapter.Item event2) { if (event1.getEvent().getStart() == null) { if (event2.getEvent().getStart() == null) { return 0; } else { return 1; } } else if (event2.getEvent().getStart() == null) { return -1; } else { return event1.getEvent().getStart().compareTo(e... | EventDateComparator implements Comparator<EventAdapter.Item> { @Override public int compare(EventAdapter.Item event1, EventAdapter.Item event2) { if (event1.getEvent().getStart() == null) { if (event2.getEvent().getStart() == null) { return 0; } else { return 1; } } else if (event2.getEvent().getStart() == null) { retu... | EventDateComparator implements Comparator<EventAdapter.Item> { @Override public int compare(EventAdapter.Item event1, EventAdapter.Item event2) { if (event1.getEvent().getStart() == null) { if (event2.getEvent().getStart() == null) { return 0; } else { return 1; } } else if (event2.getEvent().getStart() == null) { retu... | EventDateComparator implements Comparator<EventAdapter.Item> { @Override public int compare(EventAdapter.Item event1, EventAdapter.Item event2) { if (event1.getEvent().getStart() == null) { if (event2.getEvent().getStart() == null) { return 0; } else { return 1; } } else if (event2.getEvent().getStart() == null) { retu... | EventDateComparator implements Comparator<EventAdapter.Item> { @Override public int compare(EventAdapter.Item event1, EventAdapter.Item event2) { if (event1.getEvent().getStart() == null) { if (event2.getEvent().getStart() == null) { return 0; } else { return 1; } } else if (event2.getEvent().getStart() == null) { retu... |
@Test public void valueAnEventLowerThanAnEventWithoutStartDate() { assertEquals(-1, comparator.compare(eventInApril, eventWithoutStartDate)); assertEquals(1, comparator.compare(eventWithoutStartDate, eventInApril)); assertEquals(0, comparator.compare(eventWithoutStartDate, eventWithoutStartDate)); } | @Override public int compare(EventAdapter.Item event1, EventAdapter.Item event2) { if (event1.getEvent().getStart() == null) { if (event2.getEvent().getStart() == null) { return 0; } else { return 1; } } else if (event2.getEvent().getStart() == null) { return -1; } else { return event1.getEvent().getStart().compareTo(e... | EventDateComparator implements Comparator<EventAdapter.Item> { @Override public int compare(EventAdapter.Item event1, EventAdapter.Item event2) { if (event1.getEvent().getStart() == null) { if (event2.getEvent().getStart() == null) { return 0; } else { return 1; } } else if (event2.getEvent().getStart() == null) { retu... | EventDateComparator implements Comparator<EventAdapter.Item> { @Override public int compare(EventAdapter.Item event1, EventAdapter.Item event2) { if (event1.getEvent().getStart() == null) { if (event2.getEvent().getStart() == null) { return 0; } else { return 1; } } else if (event2.getEvent().getStart() == null) { retu... | EventDateComparator implements Comparator<EventAdapter.Item> { @Override public int compare(EventAdapter.Item event1, EventAdapter.Item event2) { if (event1.getEvent().getStart() == null) { if (event2.getEvent().getStart() == null) { return 0; } else { return 1; } } else if (event2.getEvent().getStart() == null) { retu... | EventDateComparator implements Comparator<EventAdapter.Item> { @Override public int compare(EventAdapter.Item event1, EventAdapter.Item event2) { if (event1.getEvent().getStart() == null) { if (event2.getEvent().getStart() == null) { return 0; } else { return 1; } } else if (event2.getEvent().getStart() == null) { retu... |
@Test public void verifyAuthenticateSuccess() throws Exception { final HandlerResult result = alwaysPassHandler.authenticate(new UsernamePasswordCredential("a", "b")); assertEquals("TestAlwaysPassAuthenticationHandler", result.getHandlerName()); } | @Override public HandlerResult authenticate(final Credential credential) throws GeneralSecurityException, PreventedException { try { if (this.legacyHandler.authenticate(credentialsAdapter.convert(credential))) { final CredentialMetaData md; if (credential instanceof CredentialMetaData) { md = (CredentialMetaData) crede... | LegacyAuthenticationHandlerAdapter implements AuthenticationHandler { @Override public HandlerResult authenticate(final Credential credential) throws GeneralSecurityException, PreventedException { try { if (this.legacyHandler.authenticate(credentialsAdapter.convert(credential))) { final CredentialMetaData md; if (crede... | LegacyAuthenticationHandlerAdapter implements AuthenticationHandler { @Override public HandlerResult authenticate(final Credential credential) throws GeneralSecurityException, PreventedException { try { if (this.legacyHandler.authenticate(credentialsAdapter.convert(credential))) { final CredentialMetaData md; if (crede... | LegacyAuthenticationHandlerAdapter implements AuthenticationHandler { @Override public HandlerResult authenticate(final Credential credential) throws GeneralSecurityException, PreventedException { try { if (this.legacyHandler.authenticate(credentialsAdapter.convert(credential))) { final CredentialMetaData md; if (crede... | LegacyAuthenticationHandlerAdapter implements AuthenticationHandler { @Override public HandlerResult authenticate(final Credential credential) throws GeneralSecurityException, PreventedException { try { if (this.legacyHandler.authenticate(credentialsAdapter.convert(credential))) { final CredentialMetaData md; if (crede... |
@Test(expected = FailedLoginException.class) public void examineAuthenticateFailure() throws Exception { alwaysFailHandler.authenticate(new UsernamePasswordCredential("a", "b")); } | @Override public HandlerResult authenticate(final Credential credential) throws GeneralSecurityException, PreventedException { try { if (this.legacyHandler.authenticate(credentialsAdapter.convert(credential))) { final CredentialMetaData md; if (credential instanceof CredentialMetaData) { md = (CredentialMetaData) crede... | LegacyAuthenticationHandlerAdapter implements AuthenticationHandler { @Override public HandlerResult authenticate(final Credential credential) throws GeneralSecurityException, PreventedException { try { if (this.legacyHandler.authenticate(credentialsAdapter.convert(credential))) { final CredentialMetaData md; if (crede... | LegacyAuthenticationHandlerAdapter implements AuthenticationHandler { @Override public HandlerResult authenticate(final Credential credential) throws GeneralSecurityException, PreventedException { try { if (this.legacyHandler.authenticate(credentialsAdapter.convert(credential))) { final CredentialMetaData md; if (crede... | LegacyAuthenticationHandlerAdapter implements AuthenticationHandler { @Override public HandlerResult authenticate(final Credential credential) throws GeneralSecurityException, PreventedException { try { if (this.legacyHandler.authenticate(credentialsAdapter.convert(credential))) { final CredentialMetaData md; if (crede... | LegacyAuthenticationHandlerAdapter implements AuthenticationHandler { @Override public HandlerResult authenticate(final Credential credential) throws GeneralSecurityException, PreventedException { try { if (this.legacyHandler.authenticate(credentialsAdapter.convert(credential))) { final CredentialMetaData md; if (crede... |
@Test public void verifySupports() throws Exception { assertTrue(alwaysPassHandler.supports(new UsernamePasswordCredential("a", "b"))); assertTrue(alwaysFailHandler.supports(new UsernamePasswordCredential("a", "b"))); } | @Override public boolean supports(final Credential credential) { return this.legacyHandler.supports(credentialsAdapter.convert(credential)); } | LegacyAuthenticationHandlerAdapter implements AuthenticationHandler { @Override public boolean supports(final Credential credential) { return this.legacyHandler.supports(credentialsAdapter.convert(credential)); } } | LegacyAuthenticationHandlerAdapter implements AuthenticationHandler { @Override public boolean supports(final Credential credential) { return this.legacyHandler.supports(credentialsAdapter.convert(credential)); } LegacyAuthenticationHandlerAdapter(final org.jasig.cas.authentication.handler.AuthenticationHandler legacy)... | LegacyAuthenticationHandlerAdapter implements AuthenticationHandler { @Override public boolean supports(final Credential credential) { return this.legacyHandler.supports(credentialsAdapter.convert(credential)); } LegacyAuthenticationHandlerAdapter(final org.jasig.cas.authentication.handler.AuthenticationHandler legacy)... | LegacyAuthenticationHandlerAdapter implements AuthenticationHandler { @Override public boolean supports(final Credential credential) { return this.legacyHandler.supports(credentialsAdapter.convert(credential)); } LegacyAuthenticationHandlerAdapter(final org.jasig.cas.authentication.handler.AuthenticationHandler legacy)... |
@Test public void verifyGetName() throws Exception { assertEquals("TestAlwaysPassAuthenticationHandler", alwaysPassHandler.getName()); assertEquals("TestAlwaysFailAuthenticationHandler", alwaysFailHandler.getName()); } | @Override public String getName() { if (this.legacyHandler instanceof NamedAuthenticationHandler) { return ((NamedAuthenticationHandler) this.legacyHandler).getName(); } else { return this.legacyHandler.getClass().getSimpleName(); } } | LegacyAuthenticationHandlerAdapter implements AuthenticationHandler { @Override public String getName() { if (this.legacyHandler instanceof NamedAuthenticationHandler) { return ((NamedAuthenticationHandler) this.legacyHandler).getName(); } else { return this.legacyHandler.getClass().getSimpleName(); } } } | LegacyAuthenticationHandlerAdapter implements AuthenticationHandler { @Override public String getName() { if (this.legacyHandler instanceof NamedAuthenticationHandler) { return ((NamedAuthenticationHandler) this.legacyHandler).getName(); } else { return this.legacyHandler.getClass().getSimpleName(); } } LegacyAuthentic... | LegacyAuthenticationHandlerAdapter implements AuthenticationHandler { @Override public String getName() { if (this.legacyHandler instanceof NamedAuthenticationHandler) { return ((NamedAuthenticationHandler) this.legacyHandler).getName(); } else { return this.legacyHandler.getClass().getSimpleName(); } } LegacyAuthentic... | LegacyAuthenticationHandlerAdapter implements AuthenticationHandler { @Override public String getName() { if (this.legacyHandler instanceof NamedAuthenticationHandler) { return ((NamedAuthenticationHandler) this.legacyHandler).getName(); } else { return this.legacyHandler.getClass().getSimpleName(); } } LegacyAuthentic... |
@Test public void verifyCanHandle() { request.addParameter("openid.mode", "associate"); final boolean canHandle = smartOpenIdController.canHandle(request, response); request.removeParameter("openid.mode"); assertEquals(true, canHandle); } | @Override public boolean canHandle(final HttpServletRequest request, final HttpServletResponse response) { final String openIdMode = request.getParameter(OpenIdConstants.OPENID_MODE); if (StringUtils.equals(openIdMode, OpenIdConstants.ASSOCIATE)) { logger.info("Handling request. openid.mode : {}", openIdMode); return t... | SmartOpenIdController extends DelegateController implements Serializable { @Override public boolean canHandle(final HttpServletRequest request, final HttpServletResponse response) { final String openIdMode = request.getParameter(OpenIdConstants.OPENID_MODE); if (StringUtils.equals(openIdMode, OpenIdConstants.ASSOCIATE)... | SmartOpenIdController extends DelegateController implements Serializable { @Override public boolean canHandle(final HttpServletRequest request, final HttpServletResponse response) { final String openIdMode = request.getParameter(OpenIdConstants.OPENID_MODE); if (StringUtils.equals(openIdMode, OpenIdConstants.ASSOCIATE)... | SmartOpenIdController extends DelegateController implements Serializable { @Override public boolean canHandle(final HttpServletRequest request, final HttpServletResponse response) { final String openIdMode = request.getParameter(OpenIdConstants.OPENID_MODE); if (StringUtils.equals(openIdMode, OpenIdConstants.ASSOCIATE)... | SmartOpenIdController extends DelegateController implements Serializable { @Override public boolean canHandle(final HttpServletRequest request, final HttpServletResponse response) { final String openIdMode = request.getParameter(OpenIdConstants.OPENID_MODE); if (StringUtils.equals(openIdMode, OpenIdConstants.ASSOCIATE)... |
@Test public void verifyCannotHandle() { request.addParameter("openid.mode", "anythingElse"); final boolean canHandle = smartOpenIdController.canHandle(request, response); request.removeParameter("openid.mode"); assertEquals(false, canHandle); } | @Override public boolean canHandle(final HttpServletRequest request, final HttpServletResponse response) { final String openIdMode = request.getParameter(OpenIdConstants.OPENID_MODE); if (StringUtils.equals(openIdMode, OpenIdConstants.ASSOCIATE)) { logger.info("Handling request. openid.mode : {}", openIdMode); return t... | SmartOpenIdController extends DelegateController implements Serializable { @Override public boolean canHandle(final HttpServletRequest request, final HttpServletResponse response) { final String openIdMode = request.getParameter(OpenIdConstants.OPENID_MODE); if (StringUtils.equals(openIdMode, OpenIdConstants.ASSOCIATE)... | SmartOpenIdController extends DelegateController implements Serializable { @Override public boolean canHandle(final HttpServletRequest request, final HttpServletResponse response) { final String openIdMode = request.getParameter(OpenIdConstants.OPENID_MODE); if (StringUtils.equals(openIdMode, OpenIdConstants.ASSOCIATE)... | SmartOpenIdController extends DelegateController implements Serializable { @Override public boolean canHandle(final HttpServletRequest request, final HttpServletResponse response) { final String openIdMode = request.getParameter(OpenIdConstants.OPENID_MODE); if (StringUtils.equals(openIdMode, OpenIdConstants.ASSOCIATE)... | SmartOpenIdController extends DelegateController implements Serializable { @Override public boolean canHandle(final HttpServletRequest request, final HttpServletResponse response) { final String openIdMode = request.getParameter(OpenIdConstants.OPENID_MODE); if (StringUtils.equals(openIdMode, OpenIdConstants.ASSOCIATE)... |
@Test public void verifyGetAssociationResponse() { request.addParameter("openid.mode", "associate"); request.addParameter("openid.session_type", "DH-SHA1"); request.addParameter("openid.assoc_type", "HMAC-SHA1"); request.addParameter("openid.dh_consumer_public", "NzKoFMyrzFn/5iJFPdX6MVvNA/BChV1/sJdnYbupDn7ptn+cerwEzyFf... | public Map<String, String> getAssociationResponse(final HttpServletRequest request) { final ParameterList parameters = new ParameterList(request.getParameterMap()); final String mode = parameters.hasParameter(OpenIdConstants.OPENID_MODE) ? parameters.getParameterValue(OpenIdConstants.OPENID_MODE) : null; Message respon... | SmartOpenIdController extends DelegateController implements Serializable { public Map<String, String> getAssociationResponse(final HttpServletRequest request) { final ParameterList parameters = new ParameterList(request.getParameterMap()); final String mode = parameters.hasParameter(OpenIdConstants.OPENID_MODE) ? param... | SmartOpenIdController extends DelegateController implements Serializable { public Map<String, String> getAssociationResponse(final HttpServletRequest request) { final ParameterList parameters = new ParameterList(request.getParameterMap()); final String mode = parameters.hasParameter(OpenIdConstants.OPENID_MODE) ? param... | SmartOpenIdController extends DelegateController implements Serializable { public Map<String, String> getAssociationResponse(final HttpServletRequest request) { final ParameterList parameters = new ParameterList(request.getParameterMap()); final String mode = parameters.hasParameter(OpenIdConstants.OPENID_MODE) ? param... | SmartOpenIdController extends DelegateController implements Serializable { public Map<String, String> getAssociationResponse(final HttpServletRequest request) { final ParameterList parameters = new ParameterList(request.getParameterMap()); final String mode = parameters.hasParameter(OpenIdConstants.OPENID_MODE) ? param... |
@Test void testBundle() { final var context = new Context(); BundleLoader.loadSingle(context, CompositionBundle.class); assertThat(context.functions(), hasKey("composition")); assertThat(context.composition(), nullValue()); assertThat(context.variables(), allOf( not(hasKey("Width")), not(hasKey("Height")), not(hasKey("... | private static Function composition(Context context) { return args -> { final Composition composition; switch (args.length) { case 0: composition = new Composition(); break; case 1: double frameRate = args[0].asDouble(); composition = new Composition(frameRate); break; case 2: int width = args[0].asInt(); int height = ... | CompositionBundle implements Bundle { private static Function composition(Context context) { return args -> { final Composition composition; switch (args.length) { case 0: composition = new Composition(); break; case 1: double frameRate = args[0].asDouble(); composition = new Composition(frameRate); break; case 2: int ... | CompositionBundle implements Bundle { private static Function composition(Context context) { return args -> { final Composition composition; switch (args.length) { case 0: composition = new Composition(); break; case 1: double frameRate = args[0].asDouble(); composition = new Composition(frameRate); break; case 2: int ... | CompositionBundle implements Bundle { private static Function composition(Context context) { return args -> { final Composition composition; switch (args.length) { case 0: composition = new Composition(); break; case 1: double frameRate = args[0].asDouble(); composition = new Composition(frameRate); break; case 2: int ... | CompositionBundle implements Bundle { private static Function composition(Context context) { return args -> { final Composition composition; switch (args.length) { case 0: composition = new Composition(); break; case 1: double frameRate = args[0].asDouble(); composition = new Composition(frameRate); break; case 2: int ... |
@Test void testTokenizeText() { assertThat(t("1 \" 1\n2 3 '\""), contains( tokenId(HotaruTokenId.NUMBER), tokenId(HotaruTokenId.TEXT) )); assertThat(t("1 ' 1\n2 3 ' 2"), contains( tokenId(HotaruTokenId.NUMBER), tokenId(HotaruTokenId.TEXT), tokenId(HotaruTokenId.NUMBER) )); assertThrows(LexerException.class, () -> { all... | private Token tokenizeText(char openChar) { next(); clearBuffer(); int startPos = getPos() - 1; char current = peek(0); while (true) { if (current == '\\') { final var buffer = getBuffer(); current = next(); if (current == openChar) { current = next(); buffer.append(openChar); continue; } switch (current) { case '0': c... | HotaruLexer extends Lexer { private Token tokenizeText(char openChar) { next(); clearBuffer(); int startPos = getPos() - 1; char current = peek(0); while (true) { if (current == '\\') { final var buffer = getBuffer(); current = next(); if (current == openChar) { current = next(); buffer.append(openChar); continue; } sw... | HotaruLexer extends Lexer { private Token tokenizeText(char openChar) { next(); clearBuffer(); int startPos = getPos() - 1; char current = peek(0); while (true) { if (current == '\\') { final var buffer = getBuffer(); current = next(); if (current == openChar) { current = next(); buffer.append(openChar); continue; } sw... | HotaruLexer extends Lexer { private Token tokenizeText(char openChar) { next(); clearBuffer(); int startPos = getPos() - 1; char current = peek(0); while (true) { if (current == '\\') { final var buffer = getBuffer(); current = next(); if (current == openChar) { current = next(); buffer.append(openChar); continue; } sw... | HotaruLexer extends Lexer { private Token tokenizeText(char openChar) { next(); clearBuffer(); int startPos = getPos() - 1; char current = peek(0); while (true) { if (current == '\\') { final var buffer = getBuffer(); current = next(); if (current == openChar) { current = next(); buffer.append(openChar); continue; } sw... |
@Test void testMapAccess() { Context context = new Context(); eval("A = {x: 0, y: 22, z: 0, text: 'hello'}\n" + "A.x = 20\n" + "A.z = A.y\n" + "A.newKey = 'newValue'", context); Value value = context.variables().get("A"); assertThat(value, instanceOf(MapValue.class)); Map<String, Value> map = ((MapValue) value).getMap(... | @Override public Value get(AccessNode node, Context context) { Value container = node.root.accept(this, context); return getContainer(node.indices, context, container) .orElseThrow(() -> new TypeException("Unable to get property from non-accessible type", node.start(), node.end())); } | InterpreterVisitor implements ResultVisitor<Value, Context> { @Override public Value get(AccessNode node, Context context) { Value container = node.root.accept(this, context); return getContainer(node.indices, context, container) .orElseThrow(() -> new TypeException("Unable to get property from non-accessible type", no... | InterpreterVisitor implements ResultVisitor<Value, Context> { @Override public Value get(AccessNode node, Context context) { Value container = node.root.accept(this, context); return getContainer(node.indices, context, container) .orElseThrow(() -> new TypeException("Unable to get property from non-accessible type", no... | InterpreterVisitor implements ResultVisitor<Value, Context> { @Override public Value get(AccessNode node, Context context) { Value container = node.root.accept(this, context); return getContainer(node.indices, context, container) .orElseThrow(() -> new TypeException("Unable to get property from non-accessible type", no... | InterpreterVisitor implements ResultVisitor<Value, Context> { @Override public Value get(AccessNode node, Context context) { Value container = node.root.accept(this, context); return getContainer(node.indices, context, container) .orElseThrow(() -> new TypeException("Unable to get property from non-accessible type", no... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.