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(expected = WebApplicationException.class) public void testFetchJobOutputReturns404IfJobDoesNotExist() { final JobDAO jobDAO = mock(JobDAO.class); when(jobDAO.jobExists(any())).thenReturn(false); final JobResource jobResource = resourceThatUses(jobDAO); final Response ret = jobResource.fetchJobOutput(generateSecur... | @GET @Path("/{job-id}/outputs/{output-id}") @Operation( summary = "Get an output produced by the job", description = "Gets an output produced by the job. If the job has not written this output, of it it has been " + "subsequently deleted, a 404 shall be returned") @PermitAll public Response fetchJobOutput( @Context Sec... | JobResource { @GET @Path("/{job-id}/outputs/{output-id}") @Operation( summary = "Get an output produced by the job", description = "Gets an output produced by the job. If the job has not written this output, of it it has been " + "subsequently deleted, a 404 shall be returned") @PermitAll public Response fetchJobOutput... | JobResource { @GET @Path("/{job-id}/outputs/{output-id}") @Operation( summary = "Get an output produced by the job", description = "Gets an output produced by the job. If the job has not written this output, of it it has been " + "subsequently deleted, a 404 shall be returned") @PermitAll public Response fetchJobOutput... | JobResource { @GET @Path("/{job-id}/outputs/{output-id}") @Operation( summary = "Get an output produced by the job", description = "Gets an output produced by the job. If the job has not written this output, of it it has been " + "subsequently deleted, a 404 shall be returned") @PermitAll public Response fetchJobOutput... | JobResource { @GET @Path("/{job-id}/outputs/{output-id}") @Operation( summary = "Get an output produced by the job", description = "Gets an output produced by the job. If the job has not written this output, of it it has been " + "subsequently deleted, a 404 shall be returned") @PermitAll public Response fetchJobOutput... |
@Test(expected = WebApplicationException.class) public void testFetchJobOutputReturns404IfOutputDoesNotExist() { final JobDAO jobDAO = mock(JobDAO.class); when(jobDAO.jobExists(any())).thenReturn(true); when(jobDAO.getOutput(any(), any())).thenReturn(Optional.empty()); final JobResource jobResource = resourceThatUses(j... | @GET @Path("/{job-id}/outputs/{output-id}") @Operation( summary = "Get an output produced by the job", description = "Gets an output produced by the job. If the job has not written this output, of it it has been " + "subsequently deleted, a 404 shall be returned") @PermitAll public Response fetchJobOutput( @Context Sec... | JobResource { @GET @Path("/{job-id}/outputs/{output-id}") @Operation( summary = "Get an output produced by the job", description = "Gets an output produced by the job. If the job has not written this output, of it it has been " + "subsequently deleted, a 404 shall be returned") @PermitAll public Response fetchJobOutput... | JobResource { @GET @Path("/{job-id}/outputs/{output-id}") @Operation( summary = "Get an output produced by the job", description = "Gets an output produced by the job. If the job has not written this output, of it it has been " + "subsequently deleted, a 404 shall be returned") @PermitAll public Response fetchJobOutput... | JobResource { @GET @Path("/{job-id}/outputs/{output-id}") @Operation( summary = "Get an output produced by the job", description = "Gets an output produced by the job. If the job has not written this output, of it it has been " + "subsequently deleted, a 404 shall be returned") @PermitAll public Response fetchJobOutput... | JobResource { @GET @Path("/{job-id}/outputs/{output-id}") @Operation( summary = "Get an output produced by the job", description = "Gets an output produced by the job. If the job has not written this output, of it it has been " + "subsequently deleted, a 404 shall be returned") @PermitAll public Response fetchJobOutput... |
@Test public void testFetchJobOutputReturns200IfOutputExists() { final JobDAO jobDAO = mock(JobDAO.class); when(jobDAO.jobExists(any())).thenReturn(true); final BinaryData bd = generateRandomBinaryData(); when(jobDAO.getOutput(any(), any())).thenReturn(Optional.of(bd)); final JobResource jobResource = resourceThatUses(... | @GET @Path("/{job-id}/outputs/{output-id}") @Operation( summary = "Get an output produced by the job", description = "Gets an output produced by the job. If the job has not written this output, of it it has been " + "subsequently deleted, a 404 shall be returned") @PermitAll public Response fetchJobOutput( @Context Sec... | JobResource { @GET @Path("/{job-id}/outputs/{output-id}") @Operation( summary = "Get an output produced by the job", description = "Gets an output produced by the job. If the job has not written this output, of it it has been " + "subsequently deleted, a 404 shall be returned") @PermitAll public Response fetchJobOutput... | JobResource { @GET @Path("/{job-id}/outputs/{output-id}") @Operation( summary = "Get an output produced by the job", description = "Gets an output produced by the job. If the job has not written this output, of it it has been " + "subsequently deleted, a 404 shall be returned") @PermitAll public Response fetchJobOutput... | JobResource { @GET @Path("/{job-id}/outputs/{output-id}") @Operation( summary = "Get an output produced by the job", description = "Gets an output produced by the job. If the job has not written this output, of it it has been " + "subsequently deleted, a 404 shall be returned") @PermitAll public Response fetchJobOutput... | JobResource { @GET @Path("/{job-id}/outputs/{output-id}") @Operation( summary = "Get an output produced by the job", description = "Gets an output produced by the job. If the job has not written this output, of it it has been " + "subsequently deleted, a 404 shall be returned") @PermitAll public Response fetchJobOutput... |
@Test public void testFetchJobOutputContentTypeMatchesOutputContentType() { final JobDAO jobDAO = mock(JobDAO.class); when(jobDAO.jobExists(any())).thenReturn(true); final String mimeType = "application/x-test-type"; final BinaryData bd = generateRandomBinaryData().withMimeType(mimeType); when(jobDAO.getOutput(any(), a... | @GET @Path("/{job-id}/outputs/{output-id}") @Operation( summary = "Get an output produced by the job", description = "Gets an output produced by the job. If the job has not written this output, of it it has been " + "subsequently deleted, a 404 shall be returned") @PermitAll public Response fetchJobOutput( @Context Sec... | JobResource { @GET @Path("/{job-id}/outputs/{output-id}") @Operation( summary = "Get an output produced by the job", description = "Gets an output produced by the job. If the job has not written this output, of it it has been " + "subsequently deleted, a 404 shall be returned") @PermitAll public Response fetchJobOutput... | JobResource { @GET @Path("/{job-id}/outputs/{output-id}") @Operation( summary = "Get an output produced by the job", description = "Gets an output produced by the job. If the job has not written this output, of it it has been " + "subsequently deleted, a 404 shall be returned") @PermitAll public Response fetchJobOutput... | JobResource { @GET @Path("/{job-id}/outputs/{output-id}") @Operation( summary = "Get an output produced by the job", description = "Gets an output produced by the job. If the job has not written this output, of it it has been " + "subsequently deleted, a 404 shall be returned") @PermitAll public Response fetchJobOutput... | JobResource { @GET @Path("/{job-id}/outputs/{output-id}") @Operation( summary = "Get an output produced by the job", description = "Gets an output produced by the job. If the job has not written this output, of it it has been " + "subsequently deleted, a 404 shall be returned") @PermitAll public Response fetchJobOutput... |
@Test public void testFetchJobOutputSetsContentEncodingToIdentityIfAboveBreakpoint() { final JobDAO jobDAO = mock(JobDAO.class); when(jobDAO.jobExists(any())).thenReturn(true); final int breakpoint = Constants.MAX_JOB_OUTPUT_SIZE_IN_BYTES_BEFORE_DISABLING_COMPRESSION; final byte data[] = TestHelpers.generateRandomBytes... | @GET @Path("/{job-id}/outputs/{output-id}") @Operation( summary = "Get an output produced by the job", description = "Gets an output produced by the job. If the job has not written this output, of it it has been " + "subsequently deleted, a 404 shall be returned") @PermitAll public Response fetchJobOutput( @Context Sec... | JobResource { @GET @Path("/{job-id}/outputs/{output-id}") @Operation( summary = "Get an output produced by the job", description = "Gets an output produced by the job. If the job has not written this output, of it it has been " + "subsequently deleted, a 404 shall be returned") @PermitAll public Response fetchJobOutput... | JobResource { @GET @Path("/{job-id}/outputs/{output-id}") @Operation( summary = "Get an output produced by the job", description = "Gets an output produced by the job. If the job has not written this output, of it it has been " + "subsequently deleted, a 404 shall be returned") @PermitAll public Response fetchJobOutput... | JobResource { @GET @Path("/{job-id}/outputs/{output-id}") @Operation( summary = "Get an output produced by the job", description = "Gets an output produced by the job. If the job has not written this output, of it it has been " + "subsequently deleted, a 404 shall be returned") @PermitAll public Response fetchJobOutput... | JobResource { @GET @Path("/{job-id}/outputs/{output-id}") @Operation( summary = "Get an output produced by the job", description = "Gets an output produced by the job. If the job has not written this output, of it it has been " + "subsequently deleted, a 404 shall be returned") @PermitAll public Response fetchJobOutput... |
@Test public void testFetchJobSpecSummariesCallsTheDAOWithTheSpecifiedPageSize() throws IOException { final List<JobSpecSummary> jobSpecSummariesReturnedByDAO = generateNJobSpecSummaries(5); final JobSpecDAO jobSpecDAO = mock(JobSpecDAO.class); when(jobSpecDAO.getJobSpecSummaries(anyInt(), anyInt())).thenReturn(jobSpec... | @GET @Operation( summary = "Get summaries of the job specs exposed by the system", description = "Returns an object that contains summaries of *some* of the job specs exposed by the system. " + "The response does not necessarily contain summaries for *all* job specs exposed by the system. " + "This is because paginatio... | JobSpecResource { @GET @Operation( summary = "Get summaries of the job specs exposed by the system", description = "Returns an object that contains summaries of *some* of the job specs exposed by the system. " + "The response does not necessarily contain summaries for *all* job specs exposed by the system. " + "This is... | JobSpecResource { @GET @Operation( summary = "Get summaries of the job specs exposed by the system", description = "Returns an object that contains summaries of *some* of the job specs exposed by the system. " + "The response does not necessarily contain summaries for *all* job specs exposed by the system. " + "This is... | JobSpecResource { @GET @Operation( summary = "Get summaries of the job specs exposed by the system", description = "Returns an object that contains summaries of *some* of the job specs exposed by the system. " + "The response does not necessarily contain summaries for *all* job specs exposed by the system. " + "This is... | JobSpecResource { @GET @Operation( summary = "Get summaries of the job specs exposed by the system", description = "Returns an object that contains summaries of *some* of the job specs exposed by the system. " + "The response does not necessarily contain summaries for *all* job specs exposed by the system. " + "This is... |
@Test public void testFetchJobInputsThrows404IfJobDoesNotExist() { final JobDAO jobDAO = mock(JobDAO.class); when(jobDAO.jobExists(any())).thenReturn(false); when(jobDAO.getJobInputs(any())).thenReturn(Optional.empty()); final JobResource jobResource = resourceThatUses(jobDAO); assertThat( jobResource.fetchJobInputs(ge... | @GET @Path("/{job-id}/inputs") @Operation( summary = "Get the job's inputs", description = "Get the inputs that were supplied when the job was submitted.") @PermitAll public Optional<Map<JobExpectedInputId, JsonNode>> fetchJobInputs( @Context SecurityContext context, @Parameter(description = "ID of the job to get input... | JobResource { @GET @Path("/{job-id}/inputs") @Operation( summary = "Get the job's inputs", description = "Get the inputs that were supplied when the job was submitted.") @PermitAll public Optional<Map<JobExpectedInputId, JsonNode>> fetchJobInputs( @Context SecurityContext context, @Parameter(description = "ID of the jo... | JobResource { @GET @Path("/{job-id}/inputs") @Operation( summary = "Get the job's inputs", description = "Get the inputs that were supplied when the job was submitted.") @PermitAll public Optional<Map<JobExpectedInputId, JsonNode>> fetchJobInputs( @Context SecurityContext context, @Parameter(description = "ID of the jo... | JobResource { @GET @Path("/{job-id}/inputs") @Operation( summary = "Get the job's inputs", description = "Get the inputs that were supplied when the job was submitted.") @PermitAll public Optional<Map<JobExpectedInputId, JsonNode>> fetchJobInputs( @Context SecurityContext context, @Parameter(description = "ID of the jo... | JobResource { @GET @Path("/{job-id}/inputs") @Operation( summary = "Get the job's inputs", description = "Get the inputs that were supplied when the job was submitted.") @PermitAll public Optional<Map<JobExpectedInputId, JsonNode>> fetchJobInputs( @Context SecurityContext context, @Parameter(description = "ID of the jo... |
@Test public void testFetchJobInputsReturnsJobInputsFromDAOIfJobExists() { final Map<JobExpectedInputId, JsonNode> inputs = new HashMap<>(); final JobDAO jobDAO = mock(JobDAO.class); when(jobDAO.jobExists(any())).thenReturn(true); when(jobDAO.getJobInputs(any())).thenReturn(Optional.of(inputs)); final JobResource jobRe... | @GET @Path("/{job-id}/inputs") @Operation( summary = "Get the job's inputs", description = "Get the inputs that were supplied when the job was submitted.") @PermitAll public Optional<Map<JobExpectedInputId, JsonNode>> fetchJobInputs( @Context SecurityContext context, @Parameter(description = "ID of the job to get input... | JobResource { @GET @Path("/{job-id}/inputs") @Operation( summary = "Get the job's inputs", description = "Get the inputs that were supplied when the job was submitted.") @PermitAll public Optional<Map<JobExpectedInputId, JsonNode>> fetchJobInputs( @Context SecurityContext context, @Parameter(description = "ID of the jo... | JobResource { @GET @Path("/{job-id}/inputs") @Operation( summary = "Get the job's inputs", description = "Get the inputs that were supplied when the job was submitted.") @PermitAll public Optional<Map<JobExpectedInputId, JsonNode>> fetchJobInputs( @Context SecurityContext context, @Parameter(description = "ID of the jo... | JobResource { @GET @Path("/{job-id}/inputs") @Operation( summary = "Get the job's inputs", description = "Get the inputs that were supplied when the job was submitted.") @PermitAll public Optional<Map<JobExpectedInputId, JsonNode>> fetchJobInputs( @Context SecurityContext context, @Parameter(description = "ID of the jo... | JobResource { @GET @Path("/{job-id}/inputs") @Operation( summary = "Get the job's inputs", description = "Get the inputs that were supplied when the job was submitted.") @PermitAll public Optional<Map<JobExpectedInputId, JsonNode>> fetchJobInputs( @Context SecurityContext context, @Parameter(description = "ID of the jo... |
@Test(expected = WebApplicationException.class) public void testDeleteJobThrowsBadRequestIfJobIdIsNull() { final JobDAO jobDAO = mock(JobDAO.class); final JobResource jobResource = resourceThatUses(jobDAO); jobResource.deleteJob(generateSecureSecurityContext(), null); } | @DELETE @Path("{job-id}") @Operation( summary = "Delete a job from the system", description = "Deletes a job from the system, removing **all** job data. Running jobs are aborted before deletion." ) @PermitAll public int deleteJob( @Context SecurityContext context, @Parameter(description = "The job's ID") @PathParam("jo... | JobResource { @DELETE @Path("{job-id}") @Operation( summary = "Delete a job from the system", description = "Deletes a job from the system, removing **all** job data. Running jobs are aborted before deletion." ) @PermitAll public int deleteJob( @Context SecurityContext context, @Parameter(description = "The job's ID") ... | JobResource { @DELETE @Path("{job-id}") @Operation( summary = "Delete a job from the system", description = "Deletes a job from the system, removing **all** job data. Running jobs are aborted before deletion." ) @PermitAll public int deleteJob( @Context SecurityContext context, @Parameter(description = "The job's ID") ... | JobResource { @DELETE @Path("{job-id}") @Operation( summary = "Delete a job from the system", description = "Deletes a job from the system, removing **all** job data. Running jobs are aborted before deletion." ) @PermitAll public int deleteJob( @Context SecurityContext context, @Parameter(description = "The job's ID") ... | JobResource { @DELETE @Path("{job-id}") @Operation( summary = "Delete a job from the system", description = "Deletes a job from the system, removing **all** job data. Running jobs are aborted before deletion." ) @PermitAll public int deleteJob( @Context SecurityContext context, @Parameter(description = "The job's ID") ... |
@Test public void testDeleteJobCallsJobDAORemove() { final JobDAO jobDAO = mock(JobDAO.class); final JobResource jobResource = resourceThatUses(jobDAO); final JobId jobId = generateJobId(); jobResource.deleteJob(generateSecureSecurityContext(), jobId); verify(jobDAO, times(1)).remove(jobId); } | @DELETE @Path("{job-id}") @Operation( summary = "Delete a job from the system", description = "Deletes a job from the system, removing **all** job data. Running jobs are aborted before deletion." ) @PermitAll public int deleteJob( @Context SecurityContext context, @Parameter(description = "The job's ID") @PathParam("jo... | JobResource { @DELETE @Path("{job-id}") @Operation( summary = "Delete a job from the system", description = "Deletes a job from the system, removing **all** job data. Running jobs are aborted before deletion." ) @PermitAll public int deleteJob( @Context SecurityContext context, @Parameter(description = "The job's ID") ... | JobResource { @DELETE @Path("{job-id}") @Operation( summary = "Delete a job from the system", description = "Deletes a job from the system, removing **all** job data. Running jobs are aborted before deletion." ) @PermitAll public int deleteJob( @Context SecurityContext context, @Parameter(description = "The job's ID") ... | JobResource { @DELETE @Path("{job-id}") @Operation( summary = "Delete a job from the system", description = "Deletes a job from the system, removing **all** job data. Running jobs are aborted before deletion." ) @PermitAll public int deleteJob( @Context SecurityContext context, @Parameter(description = "The job's ID") ... | JobResource { @DELETE @Path("{job-id}") @Operation( summary = "Delete a job from the system", description = "Deletes a job from the system, removing **all** job data. Running jobs are aborted before deletion." ) @PermitAll public int deleteJob( @Context SecurityContext context, @Parameter(description = "The job's ID") ... |
@Test public void testDeleteJobCallsAbortOnJob() { final JobManagerActions actions = mock(JobManagerActions.class); final JobDAO jobDAO = mock(JobDAO.class); final JobResource jobResource = resourceThatUses(actions, jobDAO); final JobId jobId = generateJobId(); when(actions.tryAbort(jobId)).thenReturn(true); jobResourc... | @DELETE @Path("{job-id}") @Operation( summary = "Delete a job from the system", description = "Deletes a job from the system, removing **all** job data. Running jobs are aborted before deletion." ) @PermitAll public int deleteJob( @Context SecurityContext context, @Parameter(description = "The job's ID") @PathParam("jo... | JobResource { @DELETE @Path("{job-id}") @Operation( summary = "Delete a job from the system", description = "Deletes a job from the system, removing **all** job data. Running jobs are aborted before deletion." ) @PermitAll public int deleteJob( @Context SecurityContext context, @Parameter(description = "The job's ID") ... | JobResource { @DELETE @Path("{job-id}") @Operation( summary = "Delete a job from the system", description = "Deletes a job from the system, removing **all** job data. Running jobs are aborted before deletion." ) @PermitAll public int deleteJob( @Context SecurityContext context, @Parameter(description = "The job's ID") ... | JobResource { @DELETE @Path("{job-id}") @Operation( summary = "Delete a job from the system", description = "Deletes a job from the system, removing **all** job data. Running jobs are aborted before deletion." ) @PermitAll public int deleteJob( @Context SecurityContext context, @Parameter(description = "The job's ID") ... | JobResource { @DELETE @Path("{job-id}") @Operation( summary = "Delete a job from the system", description = "Deletes a job from the system, removing **all** job data. Running jobs are aborted before deletion." ) @PermitAll public int deleteJob( @Context SecurityContext context, @Parameter(description = "The job's ID") ... |
@Test public void testGetCurrentUserReturnsCurrentUserId() { final UserId userId = TestHelpers.generateUserId(); final SecurityContext securityContext = new SecurityContext() { @Override public Principal getUserPrincipal() { return new Principal() { @Override public String getName() { return userId.toString(); } }; } @... | @GET @Path("current") @PermitAll @Operation( summary = "Get the current user", description = "Returns the current user that Jobson believes is calling the API. This entrypoint *always* returns " + "*something*. If authentication is disabled (e.g. guest auth is enabled) then the client's ID is" + " handled as the guest ... | UserResource { @GET @Path("current") @PermitAll @Operation( summary = "Get the current user", description = "Returns the current user that Jobson believes is calling the API. This entrypoint *always* returns " + "*something*. If authentication is disabled (e.g. guest auth is enabled) then the client's ID is" + " handle... | UserResource { @GET @Path("current") @PermitAll @Operation( summary = "Get the current user", description = "Returns the current user that Jobson believes is calling the API. This entrypoint *always* returns " + "*something*. If authentication is disabled (e.g. guest auth is enabled) then the client's ID is" + " handle... | UserResource { @GET @Path("current") @PermitAll @Operation( summary = "Get the current user", description = "Returns the current user that Jobson believes is calling the API. This entrypoint *always* returns " + "*something*. If authentication is disabled (e.g. guest auth is enabled) then the client's ID is" + " handle... | UserResource { @GET @Path("current") @PermitAll @Operation( summary = "Get the current user", description = "Returns the current user that Jobson believes is calling the API. This entrypoint *always* returns " + "*something*. If authentication is disabled (e.g. guest auth is enabled) then the client's ID is" + " handle... |
@Test public void testWhenCalledWithADelimiterAndAnArrayOfStringReturnsAStringJoinedByTheDelimiter() { final JoinFunction joinFunction = new JoinFunction(); final String delimiter = ","; final List<String> items = generateTestData(); final Object ret = joinFunction.call(delimiter, new StringArrayInput(items)); assertTh... | @Override public Object call(Object... args) { if (args.length != 2) { throw new RuntimeException(String.format("Invalid number of arguments (%s) supplied to a join function", args.length)); } else if (args[0].getClass() != String.class) { throw new RuntimeException(String.format("%s: Is not a valid first argument to j... | JoinFunction implements FreeFunction { @Override public Object call(Object... args) { if (args.length != 2) { throw new RuntimeException(String.format("Invalid number of arguments (%s) supplied to a join function", args.length)); } else if (args[0].getClass() != String.class) { throw new RuntimeException(String.format(... | JoinFunction implements FreeFunction { @Override public Object call(Object... args) { if (args.length != 2) { throw new RuntimeException(String.format("Invalid number of arguments (%s) supplied to a join function", args.length)); } else if (args[0].getClass() != String.class) { throw new RuntimeException(String.format(... | JoinFunction implements FreeFunction { @Override public Object call(Object... args) { if (args.length != 2) { throw new RuntimeException(String.format("Invalid number of arguments (%s) supplied to a join function", args.length)); } else if (args[0].getClass() != String.class) { throw new RuntimeException(String.format(... | JoinFunction implements FreeFunction { @Override public Object call(Object... args) { if (args.length != 2) { throw new RuntimeException(String.format("Invalid number of arguments (%s) supplied to a join function", args.length)); } else if (args[0].getClass() != String.class) { throw new RuntimeException(String.format(... |
@Test(expected = RuntimeException.class) public void testWhenCalledWithInvalidTypesThrowsException() { final JoinFunction joinFunction = new JoinFunction(); joinFunction.call(new Object(), new Object()); joinFunction.call(",", new Object()); joinFunction.call(new Object(), generateTestData()); } | @Override public Object call(Object... args) { if (args.length != 2) { throw new RuntimeException(String.format("Invalid number of arguments (%s) supplied to a join function", args.length)); } else if (args[0].getClass() != String.class) { throw new RuntimeException(String.format("%s: Is not a valid first argument to j... | JoinFunction implements FreeFunction { @Override public Object call(Object... args) { if (args.length != 2) { throw new RuntimeException(String.format("Invalid number of arguments (%s) supplied to a join function", args.length)); } else if (args[0].getClass() != String.class) { throw new RuntimeException(String.format(... | JoinFunction implements FreeFunction { @Override public Object call(Object... args) { if (args.length != 2) { throw new RuntimeException(String.format("Invalid number of arguments (%s) supplied to a join function", args.length)); } else if (args[0].getClass() != String.class) { throw new RuntimeException(String.format(... | JoinFunction implements FreeFunction { @Override public Object call(Object... args) { if (args.length != 2) { throw new RuntimeException(String.format("Invalid number of arguments (%s) supplied to a join function", args.length)); } else if (args[0].getClass() != String.class) { throw new RuntimeException(String.format(... | JoinFunction implements FreeFunction { @Override public Object call(Object... args) { if (args.length != 2) { throw new RuntimeException(String.format("Invalid number of arguments (%s) supplied to a join function", args.length)); } else if (args[0].getClass() != String.class) { throw new RuntimeException(String.format(... |
@Test(expected = RuntimeException.class) public void testThrowsWhenCalledWithInvalidNumberOfArguments() { final JoinFunction joinFunction = new JoinFunction(); joinFunction.call(","); joinFunction.call(",", generateTestData(), new Object()); } | @Override public Object call(Object... args) { if (args.length != 2) { throw new RuntimeException(String.format("Invalid number of arguments (%s) supplied to a join function", args.length)); } else if (args[0].getClass() != String.class) { throw new RuntimeException(String.format("%s: Is not a valid first argument to j... | JoinFunction implements FreeFunction { @Override public Object call(Object... args) { if (args.length != 2) { throw new RuntimeException(String.format("Invalid number of arguments (%s) supplied to a join function", args.length)); } else if (args[0].getClass() != String.class) { throw new RuntimeException(String.format(... | JoinFunction implements FreeFunction { @Override public Object call(Object... args) { if (args.length != 2) { throw new RuntimeException(String.format("Invalid number of arguments (%s) supplied to a join function", args.length)); } else if (args[0].getClass() != String.class) { throw new RuntimeException(String.format(... | JoinFunction implements FreeFunction { @Override public Object call(Object... args) { if (args.length != 2) { throw new RuntimeException(String.format("Invalid number of arguments (%s) supplied to a join function", args.length)); } else if (args[0].getClass() != String.class) { throw new RuntimeException(String.format(... | JoinFunction implements FreeFunction { @Override public Object call(Object... args) { if (args.length != 2) { throw new RuntimeException(String.format("Invalid number of arguments (%s) supplied to a join function", args.length)); } else if (args[0].getClass() != String.class) { throw new RuntimeException(String.format(... |
@Test(expected = RuntimeException.class) public void testCallingFunctionWithMoreThanOneArgThrowsException() throws Exception { final ToStringFunction f = new ToStringFunction(); f.call(new Object(), new Object()); } | @Override public Object call(Object... args) { if (args.length != 1) { throw new RuntimeException(String.format("Incorrect number of arguments (%s), expected 1", args.length)); } else { return args[0].toString(); } } | ToStringFunction implements FreeFunction { @Override public Object call(Object... args) { if (args.length != 1) { throw new RuntimeException(String.format("Incorrect number of arguments (%s), expected 1", args.length)); } else { return args[0].toString(); } } } | ToStringFunction implements FreeFunction { @Override public Object call(Object... args) { if (args.length != 1) { throw new RuntimeException(String.format("Incorrect number of arguments (%s), expected 1", args.length)); } else { return args[0].toString(); } } } | ToStringFunction implements FreeFunction { @Override public Object call(Object... args) { if (args.length != 1) { throw new RuntimeException(String.format("Incorrect number of arguments (%s), expected 1", args.length)); } else { return args[0].toString(); } } @Override Object call(Object... args); } | ToStringFunction implements FreeFunction { @Override public Object call(Object... args) { if (args.length != 1) { throw new RuntimeException(String.format("Incorrect number of arguments (%s), expected 1", args.length)); } else { return args[0].toString(); } } @Override Object call(Object... args); } |
@Test public void testFetchJobSpecSummariesCallsTheDAOWithThePageIfSpecified() throws IOException { final int numEntries = TestHelpers.randomIntBetween(50 * DEFAULT_PAGE_SIZE, 100 * DEFAULT_PAGE_SIZE); final List<JobSpecSummary> jobSpecSummariesReturnedByDAO = generateNJobSpecSummaries(numEntries); final JobSpecDAO job... | @GET @Operation( summary = "Get summaries of the job specs exposed by the system", description = "Returns an object that contains summaries of *some* of the job specs exposed by the system. " + "The response does not necessarily contain summaries for *all* job specs exposed by the system. " + "This is because paginatio... | JobSpecResource { @GET @Operation( summary = "Get summaries of the job specs exposed by the system", description = "Returns an object that contains summaries of *some* of the job specs exposed by the system. " + "The response does not necessarily contain summaries for *all* job specs exposed by the system. " + "This is... | JobSpecResource { @GET @Operation( summary = "Get summaries of the job specs exposed by the system", description = "Returns an object that contains summaries of *some* of the job specs exposed by the system. " + "The response does not necessarily contain summaries for *all* job specs exposed by the system. " + "This is... | JobSpecResource { @GET @Operation( summary = "Get summaries of the job specs exposed by the system", description = "Returns an object that contains summaries of *some* of the job specs exposed by the system. " + "The response does not necessarily contain summaries for *all* job specs exposed by the system. " + "This is... | JobSpecResource { @GET @Operation( summary = "Get summaries of the job specs exposed by the system", description = "Returns an object that contains summaries of *some* of the job specs exposed by the system. " + "The response does not necessarily contain summaries for *all* job specs exposed by the system. " + "This is... |
@Test public void testCallingFunctionWithOneArgResultsInToStringOfThatArg() { final ToStringFunction f = new ToStringFunction(); final Integer input = TestHelpers.randomIntBetween(50, 100000); final Object output = f.call(input); assertThat(output).isInstanceOf(String.class); assertThat(output).isEqualTo(input.toString... | @Override public Object call(Object... args) { if (args.length != 1) { throw new RuntimeException(String.format("Incorrect number of arguments (%s), expected 1", args.length)); } else { return args[0].toString(); } } | ToStringFunction implements FreeFunction { @Override public Object call(Object... args) { if (args.length != 1) { throw new RuntimeException(String.format("Incorrect number of arguments (%s), expected 1", args.length)); } else { return args[0].toString(); } } } | ToStringFunction implements FreeFunction { @Override public Object call(Object... args) { if (args.length != 1) { throw new RuntimeException(String.format("Incorrect number of arguments (%s), expected 1", args.length)); } else { return args[0].toString(); } } } | ToStringFunction implements FreeFunction { @Override public Object call(Object... args) { if (args.length != 1) { throw new RuntimeException(String.format("Incorrect number of arguments (%s), expected 1", args.length)); } else { return args[0].toString(); } } @Override Object call(Object... args); } | ToStringFunction implements FreeFunction { @Override public Object call(Object... args) { if (args.length != 1) { throw new RuntimeException(String.format("Incorrect number of arguments (%s), expected 1", args.length)); } else { return args[0].toString(); } } @Override Object call(Object... args); } |
@Test public void testDefaultsNameWhenNameIsMissing() { final FileInput fi = TestHelpers.readJSONFixture( "fixtures/jobinputs/file/valid-but-missing-name.json", FileInput.class); assertThat(fi.getFilename()).isEqualTo("unnamed"); } | public String getFilename() { return this.filename; } | FileInput implements JobInput { public String getFilename() { return this.filename; } } | FileInput implements JobInput { public String getFilename() { return this.filename; } @JsonCreator FileInput(@JsonProperty(value = "filename") String filename,
@JsonProperty(value = "data", required = true) String b64data); FileInput(String filename,
byte[] b64data); } | FileInput implements JobInput { public String getFilename() { return this.filename; } @JsonCreator FileInput(@JsonProperty(value = "filename") String filename,
@JsonProperty(value = "data", required = true) String b64data); FileInput(String filename,
byte[] b64data); byte[] g... | FileInput implements JobInput { public String getFilename() { return this.filename; } @JsonCreator FileInput(@JsonProperty(value = "filename") String filename,
@JsonProperty(value = "data", required = true) String b64data); FileInput(String filename,
byte[] b64data); byte[] g... |
@Test public void testGetJobSpecDetailsByIdReturnsEmptyOptionalIfJobSpecIdDoesntExistInTheDir() throws IOException { final Path jobSpecsDir = createTmpDir(FilesystemJobSpecDAOTest.class); final FilesystemJobSpecDAO filesystemJobSpecDAO = new FilesystemJobSpecDAO(jobSpecsDir); final JobSpecId jobSpecId = new JobSpecId(g... | @Override public Optional<JobSpecSummary> getJobSpecSummaryById(JobSpecId jobSpecId) { return getJobSpecById(jobSpecId).map(JobSpec::toSummary); } | FilesystemJobSpecDAO implements JobSpecDAO { @Override public Optional<JobSpecSummary> getJobSpecSummaryById(JobSpecId jobSpecId) { return getJobSpecById(jobSpecId).map(JobSpec::toSummary); } } | FilesystemJobSpecDAO implements JobSpecDAO { @Override public Optional<JobSpecSummary> getJobSpecSummaryById(JobSpecId jobSpecId) { return getJobSpecById(jobSpecId).map(JobSpec::toSummary); } FilesystemJobSpecDAO(Path jobSpecsDir); } | FilesystemJobSpecDAO implements JobSpecDAO { @Override public Optional<JobSpecSummary> getJobSpecSummaryById(JobSpecId jobSpecId) { return getJobSpecById(jobSpecId).map(JobSpec::toSummary); } FilesystemJobSpecDAO(Path jobSpecsDir); @Override Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId); @Override Map<String, H... | FilesystemJobSpecDAO implements JobSpecDAO { @Override public Optional<JobSpecSummary> getJobSpecSummaryById(JobSpecId jobSpecId) { return getJobSpecById(jobSpecId).map(JobSpec::toSummary); } FilesystemJobSpecDAO(Path jobSpecsDir); @Override Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId); @Override Map<String, H... |
@Test public void testGetJobSpecDetailsByIdLoadsJobSpecDetailsFromTheDirectory() throws IOException { final Path jobSpecsDir = createTmpDir(FilesystemJobSpecDAOTest.class); final JobSpecId jobSpecId = new JobSpecId("test"); final Path jobSpecPath = jobSpecsDir.resolve(jobSpecId.toString()); createDirectory(jobSpecPath)... | @Override public Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId) { final Path jobSpecDir = jobSpecsDir.resolve(jobSpecId.toString()); if (!jobSpecDir.toFile().exists()) { return Optional.empty(); } else if (!jobSpecDir.toFile().isDirectory()) { log.error(jobSpecDir.toString() + ": is not a directory"); return Opt... | FilesystemJobSpecDAO implements JobSpecDAO { @Override public Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId) { final Path jobSpecDir = jobSpecsDir.resolve(jobSpecId.toString()); if (!jobSpecDir.toFile().exists()) { return Optional.empty(); } else if (!jobSpecDir.toFile().isDirectory()) { log.error(jobSpecDir.toS... | FilesystemJobSpecDAO implements JobSpecDAO { @Override public Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId) { final Path jobSpecDir = jobSpecsDir.resolve(jobSpecId.toString()); if (!jobSpecDir.toFile().exists()) { return Optional.empty(); } else if (!jobSpecDir.toFile().isDirectory()) { log.error(jobSpecDir.toS... | FilesystemJobSpecDAO implements JobSpecDAO { @Override public Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId) { final Path jobSpecDir = jobSpecsDir.resolve(jobSpecId.toString()); if (!jobSpecDir.toFile().exists()) { return Optional.empty(); } else if (!jobSpecDir.toFile().isDirectory()) { log.error(jobSpecDir.toS... | FilesystemJobSpecDAO implements JobSpecDAO { @Override public Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId) { final Path jobSpecDir = jobSpecsDir.resolve(jobSpecId.toString()); if (!jobSpecDir.toFile().exists()) { return Optional.empty(); } else if (!jobSpecDir.toFile().isDirectory()) { log.error(jobSpecDir.toS... |
@Test public void testGetJobSpecConfigurationByIdReturnsEmptyOptionalIfJobSpecDoesNotExist() throws IOException { final Path jobSpecsDir = Files.createTempDirectory(FilesystemJobSpecDAOTest.class.getSimpleName()); final FilesystemJobSpecDAO filesystemJobSpecDAO = new FilesystemJobSpecDAO(jobSpecsDir); final JobSpecId j... | @Override public Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId) { final Path jobSpecDir = jobSpecsDir.resolve(jobSpecId.toString()); if (!jobSpecDir.toFile().exists()) { return Optional.empty(); } else if (!jobSpecDir.toFile().isDirectory()) { log.error(jobSpecDir.toString() + ": is not a directory"); return Opt... | FilesystemJobSpecDAO implements JobSpecDAO { @Override public Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId) { final Path jobSpecDir = jobSpecsDir.resolve(jobSpecId.toString()); if (!jobSpecDir.toFile().exists()) { return Optional.empty(); } else if (!jobSpecDir.toFile().isDirectory()) { log.error(jobSpecDir.toS... | FilesystemJobSpecDAO implements JobSpecDAO { @Override public Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId) { final Path jobSpecDir = jobSpecsDir.resolve(jobSpecId.toString()); if (!jobSpecDir.toFile().exists()) { return Optional.empty(); } else if (!jobSpecDir.toFile().isDirectory()) { log.error(jobSpecDir.toS... | FilesystemJobSpecDAO implements JobSpecDAO { @Override public Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId) { final Path jobSpecDir = jobSpecsDir.resolve(jobSpecId.toString()); if (!jobSpecDir.toFile().exists()) { return Optional.empty(); } else if (!jobSpecDir.toFile().isDirectory()) { log.error(jobSpecDir.toS... | FilesystemJobSpecDAO implements JobSpecDAO { @Override public Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId) { final Path jobSpecDir = jobSpecsDir.resolve(jobSpecId.toString()); if (!jobSpecDir.toFile().exists()) { return Optional.empty(); } else if (!jobSpecDir.toFile().isDirectory()) { log.error(jobSpecDir.toS... |
@Test public void testGetJobSpecConfigurationByIdReturnsLoadsAJobSpecConfigurationFromTheDirectory() throws IOException { final Path jobSpecsDir = Files.createTempDirectory(FilesystemJobSpecDAOTest.class.getSimpleName()); final JobSpecId jobSpecId = new JobSpecId("test"); final Path jobSpecPath = jobSpecsDir.resolve(jo... | @Override public Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId) { final Path jobSpecDir = jobSpecsDir.resolve(jobSpecId.toString()); if (!jobSpecDir.toFile().exists()) { return Optional.empty(); } else if (!jobSpecDir.toFile().isDirectory()) { log.error(jobSpecDir.toString() + ": is not a directory"); return Opt... | FilesystemJobSpecDAO implements JobSpecDAO { @Override public Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId) { final Path jobSpecDir = jobSpecsDir.resolve(jobSpecId.toString()); if (!jobSpecDir.toFile().exists()) { return Optional.empty(); } else if (!jobSpecDir.toFile().isDirectory()) { log.error(jobSpecDir.toS... | FilesystemJobSpecDAO implements JobSpecDAO { @Override public Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId) { final Path jobSpecDir = jobSpecsDir.resolve(jobSpecId.toString()); if (!jobSpecDir.toFile().exists()) { return Optional.empty(); } else if (!jobSpecDir.toFile().isDirectory()) { log.error(jobSpecDir.toS... | FilesystemJobSpecDAO implements JobSpecDAO { @Override public Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId) { final Path jobSpecDir = jobSpecsDir.resolve(jobSpecId.toString()); if (!jobSpecDir.toFile().exists()) { return Optional.empty(); } else if (!jobSpecDir.toFile().isDirectory()) { log.error(jobSpecDir.toS... | FilesystemJobSpecDAO implements JobSpecDAO { @Override public Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId) { final Path jobSpecDir = jobSpecsDir.resolve(jobSpecId.toString()); if (!jobSpecDir.toFile().exists()) { return Optional.empty(); } else if (!jobSpecDir.toFile().isDirectory()) { log.error(jobSpecDir.toS... |
@Test public void testJobSpecConfigurationDependencyPathsAreResolvedRelativeToTheJobSpecFolderAsAbsolutePaths() throws IOException { final Path jobSpecsDir = Files.createTempDirectory(FilesystemJobSpecDAOTest.class.getSimpleName()); final JobSpecId jobSpecId = new JobSpecId("test"); final Path jobSpecPath = jobSpecsDir... | @Override public Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId) { final Path jobSpecDir = jobSpecsDir.resolve(jobSpecId.toString()); if (!jobSpecDir.toFile().exists()) { return Optional.empty(); } else if (!jobSpecDir.toFile().isDirectory()) { log.error(jobSpecDir.toString() + ": is not a directory"); return Opt... | FilesystemJobSpecDAO implements JobSpecDAO { @Override public Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId) { final Path jobSpecDir = jobSpecsDir.resolve(jobSpecId.toString()); if (!jobSpecDir.toFile().exists()) { return Optional.empty(); } else if (!jobSpecDir.toFile().isDirectory()) { log.error(jobSpecDir.toS... | FilesystemJobSpecDAO implements JobSpecDAO { @Override public Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId) { final Path jobSpecDir = jobSpecsDir.resolve(jobSpecId.toString()); if (!jobSpecDir.toFile().exists()) { return Optional.empty(); } else if (!jobSpecDir.toFile().isDirectory()) { log.error(jobSpecDir.toS... | FilesystemJobSpecDAO implements JobSpecDAO { @Override public Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId) { final Path jobSpecDir = jobSpecsDir.resolve(jobSpecId.toString()); if (!jobSpecDir.toFile().exists()) { return Optional.empty(); } else if (!jobSpecDir.toFile().isDirectory()) { log.error(jobSpecDir.toS... | FilesystemJobSpecDAO implements JobSpecDAO { @Override public Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId) { final Path jobSpecDir = jobSpecsDir.resolve(jobSpecId.toString()); if (!jobSpecDir.toFile().exists()) { return Optional.empty(); } else if (!jobSpecDir.toFile().isDirectory()) { log.error(jobSpecDir.toS... |
@Test(expected = IllegalArgumentException.class) public void testGetJobSpecSummariesWithQueryThrowsInvalidArgumentExceptionIfPageSizeIsNegative() throws IOException { final Path jobSpecsDir = Files.createTempDirectory(FilesystemJobSpecDAOTest.class.getSimpleName()); final FilesystemJobSpecDAO filesystemJobSpecDAO = new... | @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } | FilesystemJobSpecDAO implements JobSpecDAO { @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } } | FilesystemJobSpecDAO implements JobSpecDAO { @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } FilesystemJobSpecDAO(Path jobSpecsDir); } | FilesystemJobSpecDAO implements JobSpecDAO { @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } FilesystemJobSpecDAO(Path jobSpecsDir); @Override Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId); @Override Map<String, HealthCheck> g... | FilesystemJobSpecDAO implements JobSpecDAO { @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } FilesystemJobSpecDAO(Path jobSpecsDir); @Override Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId); @Override Map<String, HealthCheck> g... |
@Test(expected = IllegalArgumentException.class) public void testGetJobSpecSummariesWithQueryThrowsInvalidArgumentExceptionIfPageIsNegative() throws IOException { final Path jobSpecsDir = Files.createTempDirectory(FilesystemJobSpecDAOTest.class.getSimpleName()); final FilesystemJobSpecDAO filesystemJobSpecDAO = new Fil... | @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } | FilesystemJobSpecDAO implements JobSpecDAO { @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } } | FilesystemJobSpecDAO implements JobSpecDAO { @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } FilesystemJobSpecDAO(Path jobSpecsDir); } | FilesystemJobSpecDAO implements JobSpecDAO { @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } FilesystemJobSpecDAO(Path jobSpecsDir); @Override Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId); @Override Map<String, HealthCheck> g... | FilesystemJobSpecDAO implements JobSpecDAO { @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } FilesystemJobSpecDAO(Path jobSpecsDir); @Override Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId); @Override Map<String, HealthCheck> g... |
@Test(expected = NullPointerException.class) public void testGetJobSpecSummariesWithQueryThrowsNPEIfQueryIsNull() throws IOException { final Path jobSpecsDir = Files.createTempDirectory(FilesystemJobSpecDAOTest.class.getSimpleName()); final FilesystemJobSpecDAO filesystemJobSpecDAO = new FilesystemJobSpecDAO(jobSpecsDi... | @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } | FilesystemJobSpecDAO implements JobSpecDAO { @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } } | FilesystemJobSpecDAO implements JobSpecDAO { @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } FilesystemJobSpecDAO(Path jobSpecsDir); } | FilesystemJobSpecDAO implements JobSpecDAO { @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } FilesystemJobSpecDAO(Path jobSpecsDir); @Override Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId); @Override Map<String, HealthCheck> g... | FilesystemJobSpecDAO implements JobSpecDAO { @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } FilesystemJobSpecDAO(Path jobSpecsDir); @Override Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId); @Override Map<String, HealthCheck> g... |
@Test(expected = WebApplicationException.class) public void testFetchJobSpecSummariesThrowsWebApplicationExceptionIfPageIsNegative() throws IOException { final List<JobSpecSummary> jobSpecSummariesReturnedByDAO = generateNJobSpecSummaries(5); final JobSpecDAO jobSpecDAO = mock(JobSpecDAO.class); when(jobSpecDAO.getJobS... | @GET @Operation( summary = "Get summaries of the job specs exposed by the system", description = "Returns an object that contains summaries of *some* of the job specs exposed by the system. " + "The response does not necessarily contain summaries for *all* job specs exposed by the system. " + "This is because paginatio... | JobSpecResource { @GET @Operation( summary = "Get summaries of the job specs exposed by the system", description = "Returns an object that contains summaries of *some* of the job specs exposed by the system. " + "The response does not necessarily contain summaries for *all* job specs exposed by the system. " + "This is... | JobSpecResource { @GET @Operation( summary = "Get summaries of the job specs exposed by the system", description = "Returns an object that contains summaries of *some* of the job specs exposed by the system. " + "The response does not necessarily contain summaries for *all* job specs exposed by the system. " + "This is... | JobSpecResource { @GET @Operation( summary = "Get summaries of the job specs exposed by the system", description = "Returns an object that contains summaries of *some* of the job specs exposed by the system. " + "The response does not necessarily contain summaries for *all* job specs exposed by the system. " + "This is... | JobSpecResource { @GET @Operation( summary = "Get summaries of the job specs exposed by the system", description = "Returns an object that contains summaries of *some* of the job specs exposed by the system. " + "The response does not necessarily contain summaries for *all* job specs exposed by the system. " + "This is... |
@Test public void testGetJobSpecSummariesWithQueryReturnsAList() throws IOException { final Path jobSpecsDir = Files.createTempDirectory(FilesystemJobSpecDAOTest.class.getSimpleName()); final FilesystemJobSpecDAO filesystemJobSpecDAO = new FilesystemJobSpecDAO(jobSpecsDir); final List<JobSpecSummary> jobSpecSummaries =... | @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } | FilesystemJobSpecDAO implements JobSpecDAO { @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } } | FilesystemJobSpecDAO implements JobSpecDAO { @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } FilesystemJobSpecDAO(Path jobSpecsDir); } | FilesystemJobSpecDAO implements JobSpecDAO { @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } FilesystemJobSpecDAO(Path jobSpecsDir); @Override Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId); @Override Map<String, HealthCheck> g... | FilesystemJobSpecDAO implements JobSpecDAO { @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } FilesystemJobSpecDAO(Path jobSpecsDir); @Override Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId); @Override Map<String, HealthCheck> g... |
@Test public void testGetJobSpecSummariesWithQueryReturnsOnlyTheNumberOfEntriesSpecifiedByPageSize() throws IOException { final Path jobSpecsDir = Files.createTempDirectory(FilesystemJobSpecDAOTest.class.getSimpleName()); final int pageSize = 10; final int numberOfSpecs = pageSize * 3; final String jobSpecConfiguration... | @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } | FilesystemJobSpecDAO implements JobSpecDAO { @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } } | FilesystemJobSpecDAO implements JobSpecDAO { @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } FilesystemJobSpecDAO(Path jobSpecsDir); } | FilesystemJobSpecDAO implements JobSpecDAO { @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } FilesystemJobSpecDAO(Path jobSpecsDir); @Override Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId); @Override Map<String, HealthCheck> g... | FilesystemJobSpecDAO implements JobSpecDAO { @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } FilesystemJobSpecDAO(Path jobSpecsDir); @Override Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId); @Override Map<String, HealthCheck> g... |
@Test(expected = IllegalArgumentException.class) public void testGetJobSpecSummariesWithoutQueryThrowsInvalidArgumentExceptionIfPageSizeIsNegative() throws IOException { final Path jobSpecsDir = Files.createTempDirectory(FilesystemJobSpecDAOTest.class.getSimpleName()); final FilesystemJobSpecDAO filesystemJobSpecDAO = ... | @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } | FilesystemJobSpecDAO implements JobSpecDAO { @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } } | FilesystemJobSpecDAO implements JobSpecDAO { @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } FilesystemJobSpecDAO(Path jobSpecsDir); } | FilesystemJobSpecDAO implements JobSpecDAO { @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } FilesystemJobSpecDAO(Path jobSpecsDir); @Override Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId); @Override Map<String, HealthCheck> g... | FilesystemJobSpecDAO implements JobSpecDAO { @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } FilesystemJobSpecDAO(Path jobSpecsDir); @Override Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId); @Override Map<String, HealthCheck> g... |
@Test(expected = IllegalArgumentException.class) public void testGetJobSpecSummariesWithoutQueryThrowsInvalidArgumentExceptionIfPageIsNegative() throws IOException { final Path jobSpecsDir = Files.createTempDirectory(FilesystemJobSpecDAOTest.class.getSimpleName()); final FilesystemJobSpecDAO filesystemJobSpecDAO = new ... | @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } | FilesystemJobSpecDAO implements JobSpecDAO { @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } } | FilesystemJobSpecDAO implements JobSpecDAO { @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } FilesystemJobSpecDAO(Path jobSpecsDir); } | FilesystemJobSpecDAO implements JobSpecDAO { @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } FilesystemJobSpecDAO(Path jobSpecsDir); @Override Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId); @Override Map<String, HealthCheck> g... | FilesystemJobSpecDAO implements JobSpecDAO { @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } FilesystemJobSpecDAO(Path jobSpecsDir); @Override Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId); @Override Map<String, HealthCheck> g... |
@Test public void testGetJobSpecSummariesWithoutQueryReturnsAList() throws IOException { final Path jobSpecsDir = Files.createTempDirectory(FilesystemJobSpecDAOTest.class.getSimpleName()); final FilesystemJobSpecDAO filesystemJobSpecDAO = new FilesystemJobSpecDAO(jobSpecsDir); final List<JobSpecSummary> jobSpecSummarie... | @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } | FilesystemJobSpecDAO implements JobSpecDAO { @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } } | FilesystemJobSpecDAO implements JobSpecDAO { @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } FilesystemJobSpecDAO(Path jobSpecsDir); } | FilesystemJobSpecDAO implements JobSpecDAO { @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } FilesystemJobSpecDAO(Path jobSpecsDir); @Override Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId); @Override Map<String, HealthCheck> g... | FilesystemJobSpecDAO implements JobSpecDAO { @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } FilesystemJobSpecDAO(Path jobSpecsDir); @Override Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId); @Override Map<String, HealthCheck> g... |
@Test public void testGetJobSpecSummariesWithoutQueryReturnsOnlyTheNumberOfEntriesSpecifiedByPageSize() throws IOException { final Path jobSpecsDir = Files.createTempDirectory(FilesystemJobSpecDAOTest.class.getSimpleName()); final int pageSize = 10; final int numberOfSpecs = pageSize * 3; final String jobSpecConfigurat... | @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } | FilesystemJobSpecDAO implements JobSpecDAO { @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } } | FilesystemJobSpecDAO implements JobSpecDAO { @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } FilesystemJobSpecDAO(Path jobSpecsDir); } | FilesystemJobSpecDAO implements JobSpecDAO { @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } FilesystemJobSpecDAO(Path jobSpecsDir); @Override Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId); @Override Map<String, HealthCheck> g... | FilesystemJobSpecDAO implements JobSpecDAO { @Override public List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page) { return getJobSpecSummaries(pageSize, page, ""); } FilesystemJobSpecDAO(Path jobSpecsDir); @Override Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId); @Override Map<String, HealthCheck> g... |
@Test public void testGetHealthChecksReturnsHealthCheckThatTestsDiskSpace() throws IOException { final FilesystemJobSpecDAO dao = new FilesystemJobSpecDAO(createTmpDir(FilesystemJobsDAOTest.class)); assertThat(dao.getHealthChecks()).containsKeys(FILESYSTEM_SPECS_DAO_DISK_SPACE_HEALTHCHECK); assertThat(dao.getHealthChec... | @Override public Map<String, HealthCheck> getHealthChecks() { return singletonMap( FILESYSTEM_SPECS_DAO_DISK_SPACE_HEALTHCHECK, new DiskSpaceHealthCheck( jobSpecsDir.toFile(), FILESYSTEM_SPECS_DAO_DISK_SPACE_WARNING_THRESHOLD_IN_BYTES)); } | FilesystemJobSpecDAO implements JobSpecDAO { @Override public Map<String, HealthCheck> getHealthChecks() { return singletonMap( FILESYSTEM_SPECS_DAO_DISK_SPACE_HEALTHCHECK, new DiskSpaceHealthCheck( jobSpecsDir.toFile(), FILESYSTEM_SPECS_DAO_DISK_SPACE_WARNING_THRESHOLD_IN_BYTES)); } } | FilesystemJobSpecDAO implements JobSpecDAO { @Override public Map<String, HealthCheck> getHealthChecks() { return singletonMap( FILESYSTEM_SPECS_DAO_DISK_SPACE_HEALTHCHECK, new DiskSpaceHealthCheck( jobSpecsDir.toFile(), FILESYSTEM_SPECS_DAO_DISK_SPACE_WARNING_THRESHOLD_IN_BYTES)); } FilesystemJobSpecDAO(Path jobSpecsD... | FilesystemJobSpecDAO implements JobSpecDAO { @Override public Map<String, HealthCheck> getHealthChecks() { return singletonMap( FILESYSTEM_SPECS_DAO_DISK_SPACE_HEALTHCHECK, new DiskSpaceHealthCheck( jobSpecsDir.toFile(), FILESYSTEM_SPECS_DAO_DISK_SPACE_WARNING_THRESHOLD_IN_BYTES)); } FilesystemJobSpecDAO(Path jobSpecsD... | FilesystemJobSpecDAO implements JobSpecDAO { @Override public Map<String, HealthCheck> getHealthChecks() { return singletonMap( FILESYSTEM_SPECS_DAO_DISK_SPACE_HEALTHCHECK, new DiskSpaceHealthCheck( jobSpecsDir.toFile(), FILESYSTEM_SPECS_DAO_DISK_SPACE_WARNING_THRESHOLD_IN_BYTES)); } FilesystemJobSpecDAO(Path jobSpecsD... |
@Test public void testGetSpecJobWasSubmittedAgainstReturnsOptionalEmptyIfJobDoesntExist() throws IOException { final Path jobsDir = createTmpDir(FilesystemJobsDAOTest.class); final FilesystemJobsDAO dao = createStandardFilesystemDAO(jobsDir); assertThat(dao.getSpecJobWasSubmittedAgainst(generateJobId())).isNotPresent()... | @Override public Optional<JobSpec> getSpecJobWasSubmittedAgainst(JobId jobId) { return resolveJobDir(jobId).map(Path::toFile).flatMap(this::loadJobSpec); } | FilesystemJobsDAO implements JobDAO { @Override public Optional<JobSpec> getSpecJobWasSubmittedAgainst(JobId jobId) { return resolveJobDir(jobId).map(Path::toFile).flatMap(this::loadJobSpec); } } | FilesystemJobsDAO implements JobDAO { @Override public Optional<JobSpec> getSpecJobWasSubmittedAgainst(JobId jobId) { return resolveJobDir(jobId).map(Path::toFile).flatMap(this::loadJobSpec); } FilesystemJobsDAO(Path jobsDirectory, IdGenerator idGenerator); } | FilesystemJobsDAO implements JobDAO { @Override public Optional<JobSpec> getSpecJobWasSubmittedAgainst(JobId jobId) { return resolveJobDir(jobId).map(Path::toFile).flatMap(this::loadJobSpec); } FilesystemJobsDAO(Path jobsDirectory, IdGenerator idGenerator); @Override boolean jobExists(JobId jobId); @Override List<JobDe... | FilesystemJobsDAO implements JobDAO { @Override public Optional<JobSpec> getSpecJobWasSubmittedAgainst(JobId jobId) { return resolveJobDir(jobId).map(Path::toFile).flatMap(this::loadJobSpec); } FilesystemJobsDAO(Path jobsDirectory, IdGenerator idGenerator); @Override boolean jobExists(JobId jobId); @Override List<JobDe... |
@Test public void testPersistJobOutputOutputFolderDoesNotExistBeforePersisting() throws IOException { final Path jobsDir = createTmpDir(FilesystemJobsDAOTest.class); final FilesystemJobsDAO dao = createStandardFilesystemDAO(jobsDir); final JobId jobId = dao.persist(STANDARD_VALID_REQUEST).getId(); assertThat(jobsDir.re... | @Override public PersistedJob persist(ValidJobRequest validJobRequest) { final JobId jobId = generateUniqueJobId(); final PersistedJob persistedJob = PersistedJob.createFromValidRequest(validJobRequest, jobId); createNewJobDirectory(persistedJob); return persistedJob; } | FilesystemJobsDAO implements JobDAO { @Override public PersistedJob persist(ValidJobRequest validJobRequest) { final JobId jobId = generateUniqueJobId(); final PersistedJob persistedJob = PersistedJob.createFromValidRequest(validJobRequest, jobId); createNewJobDirectory(persistedJob); return persistedJob; } } | FilesystemJobsDAO implements JobDAO { @Override public PersistedJob persist(ValidJobRequest validJobRequest) { final JobId jobId = generateUniqueJobId(); final PersistedJob persistedJob = PersistedJob.createFromValidRequest(validJobRequest, jobId); createNewJobDirectory(persistedJob); return persistedJob; } FilesystemJ... | FilesystemJobsDAO implements JobDAO { @Override public PersistedJob persist(ValidJobRequest validJobRequest) { final JobId jobId = generateUniqueJobId(); final PersistedJob persistedJob = PersistedJob.createFromValidRequest(validJobRequest, jobId); createNewJobDirectory(persistedJob); return persistedJob; } FilesystemJ... | FilesystemJobsDAO implements JobDAO { @Override public PersistedJob persist(ValidJobRequest validJobRequest) { final JobId jobId = generateUniqueJobId(); final PersistedJob persistedJob = PersistedJob.createFromValidRequest(validJobRequest, jobId); createNewJobDirectory(persistedJob); return persistedJob; } FilesystemJ... |
@Test(expected = RuntimeException.class) public void testPersistJobOutputThrowsIfJobDoesNotExist() throws IOException { final Path jobsDir = createTmpDir(FilesystemJobsDAOTest.class); final FilesystemJobsDAO dao = createStandardFilesystemDAO(jobsDir); dao.persistOutput(generateJobId(), generateRandomJobOutput()); } | @Override public void persistOutput(JobId jobId, JobOutput jobOutput) { final Optional<Path> maybeJobDir = resolveJobDir(jobId); if (!maybeJobDir.isPresent()) throw new RuntimeException(jobOutput.getId() + ": cannot be persisted to job " + jobId + ": job dir does not exist"); final Path outputsDir = maybeJobDir.get().r... | FilesystemJobsDAO implements JobDAO { @Override public void persistOutput(JobId jobId, JobOutput jobOutput) { final Optional<Path> maybeJobDir = resolveJobDir(jobId); if (!maybeJobDir.isPresent()) throw new RuntimeException(jobOutput.getId() + ": cannot be persisted to job " + jobId + ": job dir does not exist"); final... | FilesystemJobsDAO implements JobDAO { @Override public void persistOutput(JobId jobId, JobOutput jobOutput) { final Optional<Path> maybeJobDir = resolveJobDir(jobId); if (!maybeJobDir.isPresent()) throw new RuntimeException(jobOutput.getId() + ": cannot be persisted to job " + jobId + ": job dir does not exist"); final... | FilesystemJobsDAO implements JobDAO { @Override public void persistOutput(JobId jobId, JobOutput jobOutput) { final Optional<Path> maybeJobDir = resolveJobDir(jobId); if (!maybeJobDir.isPresent()) throw new RuntimeException(jobOutput.getId() + ": cannot be persisted to job " + jobId + ": job dir does not exist"); final... | FilesystemJobsDAO implements JobDAO { @Override public void persistOutput(JobId jobId, JobOutput jobOutput) { final Optional<Path> maybeJobDir = resolveJobDir(jobId); if (!maybeJobDir.isPresent()) throw new RuntimeException(jobOutput.getId() + ": cannot be persisted to job " + jobId + ": job dir does not exist"); final... |
@Test public void testFetchJobSpecSummariesCallsTheDAOWithTheQuerySpecified() throws IOException { final List<JobSpecSummary> jobSpecSummariesReturnedByDAO = generateNJobSpecSummaries(5); final JobSpecDAO jobSpecDAO = mock(JobSpecDAO.class); when(jobSpecDAO.getJobSpecSummaries(anyInt(), anyInt())).thenReturn(jobSpecSum... | @GET @Operation( summary = "Get summaries of the job specs exposed by the system", description = "Returns an object that contains summaries of *some* of the job specs exposed by the system. " + "The response does not necessarily contain summaries for *all* job specs exposed by the system. " + "This is because paginatio... | JobSpecResource { @GET @Operation( summary = "Get summaries of the job specs exposed by the system", description = "Returns an object that contains summaries of *some* of the job specs exposed by the system. " + "The response does not necessarily contain summaries for *all* job specs exposed by the system. " + "This is... | JobSpecResource { @GET @Operation( summary = "Get summaries of the job specs exposed by the system", description = "Returns an object that contains summaries of *some* of the job specs exposed by the system. " + "The response does not necessarily contain summaries for *all* job specs exposed by the system. " + "This is... | JobSpecResource { @GET @Operation( summary = "Get summaries of the job specs exposed by the system", description = "Returns an object that contains summaries of *some* of the job specs exposed by the system. " + "The response does not necessarily contain summaries for *all* job specs exposed by the system. " + "This is... | JobSpecResource { @GET @Operation( summary = "Get summaries of the job specs exposed by the system", description = "Returns an object that contains summaries of *some* of the job specs exposed by the system. " + "The response does not necessarily contain summaries for *all* job specs exposed by the system. " + "This is... |
@Test public void testGetHealthChecksReturnsHealthChecksForRemainingDiskSpace() { final FilesystemJobsDAO dao = createStandardFilesystemDAO(); assertThat(dao.getHealthChecks()).containsKey(FILESYSTEM_JOBS_DAO_DISK_SPACE_HEALTHCHECK); assertThat(dao.getHealthChecks().get(FILESYSTEM_JOBS_DAO_DISK_SPACE_HEALTHCHECK)).isNo... | @Override public Map<String, HealthCheck> getHealthChecks() { return singletonMap( FILESYSTEM_JOBS_DAO_DISK_SPACE_HEALTHCHECK, new DiskSpaceHealthCheck( this.jobsDirectory.toFile(), FILESYSTEM_JOBS_DAO_DISK_SPACE_WARNING_THRESHOLD_IN_BYTES)); } | FilesystemJobsDAO implements JobDAO { @Override public Map<String, HealthCheck> getHealthChecks() { return singletonMap( FILESYSTEM_JOBS_DAO_DISK_SPACE_HEALTHCHECK, new DiskSpaceHealthCheck( this.jobsDirectory.toFile(), FILESYSTEM_JOBS_DAO_DISK_SPACE_WARNING_THRESHOLD_IN_BYTES)); } } | FilesystemJobsDAO implements JobDAO { @Override public Map<String, HealthCheck> getHealthChecks() { return singletonMap( FILESYSTEM_JOBS_DAO_DISK_SPACE_HEALTHCHECK, new DiskSpaceHealthCheck( this.jobsDirectory.toFile(), FILESYSTEM_JOBS_DAO_DISK_SPACE_WARNING_THRESHOLD_IN_BYTES)); } FilesystemJobsDAO(Path jobsDirectory,... | FilesystemJobsDAO implements JobDAO { @Override public Map<String, HealthCheck> getHealthChecks() { return singletonMap( FILESYSTEM_JOBS_DAO_DISK_SPACE_HEALTHCHECK, new DiskSpaceHealthCheck( this.jobsDirectory.toFile(), FILESYSTEM_JOBS_DAO_DISK_SPACE_WARNING_THRESHOLD_IN_BYTES)); } FilesystemJobsDAO(Path jobsDirectory,... | FilesystemJobsDAO implements JobDAO { @Override public Map<String, HealthCheck> getHealthChecks() { return singletonMap( FILESYSTEM_JOBS_DAO_DISK_SPACE_HEALTHCHECK, new DiskSpaceHealthCheck( this.jobsDirectory.toFile(), FILESYSTEM_JOBS_DAO_DISK_SPACE_WARNING_THRESHOLD_IN_BYTES)); } FilesystemJobsDAO(Path jobsDirectory,... |
@Test(expected = NullPointerException.class) public void testGetUserDetailsByIdThrowsNPEIfArgsNull() throws IOException { final FilesystemUserDAO dao = new FilesystemUserDAO(tmpFile()); dao.getUserCredentialsById(null); } | @Override public Optional<UserCredentials> getUserCredentialsById(UserId id) { requireNonNull(id); try { return readUserCredentials() .filter(c -> c.getId().equals(id)) .findFirst(); } catch (IOException e) { throw new RuntimeException(e); } } | FilesystemUserDAO implements UserDAO { @Override public Optional<UserCredentials> getUserCredentialsById(UserId id) { requireNonNull(id); try { return readUserCredentials() .filter(c -> c.getId().equals(id)) .findFirst(); } catch (IOException e) { throw new RuntimeException(e); } } } | FilesystemUserDAO implements UserDAO { @Override public Optional<UserCredentials> getUserCredentialsById(UserId id) { requireNonNull(id); try { return readUserCredentials() .filter(c -> c.getId().equals(id)) .findFirst(); } catch (IOException e) { throw new RuntimeException(e); } } FilesystemUserDAO(File usersFile); } | FilesystemUserDAO implements UserDAO { @Override public Optional<UserCredentials> getUserCredentialsById(UserId id) { requireNonNull(id); try { return readUserCredentials() .filter(c -> c.getId().equals(id)) .findFirst(); } catch (IOException e) { throw new RuntimeException(e); } } FilesystemUserDAO(File usersFile); @O... | FilesystemUserDAO implements UserDAO { @Override public Optional<UserCredentials> getUserCredentialsById(UserId id) { requireNonNull(id); try { return readUserCredentials() .filter(c -> c.getId().equals(id)) .findFirst(); } catch (IOException e) { throw new RuntimeException(e); } } FilesystemUserDAO(File usersFile); @O... |
@Test public void testGetUserDetailsByIdReturnsEmptyOptionalForABogusUserId() throws IOException { final FilesystemUserDAO dao = new FilesystemUserDAO(tmpFile()); assertThat(dao.getUserCredentialsById(generateUserId())).isEmpty(); } | @Override public Optional<UserCredentials> getUserCredentialsById(UserId id) { requireNonNull(id); try { return readUserCredentials() .filter(c -> c.getId().equals(id)) .findFirst(); } catch (IOException e) { throw new RuntimeException(e); } } | FilesystemUserDAO implements UserDAO { @Override public Optional<UserCredentials> getUserCredentialsById(UserId id) { requireNonNull(id); try { return readUserCredentials() .filter(c -> c.getId().equals(id)) .findFirst(); } catch (IOException e) { throw new RuntimeException(e); } } } | FilesystemUserDAO implements UserDAO { @Override public Optional<UserCredentials> getUserCredentialsById(UserId id) { requireNonNull(id); try { return readUserCredentials() .filter(c -> c.getId().equals(id)) .findFirst(); } catch (IOException e) { throw new RuntimeException(e); } } FilesystemUserDAO(File usersFile); } | FilesystemUserDAO implements UserDAO { @Override public Optional<UserCredentials> getUserCredentialsById(UserId id) { requireNonNull(id); try { return readUserCredentials() .filter(c -> c.getId().equals(id)) .findFirst(); } catch (IOException e) { throw new RuntimeException(e); } } FilesystemUserDAO(File usersFile); @O... | FilesystemUserDAO implements UserDAO { @Override public Optional<UserCredentials> getUserCredentialsById(UserId id) { requireNonNull(id); try { return readUserCredentials() .filter(c -> c.getId().equals(id)) .findFirst(); } catch (IOException e) { throw new RuntimeException(e); } } FilesystemUserDAO(File usersFile); @O... |
@Test public void testGetUserDetailsByIdReturnsUserDetailsFromFilesystem() throws IOException { final UserCredentials userCredentials = generateUserDetails(); final File usersFile = tmpFile(); Files.write(usersFile.toPath(), userCredentials.toUserFileLine().getBytes()); final FilesystemUserDAO dao = new FilesystemUserD... | @Override public Optional<UserCredentials> getUserCredentialsById(UserId id) { requireNonNull(id); try { return readUserCredentials() .filter(c -> c.getId().equals(id)) .findFirst(); } catch (IOException e) { throw new RuntimeException(e); } } | FilesystemUserDAO implements UserDAO { @Override public Optional<UserCredentials> getUserCredentialsById(UserId id) { requireNonNull(id); try { return readUserCredentials() .filter(c -> c.getId().equals(id)) .findFirst(); } catch (IOException e) { throw new RuntimeException(e); } } } | FilesystemUserDAO implements UserDAO { @Override public Optional<UserCredentials> getUserCredentialsById(UserId id) { requireNonNull(id); try { return readUserCredentials() .filter(c -> c.getId().equals(id)) .findFirst(); } catch (IOException e) { throw new RuntimeException(e); } } FilesystemUserDAO(File usersFile); } | FilesystemUserDAO implements UserDAO { @Override public Optional<UserCredentials> getUserCredentialsById(UserId id) { requireNonNull(id); try { return readUserCredentials() .filter(c -> c.getId().equals(id)) .findFirst(); } catch (IOException e) { throw new RuntimeException(e); } } FilesystemUserDAO(File usersFile); @O... | FilesystemUserDAO implements UserDAO { @Override public Optional<UserCredentials> getUserCredentialsById(UserId id) { requireNonNull(id); try { return readUserCredentials() .filter(c -> c.getId().equals(id)) .findFirst(); } catch (IOException e) { throw new RuntimeException(e); } } FilesystemUserDAO(File usersFile); @O... |
@Test public void testGetUserDetailsByIdReturnsUserDetailsEvenWhenFileContainsBlankLines() throws IOException { final UserCredentials userCredentials = generateUserDetails(); final File usersFile = tmpFile(); final String userLine = userCredentials.toUserFileLine(); final String fileContent = "#somecomment\n\n\n" + use... | @Override public Optional<UserCredentials> getUserCredentialsById(UserId id) { requireNonNull(id); try { return readUserCredentials() .filter(c -> c.getId().equals(id)) .findFirst(); } catch (IOException e) { throw new RuntimeException(e); } } | FilesystemUserDAO implements UserDAO { @Override public Optional<UserCredentials> getUserCredentialsById(UserId id) { requireNonNull(id); try { return readUserCredentials() .filter(c -> c.getId().equals(id)) .findFirst(); } catch (IOException e) { throw new RuntimeException(e); } } } | FilesystemUserDAO implements UserDAO { @Override public Optional<UserCredentials> getUserCredentialsById(UserId id) { requireNonNull(id); try { return readUserCredentials() .filter(c -> c.getId().equals(id)) .findFirst(); } catch (IOException e) { throw new RuntimeException(e); } } FilesystemUserDAO(File usersFile); } | FilesystemUserDAO implements UserDAO { @Override public Optional<UserCredentials> getUserCredentialsById(UserId id) { requireNonNull(id); try { return readUserCredentials() .filter(c -> c.getId().equals(id)) .findFirst(); } catch (IOException e) { throw new RuntimeException(e); } } FilesystemUserDAO(File usersFile); @O... | FilesystemUserDAO implements UserDAO { @Override public Optional<UserCredentials> getUserCredentialsById(UserId id) { requireNonNull(id); try { return readUserCredentials() .filter(c -> c.getId().equals(id)) .findFirst(); } catch (IOException e) { throw new RuntimeException(e); } } FilesystemUserDAO(File usersFile); @O... |
@Test(expected = Throwable.class) public void testCopyPathThrowsIfSourceDoesNotExist() throws IOException { final Path bogusSource = Paths.get(generateAlphanumStr()); final Path realDestination = Files.createTempDirectory(HelpersTest.class.getSimpleName()).resolve("destination"); Helpers.copyPath(bogusSource, realDesti... | public static void copyPath(Path source, Path destination) throws IOException { Files.walkFileTree(source, new SimpleFileVisitor<Path>() { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { Path destinationDir = destination.resolve(source.relativize(dir)); try {... | Helpers { public static void copyPath(Path source, Path destination) throws IOException { Files.walkFileTree(source, new SimpleFileVisitor<Path>() { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { Path destinationDir = destination.resolve(source.relativize(di... | Helpers { public static void copyPath(Path source, Path destination) throws IOException { Files.walkFileTree(source, new SimpleFileVisitor<Path>() { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { Path destinationDir = destination.resolve(source.relativize(di... | Helpers { public static void copyPath(Path source, Path destination) throws IOException { Files.walkFileTree(source, new SimpleFileVisitor<Path>() { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { Path destinationDir = destination.resolve(source.relativize(di... | Helpers { public static void copyPath(Path source, Path destination) throws IOException { Files.walkFileTree(source, new SimpleFileVisitor<Path>() { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { Path destinationDir = destination.resolve(source.relativize(di... |
@Test(expected = Throwable.class) public void testCopyPathThrowsIfDestinationParentDoesNotExist() throws IOException { final Path realSource = Files.createTempFile(generateAlphanumStr(), generateAlphanumStr()); final Path bogusDestination = Paths.get(generateAlphanumStr()).resolve("destination"); Helpers.copyPath(realS... | public static void copyPath(Path source, Path destination) throws IOException { Files.walkFileTree(source, new SimpleFileVisitor<Path>() { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { Path destinationDir = destination.resolve(source.relativize(dir)); try {... | Helpers { public static void copyPath(Path source, Path destination) throws IOException { Files.walkFileTree(source, new SimpleFileVisitor<Path>() { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { Path destinationDir = destination.resolve(source.relativize(di... | Helpers { public static void copyPath(Path source, Path destination) throws IOException { Files.walkFileTree(source, new SimpleFileVisitor<Path>() { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { Path destinationDir = destination.resolve(source.relativize(di... | Helpers { public static void copyPath(Path source, Path destination) throws IOException { Files.walkFileTree(source, new SimpleFileVisitor<Path>() { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { Path destinationDir = destination.resolve(source.relativize(di... | Helpers { public static void copyPath(Path source, Path destination) throws IOException { Files.walkFileTree(source, new SimpleFileVisitor<Path>() { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { Path destinationDir = destination.resolve(source.relativize(di... |
@Test public void testCopyPathCopiesFileFromSourceToDestination() throws IOException { final Path source = Files.createTempFile(generateAlphanumStr(), generateAlphanumStr()); final Path destination = Files.createTempDirectory(generateAlphanumStr()).resolve("destination"); Helpers.copyPath(source, destination); assertTh... | public static void copyPath(Path source, Path destination) throws IOException { Files.walkFileTree(source, new SimpleFileVisitor<Path>() { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { Path destinationDir = destination.resolve(source.relativize(dir)); try {... | Helpers { public static void copyPath(Path source, Path destination) throws IOException { Files.walkFileTree(source, new SimpleFileVisitor<Path>() { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { Path destinationDir = destination.resolve(source.relativize(di... | Helpers { public static void copyPath(Path source, Path destination) throws IOException { Files.walkFileTree(source, new SimpleFileVisitor<Path>() { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { Path destinationDir = destination.resolve(source.relativize(di... | Helpers { public static void copyPath(Path source, Path destination) throws IOException { Files.walkFileTree(source, new SimpleFileVisitor<Path>() { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { Path destinationDir = destination.resolve(source.relativize(di... | Helpers { public static void copyPath(Path source, Path destination) throws IOException { Files.walkFileTree(source, new SimpleFileVisitor<Path>() { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { Path destinationDir = destination.resolve(source.relativize(di... |
@Test public void testCopyPathMaintainsExecutablePermissionsInDestination() throws IOException { final Path source = Files.createTempFile(generateAlphanumStr(), generateAlphanumStr()); assertThat(source.toFile().canExecute()).isFalse(); if (!source.toFile().setExecutable(true)) return; final Path destination = Files.cr... | public static void copyPath(Path source, Path destination) throws IOException { Files.walkFileTree(source, new SimpleFileVisitor<Path>() { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { Path destinationDir = destination.resolve(source.relativize(dir)); try {... | Helpers { public static void copyPath(Path source, Path destination) throws IOException { Files.walkFileTree(source, new SimpleFileVisitor<Path>() { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { Path destinationDir = destination.resolve(source.relativize(di... | Helpers { public static void copyPath(Path source, Path destination) throws IOException { Files.walkFileTree(source, new SimpleFileVisitor<Path>() { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { Path destinationDir = destination.resolve(source.relativize(di... | Helpers { public static void copyPath(Path source, Path destination) throws IOException { Files.walkFileTree(source, new SimpleFileVisitor<Path>() { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { Path destinationDir = destination.resolve(source.relativize(di... | Helpers { public static void copyPath(Path source, Path destination) throws IOException { Files.walkFileTree(source, new SimpleFileVisitor<Path>() { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { Path destinationDir = destination.resolve(source.relativize(di... |
@Test public void testCopyPathCopiesDirectoryFromSourceToDestination() throws IOException { final Path source = Files.createTempDirectory(generateAlphanumStr()); final Path destination = Files.createTempDirectory(generateAlphanumStr()).resolve(generateAlphanumStr()); Helpers.copyPath(source, destination); assertThat(de... | public static void copyPath(Path source, Path destination) throws IOException { Files.walkFileTree(source, new SimpleFileVisitor<Path>() { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { Path destinationDir = destination.resolve(source.relativize(dir)); try {... | Helpers { public static void copyPath(Path source, Path destination) throws IOException { Files.walkFileTree(source, new SimpleFileVisitor<Path>() { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { Path destinationDir = destination.resolve(source.relativize(di... | Helpers { public static void copyPath(Path source, Path destination) throws IOException { Files.walkFileTree(source, new SimpleFileVisitor<Path>() { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { Path destinationDir = destination.resolve(source.relativize(di... | Helpers { public static void copyPath(Path source, Path destination) throws IOException { Files.walkFileTree(source, new SimpleFileVisitor<Path>() { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { Path destinationDir = destination.resolve(source.relativize(di... | Helpers { public static void copyPath(Path source, Path destination) throws IOException { Files.walkFileTree(source, new SimpleFileVisitor<Path>() { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { Path destinationDir = destination.resolve(source.relativize(di... |
@Test public void testFetchJobSpecSummariesContainsLinkToSummaryDetails() throws IOException { final List<JobSpecSummary> jobSpecSummariesReturnedByDAO = generateNJobSpecSummaries(5); final JobSpecDAO jobSpecDAO = mock(JobSpecDAO.class); when(jobSpecDAO.getJobSpecSummaries(anyInt(), anyInt())).thenReturn(jobSpecSummari... | @GET @Operation( summary = "Get summaries of the job specs exposed by the system", description = "Returns an object that contains summaries of *some* of the job specs exposed by the system. " + "The response does not necessarily contain summaries for *all* job specs exposed by the system. " + "This is because paginatio... | JobSpecResource { @GET @Operation( summary = "Get summaries of the job specs exposed by the system", description = "Returns an object that contains summaries of *some* of the job specs exposed by the system. " + "The response does not necessarily contain summaries for *all* job specs exposed by the system. " + "This is... | JobSpecResource { @GET @Operation( summary = "Get summaries of the job specs exposed by the system", description = "Returns an object that contains summaries of *some* of the job specs exposed by the system. " + "The response does not necessarily contain summaries for *all* job specs exposed by the system. " + "This is... | JobSpecResource { @GET @Operation( summary = "Get summaries of the job specs exposed by the system", description = "Returns an object that contains summaries of *some* of the job specs exposed by the system. " + "The response does not necessarily contain summaries for *all* job specs exposed by the system. " + "This is... | JobSpecResource { @GET @Operation( summary = "Get summaries of the job specs exposed by the system", description = "Returns an object that contains summaries of *some* of the job specs exposed by the system. " + "The response does not necessarily contain summaries for *all* job specs exposed by the system. " + "This is... |
@Test public void testFft2D_inplace() throws Exception { ComplexDoubleMatrix fftMatrix_2D_ACTUAL = complexMatrix_EXPECTED.dup(); SpectralUtils.fft2D_inplace(fftMatrix_2D_ACTUAL); Assert.assertEquals(fftMatrix_2D_EXPECTED, fftMatrix_2D_ACTUAL); ComplexDoubleMatrix fftMatrix_2D_ACTUAL_2 = complexMatrix_EXPECTED_2.dup(); ... | public static void fft2D_inplace(ComplexDoubleMatrix A) { ComplexDoubleMatrix aTemp = A.transpose(); DoubleFFT_2D fft2d = new DoubleFFT_2D(aTemp.rows, aTemp.columns); fft2d.complexForward(aTemp.data); A.data = aTemp.transpose().data; } | SpectralUtils { public static void fft2D_inplace(ComplexDoubleMatrix A) { ComplexDoubleMatrix aTemp = A.transpose(); DoubleFFT_2D fft2d = new DoubleFFT_2D(aTemp.rows, aTemp.columns); fft2d.complexForward(aTemp.data); A.data = aTemp.transpose().data; } } | SpectralUtils { public static void fft2D_inplace(ComplexDoubleMatrix A) { ComplexDoubleMatrix aTemp = A.transpose(); DoubleFFT_2D fft2d = new DoubleFFT_2D(aTemp.rows, aTemp.columns); fft2d.complexForward(aTemp.data); A.data = aTemp.transpose().data; } } | SpectralUtils { public static void fft2D_inplace(ComplexDoubleMatrix A) { ComplexDoubleMatrix aTemp = A.transpose(); DoubleFFT_2D fft2d = new DoubleFFT_2D(aTemp.rows, aTemp.columns); fft2d.complexForward(aTemp.data); A.data = aTemp.transpose().data; } static void fft1D_inplace(ComplexDoubleMatrix vector, final int fft... | SpectralUtils { public static void fft2D_inplace(ComplexDoubleMatrix A) { ComplexDoubleMatrix aTemp = A.transpose(); DoubleFFT_2D fft2d = new DoubleFFT_2D(aTemp.rows, aTemp.columns); fft2d.complexForward(aTemp.data); A.data = aTemp.transpose().data; } static void fft1D_inplace(ComplexDoubleMatrix vector, final int fft... |
@Test public void testIsOdd() throws Exception { Assert.assertTrue(MathUtils.isOdd(oddVal_EXPECTED)); Assert.assertFalse(MathUtils.isOdd(evenVal_EXPECTED)); } | public static boolean isOdd(long value) { return !isEven(value); } | MathUtils { public static boolean isOdd(long value) { return !isEven(value); } } | MathUtils { public static boolean isOdd(long value) { return !isEven(value); } } | MathUtils { public static boolean isOdd(long value) { return !isEven(value); } static boolean isEven(long value); static boolean isOdd(long value); static boolean isPower2(long value); static double rad2deg(double valueInRadians); static double deg2rad(double valueInDegrees); static int[][] distributePoints(final int ... | MathUtils { public static boolean isOdd(long value) { return !isEven(value); } static boolean isEven(long value); static boolean isOdd(long value); static boolean isPower2(long value); static double rad2deg(double valueInRadians); static double deg2rad(double valueInDegrees); static int[][] distributePoints(final int ... |
@Test public void testIsEven() throws Exception { Assert.assertTrue(MathUtils.isEven(evenVal_EXPECTED)); Assert.assertFalse(MathUtils.isEven(oddVal_EXPECTED)); } | public static boolean isEven(long value) { return value % 2 == 0; } | MathUtils { public static boolean isEven(long value) { return value % 2 == 0; } } | MathUtils { public static boolean isEven(long value) { return value % 2 == 0; } } | MathUtils { public static boolean isEven(long value) { return value % 2 == 0; } static boolean isEven(long value); static boolean isOdd(long value); static boolean isPower2(long value); static double rad2deg(double valueInRadians); static double deg2rad(double valueInDegrees); static int[][] distributePoints(final int... | MathUtils { public static boolean isEven(long value) { return value % 2 == 0; } static boolean isEven(long value); static boolean isOdd(long value); static boolean isPower2(long value); static double rad2deg(double valueInRadians); static double deg2rad(double valueInDegrees); static int[][] distributePoints(final int... |
@Test public void testIsPower2() throws Exception { Assert.assertTrue(MathUtils.isPower2((long) powerOfTwo_EXPECTED)); Assert.assertFalse(MathUtils.isPower2((long) notPowerOfTwo_EXPECTED)); } | public static boolean isPower2(long value) { return value == 1 || value == 2 || value == 4 || value == 8 || value == 16 || value == 32 || value == 64 || value == 128 || value == 256 || value == 512 || value == 1024 || value == 2048 || value == 4096; } | MathUtils { public static boolean isPower2(long value) { return value == 1 || value == 2 || value == 4 || value == 8 || value == 16 || value == 32 || value == 64 || value == 128 || value == 256 || value == 512 || value == 1024 || value == 2048 || value == 4096; } } | MathUtils { public static boolean isPower2(long value) { return value == 1 || value == 2 || value == 4 || value == 8 || value == 16 || value == 32 || value == 64 || value == 128 || value == 256 || value == 512 || value == 1024 || value == 2048 || value == 4096; } } | MathUtils { public static boolean isPower2(long value) { return value == 1 || value == 2 || value == 4 || value == 8 || value == 16 || value == 32 || value == 64 || value == 128 || value == 256 || value == 512 || value == 1024 || value == 2048 || value == 4096; } static boolean isEven(long value); static boolean isOdd... | MathUtils { public static boolean isPower2(long value) { return value == 1 || value == 2 || value == 4 || value == 8 || value == 16 || value == 32 || value == 64 || value == 128 || value == 256 || value == 512 || value == 1024 || value == 2048 || value == 4096; } static boolean isEven(long value); static boolean isOdd... |
@Test public void testRad2deg() throws Exception { Assert.assertEquals(valInDegrees_EXPECTED, MathUtils.rad2deg(valInRadians_EXPECTED), DELTA); } | public static double rad2deg(double valueInRadians) { return valueInRadians * Constants.RTOD; } | MathUtils { public static double rad2deg(double valueInRadians) { return valueInRadians * Constants.RTOD; } } | MathUtils { public static double rad2deg(double valueInRadians) { return valueInRadians * Constants.RTOD; } } | MathUtils { public static double rad2deg(double valueInRadians) { return valueInRadians * Constants.RTOD; } static boolean isEven(long value); static boolean isOdd(long value); static boolean isPower2(long value); static double rad2deg(double valueInRadians); static double deg2rad(double valueInDegrees); static int[][... | MathUtils { public static double rad2deg(double valueInRadians) { return valueInRadians * Constants.RTOD; } static boolean isEven(long value); static boolean isOdd(long value); static boolean isPower2(long value); static double rad2deg(double valueInRadians); static double deg2rad(double valueInDegrees); static int[][... |
@Test public void testDeg2rad() throws Exception { Assert.assertEquals(valInRadians_EXPECTED, MathUtils.deg2rad(valInDegrees_EXPECTED), DELTA); } | public static double deg2rad(double valueInDegrees) { return valueInDegrees * Constants.DTOR; } | MathUtils { public static double deg2rad(double valueInDegrees) { return valueInDegrees * Constants.DTOR; } } | MathUtils { public static double deg2rad(double valueInDegrees) { return valueInDegrees * Constants.DTOR; } } | MathUtils { public static double deg2rad(double valueInDegrees) { return valueInDegrees * Constants.DTOR; } static boolean isEven(long value); static boolean isOdd(long value); static boolean isPower2(long value); static double rad2deg(double valueInRadians); static double deg2rad(double valueInDegrees); static int[][... | MathUtils { public static double deg2rad(double valueInDegrees) { return valueInDegrees * Constants.DTOR; } static boolean isEven(long value); static boolean isOdd(long value); static boolean isPower2(long value); static double rad2deg(double valueInRadians); static double deg2rad(double valueInDegrees); static int[][... |
@Test public void testDistributePoints() throws Exception { int[][] distribPnts_ACTUAL = MathUtils.distributePoints(numOfPnts, winForDistribution); for (int i = 0; i < distribPnts_ACTUAL.length; i++) { Assert.assertArrayEquals(distributedPoints_EXPECTED[i], distribPnts_ACTUAL[i]); } } | public static int[][] distributePoints(final int numOfPoints, final Window window) { final float lines = window.lines(); final float pixels = window.pixels(); int[][] result = new int[numOfPoints][2]; float winP = (float) Math.sqrt(numOfPoints / (lines / pixels)); float winL = numOfPoints / winP; if (winL < winP) { win... | MathUtils { public static int[][] distributePoints(final int numOfPoints, final Window window) { final float lines = window.lines(); final float pixels = window.pixels(); int[][] result = new int[numOfPoints][2]; float winP = (float) Math.sqrt(numOfPoints / (lines / pixels)); float winL = numOfPoints / winP; if (winL <... | MathUtils { public static int[][] distributePoints(final int numOfPoints, final Window window) { final float lines = window.lines(); final float pixels = window.pixels(); int[][] result = new int[numOfPoints][2]; float winP = (float) Math.sqrt(numOfPoints / (lines / pixels)); float winL = numOfPoints / winP; if (winL <... | MathUtils { public static int[][] distributePoints(final int numOfPoints, final Window window) { final float lines = window.lines(); final float pixels = window.pixels(); int[][] result = new int[numOfPoints][2]; float winP = (float) Math.sqrt(numOfPoints / (lines / pixels)); float winL = numOfPoints / winP; if (winL <... | MathUtils { public static int[][] distributePoints(final int numOfPoints, final Window window) { final float lines = window.lines(); final float pixels = window.pixels(); int[][] result = new int[numOfPoints][2]; float winP = (float) Math.sqrt(numOfPoints / (lines / pixels)); float winL = numOfPoints / winP; if (winL <... |
@Test public void testIncrement1D() throws Exception { double[] increment_1D_ACTUAL = MathUtils.increment(5, 0, 0.25); Assert.assertArrayEquals(increment_1D_EXPECTED, increment_1D_ACTUAL, DELTA); } | public static double[] increment(int m, double begin, double pitch) { double[] array = new double[m]; for (int i = 0; i < m; i++) { array[i] = begin + i * pitch; } return array; } | MathUtils { public static double[] increment(int m, double begin, double pitch) { double[] array = new double[m]; for (int i = 0; i < m; i++) { array[i] = begin + i * pitch; } return array; } } | MathUtils { public static double[] increment(int m, double begin, double pitch) { double[] array = new double[m]; for (int i = 0; i < m; i++) { array[i] = begin + i * pitch; } return array; } } | MathUtils { public static double[] increment(int m, double begin, double pitch) { double[] array = new double[m]; for (int i = 0; i < m; i++) { array[i] = begin + i * pitch; } return array; } static boolean isEven(long value); static boolean isOdd(long value); static boolean isPower2(long value); static double rad2deg... | MathUtils { public static double[] increment(int m, double begin, double pitch) { double[] array = new double[m]; for (int i = 0; i < m; i++) { array[i] = begin + i * pitch; } return array; } static boolean isEven(long value); static boolean isOdd(long value); static boolean isPower2(long value); static double rad2deg... |
@Test public void testIncrement2D() throws Exception { double[][] increment_2D_ACTUAL = MathUtils.increment(5, 2, 0, 0.25); for (int i = 0; i < increment_2D_ACTUAL.length; i++) { Assert.assertArrayEquals(increment_2D_EXPECTED[i], increment_2D_ACTUAL[i], DELTA); } } | public static double[] increment(int m, double begin, double pitch) { double[] array = new double[m]; for (int i = 0; i < m; i++) { array[i] = begin + i * pitch; } return array; } | MathUtils { public static double[] increment(int m, double begin, double pitch) { double[] array = new double[m]; for (int i = 0; i < m; i++) { array[i] = begin + i * pitch; } return array; } } | MathUtils { public static double[] increment(int m, double begin, double pitch) { double[] array = new double[m]; for (int i = 0; i < m; i++) { array[i] = begin + i * pitch; } return array; } } | MathUtils { public static double[] increment(int m, double begin, double pitch) { double[] array = new double[m]; for (int i = 0; i < m; i++) { array[i] = begin + i * pitch; } return array; } static boolean isEven(long value); static boolean isOdd(long value); static boolean isPower2(long value); static double rad2deg... | MathUtils { public static double[] increment(int m, double begin, double pitch) { double[] array = new double[m]; for (int i = 0; i < m; i++) { array[i] = begin + i * pitch; } return array; } static boolean isEven(long value); static boolean isOdd(long value); static boolean isPower2(long value); static double rad2deg... |
@Test public void testSqr() throws Exception { Assert.assertEquals(Math.pow(VALUE, 2), MathUtils.sqr(VALUE), DELTA); } | @Deprecated public static double sqr(double value) { return Math.pow(value, 2); } | MathUtils { @Deprecated public static double sqr(double value) { return Math.pow(value, 2); } } | MathUtils { @Deprecated public static double sqr(double value) { return Math.pow(value, 2); } } | MathUtils { @Deprecated public static double sqr(double value) { return Math.pow(value, 2); } static boolean isEven(long value); static boolean isOdd(long value); static boolean isPower2(long value); static double rad2deg(double valueInRadians); static double deg2rad(double valueInDegrees); static int[][] distributePo... | MathUtils { @Deprecated public static double sqr(double value) { return Math.pow(value, 2); } static boolean isEven(long value); static boolean isOdd(long value); static boolean isPower2(long value); static double rad2deg(double valueInRadians); static double deg2rad(double valueInDegrees); static int[][] distributePo... |
@Test public void testSqrt() throws Exception { Assert.assertEquals(Math.sqrt(VALUE), MathUtils.sqrt(VALUE), DELTA); } | @Deprecated public static double sqrt(double value) { return Math.sqrt(value); } | MathUtils { @Deprecated public static double sqrt(double value) { return Math.sqrt(value); } } | MathUtils { @Deprecated public static double sqrt(double value) { return Math.sqrt(value); } } | MathUtils { @Deprecated public static double sqrt(double value) { return Math.sqrt(value); } static boolean isEven(long value); static boolean isOdd(long value); static boolean isPower2(long value); static double rad2deg(double valueInRadians); static double deg2rad(double valueInDegrees); static int[][] distributePoi... | MathUtils { @Deprecated public static double sqrt(double value) { return Math.sqrt(value); } static boolean isEven(long value); static boolean isOdd(long value); static boolean isPower2(long value); static double rad2deg(double valueInRadians); static double deg2rad(double valueInDegrees); static int[][] distributePoi... |
@Test public void testLying() throws Exception{ DoubleMatrix inMatrix = DoubleMatrix.ones(2, 2); DoubleMatrix lying_EXPECTED = DoubleMatrix.ones(1, 4); Assert.assertEquals(lying_EXPECTED, MathUtils.lying(inMatrix)); inMatrix = DoubleMatrix.ones(4, 1); Assert.assertEquals(lying_EXPECTED, MathUtils.lying(inMatrix)); } | public static DoubleMatrix lying(DoubleMatrix inMatrix) { return new DoubleMatrix(inMatrix.toArray()).transpose(); } | MathUtils { public static DoubleMatrix lying(DoubleMatrix inMatrix) { return new DoubleMatrix(inMatrix.toArray()).transpose(); } } | MathUtils { public static DoubleMatrix lying(DoubleMatrix inMatrix) { return new DoubleMatrix(inMatrix.toArray()).transpose(); } } | MathUtils { public static DoubleMatrix lying(DoubleMatrix inMatrix) { return new DoubleMatrix(inMatrix.toArray()).transpose(); } static boolean isEven(long value); static boolean isOdd(long value); static boolean isPower2(long value); static double rad2deg(double valueInRadians); static double deg2rad(double valueInDe... | MathUtils { public static DoubleMatrix lying(DoubleMatrix inMatrix) { return new DoubleMatrix(inMatrix.toArray()).transpose(); } static boolean isEven(long value); static boolean isOdd(long value); static boolean isPower2(long value); static double rad2deg(double valueInRadians); static double deg2rad(double valueInDe... |
@Test public void testRamp() throws Exception { DoubleMatrix ramp_2D_ACTUAL = MathUtils.ramp(nRows, nCols); Assert.assertEquals(ramp_2D_EXPECTED, ramp_2D_ACTUAL); } | public static DoubleMatrix ramp(final int nRows, final int nColumns) { final double maxHeight = 1; return DoubleMatrix.ones(nRows, 1).mmul(lying(new DoubleMatrix(increment(nColumns, 0, maxHeight / (nColumns - 1))))); } | MathUtils { public static DoubleMatrix ramp(final int nRows, final int nColumns) { final double maxHeight = 1; return DoubleMatrix.ones(nRows, 1).mmul(lying(new DoubleMatrix(increment(nColumns, 0, maxHeight / (nColumns - 1))))); } } | MathUtils { public static DoubleMatrix ramp(final int nRows, final int nColumns) { final double maxHeight = 1; return DoubleMatrix.ones(nRows, 1).mmul(lying(new DoubleMatrix(increment(nColumns, 0, maxHeight / (nColumns - 1))))); } } | MathUtils { public static DoubleMatrix ramp(final int nRows, final int nColumns) { final double maxHeight = 1; return DoubleMatrix.ones(nRows, 1).mmul(lying(new DoubleMatrix(increment(nColumns, 0, maxHeight / (nColumns - 1))))); } static boolean isEven(long value); static boolean isOdd(long value); static boolean isPo... | MathUtils { public static DoubleMatrix ramp(final int nRows, final int nColumns) { final double maxHeight = 1; return DoubleMatrix.ones(nRows, 1).mmul(lying(new DoubleMatrix(increment(nColumns, 0, maxHeight / (nColumns - 1))))); } static boolean isEven(long value); static boolean isOdd(long value); static boolean isPo... |
@Test public void testNormalize2() throws Exception { double normValue1_EXPECTED = -2; double normValue2_EXPECTED = -1.636363636363; int min_int = 1; int max_int = 100; double min_double = 1.0; double max_double = 100.; Assert.assertEquals(normValue1_EXPECTED, PolyUtils.normalize2(1, min_int, max_int), DELTA_06); Asser... | public static double normalize2(double data, final int min, final int max) { data -= (0.5 * (min + max)); data /= (0.25 * (max - min)); return data; } | PolyUtils { public static double normalize2(double data, final int min, final int max) { data -= (0.5 * (min + max)); data /= (0.25 * (max - min)); return data; } } | PolyUtils { public static double normalize2(double data, final int min, final int max) { data -= (0.5 * (min + max)); data /= (0.25 * (max - min)); return data; } } | PolyUtils { public static double normalize2(double data, final int min, final int max) { data -= (0.5 * (min + max)); data /= (0.25 * (max - min)); return data; } static double normalize2(double data, final int min, final int max); static double normalize2(double data, final double min, final double max); static Doubl... | PolyUtils { public static double normalize2(double data, final int min, final int max) { data -= (0.5 * (min + max)); data /= (0.25 * (max - min)); return data; } static double normalize2(double data, final int min, final int max); static double normalize2(double data, final double min, final double max); static Doubl... |
@Test public void testNormalize() throws Exception { double[] array_EXPECTED = {1, 2}; double[] normArray_EXPECTED = {-0.1, 0}; Assert.assertEquals(new DoubleMatrix(normArray_EXPECTED), PolyUtils.normalize(new DoubleMatrix(array_EXPECTED))); } | public static DoubleMatrix normalize(DoubleMatrix t) { return t.sub(t.get(t.length / 2)).div(10.0); } | PolyUtils { public static DoubleMatrix normalize(DoubleMatrix t) { return t.sub(t.get(t.length / 2)).div(10.0); } } | PolyUtils { public static DoubleMatrix normalize(DoubleMatrix t) { return t.sub(t.get(t.length / 2)).div(10.0); } } | PolyUtils { public static DoubleMatrix normalize(DoubleMatrix t) { return t.sub(t.get(t.length / 2)).div(10.0); } static double normalize2(double data, final int min, final int max); static double normalize2(double data, final double min, final double max); static DoubleMatrix normalize(DoubleMatrix t); static int deg... | PolyUtils { public static DoubleMatrix normalize(DoubleMatrix t) { return t.sub(t.get(t.length / 2)).div(10.0); } static double normalize2(double data, final int min, final int max); static double normalize2(double data, final double min, final double max); static DoubleMatrix normalize(DoubleMatrix t); static int deg... |
@Test public void testDegreeFromCoefficients() throws Exception { final int degree_EXPECTED = 5; int degree_ACTUAL = PolyUtils.degreeFromCoefficients(21); Assert.assertEquals(degree_EXPECTED, degree_ACTUAL); } | public static int degreeFromCoefficients(int numOfCoefficients) { return (int) (0.5 * (-1 + (int) (Math.sqrt((double) (1 + 8 * numOfCoefficients))))) - 1; } | PolyUtils { public static int degreeFromCoefficients(int numOfCoefficients) { return (int) (0.5 * (-1 + (int) (Math.sqrt((double) (1 + 8 * numOfCoefficients))))) - 1; } } | PolyUtils { public static int degreeFromCoefficients(int numOfCoefficients) { return (int) (0.5 * (-1 + (int) (Math.sqrt((double) (1 + 8 * numOfCoefficients))))) - 1; } } | PolyUtils { public static int degreeFromCoefficients(int numOfCoefficients) { return (int) (0.5 * (-1 + (int) (Math.sqrt((double) (1 + 8 * numOfCoefficients))))) - 1; } static double normalize2(double data, final int min, final int max); static double normalize2(double data, final double min, final double max); static... | PolyUtils { public static int degreeFromCoefficients(int numOfCoefficients) { return (int) (0.5 * (-1 + (int) (Math.sqrt((double) (1 + 8 * numOfCoefficients))))) - 1; } static double normalize2(double data, final int min, final int max); static double normalize2(double data, final double min, final double max); static... |
@Test public void testNumberOfCoefficients() throws Exception { final int coeffs_EXPECTED = 21; int coeffs_ACTUAL = PolyUtils.numberOfCoefficients(5); Assert.assertEquals(coeffs_EXPECTED, coeffs_ACTUAL); } | public static int numberOfCoefficients(final int degree) { return (int) (0.5 * (Math.pow(degree + 1, 2) + degree + 1)); } | PolyUtils { public static int numberOfCoefficients(final int degree) { return (int) (0.5 * (Math.pow(degree + 1, 2) + degree + 1)); } } | PolyUtils { public static int numberOfCoefficients(final int degree) { return (int) (0.5 * (Math.pow(degree + 1, 2) + degree + 1)); } } | PolyUtils { public static int numberOfCoefficients(final int degree) { return (int) (0.5 * (Math.pow(degree + 1, 2) + degree + 1)); } static double normalize2(double data, final int min, final int max); static double normalize2(double data, final double min, final double max); static DoubleMatrix normalize(DoubleMatri... | PolyUtils { public static int numberOfCoefficients(final int degree) { return (int) (0.5 * (Math.pow(degree + 1, 2) + degree + 1)); } static double normalize2(double data, final int min, final int max); static double normalize2(double data, final double min, final double max); static DoubleMatrix normalize(DoubleMatri... |
@Test public void testPolyFit() throws Exception { final int maxDegree = 6; double[] x = MathUtils.increment(11, 0, 0.1); double[] y = new double[x.length]; for (int i = 0; i < x.length; i++) { y[i] = erf(x[i]); } ArrayList<double[]> coeff_EXPECTED = new ArrayList<double[]>(); coeff_EXPECTED.add(new double[]{0.05312775... | public static double[] polyFit(DoubleMatrix t, DoubleMatrix y, final int degree) throws IllegalArgumentException { setLoggerLevel(); if (t.length != y.length || !t.isVector() || !y.isVector()) { logger.error("polyfit: require same size vectors."); throw new IllegalArgumentException("polyfit: require same size vectors."... | PolyUtils { public static double[] polyFit(DoubleMatrix t, DoubleMatrix y, final int degree) throws IllegalArgumentException { setLoggerLevel(); if (t.length != y.length || !t.isVector() || !y.isVector()) { logger.error("polyfit: require same size vectors."); throw new IllegalArgumentException("polyfit: require same si... | PolyUtils { public static double[] polyFit(DoubleMatrix t, DoubleMatrix y, final int degree) throws IllegalArgumentException { setLoggerLevel(); if (t.length != y.length || !t.isVector() || !y.isVector()) { logger.error("polyfit: require same size vectors."); throw new IllegalArgumentException("polyfit: require same si... | PolyUtils { public static double[] polyFit(DoubleMatrix t, DoubleMatrix y, final int degree) throws IllegalArgumentException { setLoggerLevel(); if (t.length != y.length || !t.isVector() || !y.isVector()) { logger.error("polyfit: require same size vectors."); throw new IllegalArgumentException("polyfit: require same si... | PolyUtils { public static double[] polyFit(DoubleMatrix t, DoubleMatrix y, final int degree) throws IllegalArgumentException { setLoggerLevel(); if (t.length != y.length || !t.isVector() || !y.isVector()) { logger.error("polyfit: require same size vectors."); throw new IllegalArgumentException("polyfit: require same si... |
@Test public void testPolyFitNormalize() throws Exception { final double[] x = MathUtils.increment(11, 0, 0.1); final double[] y = new double[x.length]; for (int i = 0; i < x.length; i++) { y[i] = erf(x[i]); } final double[] coeff_EXPECTED = {0.52048, 8.786103, -43.780634, -143.72893, 1652.73195}; final double[] coeff_... | public static double[] polyFitNormalized(DoubleMatrix t, DoubleMatrix y, final int degree) throws IllegalArgumentException { return polyFit(normalize(t), y, degree); } | PolyUtils { public static double[] polyFitNormalized(DoubleMatrix t, DoubleMatrix y, final int degree) throws IllegalArgumentException { return polyFit(normalize(t), y, degree); } } | PolyUtils { public static double[] polyFitNormalized(DoubleMatrix t, DoubleMatrix y, final int degree) throws IllegalArgumentException { return polyFit(normalize(t), y, degree); } } | PolyUtils { public static double[] polyFitNormalized(DoubleMatrix t, DoubleMatrix y, final int degree) throws IllegalArgumentException { return polyFit(normalize(t), y, degree); } static double normalize2(double data, final int min, final int max); static double normalize2(double data, final double min, final double m... | PolyUtils { public static double[] polyFitNormalized(DoubleMatrix t, DoubleMatrix y, final int degree) throws IllegalArgumentException { return polyFit(normalize(t), y, degree); } static double normalize2(double data, final int min, final int max); static double normalize2(double data, final double min, final double m... |
@Test public void testPolyVal1d() throws Exception { double[] coeff = {1, 2, 3}; double[] input = {5, 7, 9}; double[] solutionArray_EXPECTED = {86, 162, 262}; for (int i = 0; i < solutionArray_EXPECTED.length; i++) { double solution_EXPECTED = solutionArray_EXPECTED[i]; Assert.assertEquals(solution_EXPECTED, PolyUtils.... | public static double polyVal1D(double x, double[] coeffs) { double sum = 0.0; for (int d = coeffs.length - 1; d >= 0; --d) { sum *= x; sum += coeffs[d]; } return sum; } | PolyUtils { public static double polyVal1D(double x, double[] coeffs) { double sum = 0.0; for (int d = coeffs.length - 1; d >= 0; --d) { sum *= x; sum += coeffs[d]; } return sum; } } | PolyUtils { public static double polyVal1D(double x, double[] coeffs) { double sum = 0.0; for (int d = coeffs.length - 1; d >= 0; --d) { sum *= x; sum += coeffs[d]; } return sum; } } | PolyUtils { public static double polyVal1D(double x, double[] coeffs) { double sum = 0.0; for (int d = coeffs.length - 1; d >= 0; --d) { sum *= x; sum += coeffs[d]; } return sum; } static double normalize2(double data, final int min, final int max); static double normalize2(double data, final double min, final double ... | PolyUtils { public static double polyVal1D(double x, double[] coeffs) { double sum = 0.0; for (int d = coeffs.length - 1; d >= 0; --d) { sum *= x; sum += coeffs[d]; } return sum; } static double normalize2(double data, final int min, final int max); static double normalize2(double data, final double min, final double ... |
@Test public void testPolyval() throws Exception { final double[] x = {0, 1, 2, 3}; final double[] y = {0, 1, 2, 3}; final double[] coeffsTemplate = MathUtils.increment(60, 1, 1); final double[][] values_EXPECTED = {{1, 6, 11, 16}, {1, 21, 71, 151}, {1, 55, 343, 1069}, {1, 120, 1383, 6334}, {1, 231, 4935, 33307}, {1, 4... | public static double[][] polyval(final double[] x, final double[] y, final double coeff[], int degree) { setLoggerLevel(); if (degree < -1) { logger.warn("polyValGrid: degree < -1 ????"); } if (x.length > y.length) { logger.warn("polValGrid: x larger than y, while optimized for y larger x"); } if (degree == -1) { degre... | PolyUtils { public static double[][] polyval(final double[] x, final double[] y, final double coeff[], int degree) { setLoggerLevel(); if (degree < -1) { logger.warn("polyValGrid: degree < -1 ????"); } if (x.length > y.length) { logger.warn("polValGrid: x larger than y, while optimized for y larger x"); } if (degree ==... | PolyUtils { public static double[][] polyval(final double[] x, final double[] y, final double coeff[], int degree) { setLoggerLevel(); if (degree < -1) { logger.warn("polyValGrid: degree < -1 ????"); } if (x.length > y.length) { logger.warn("polValGrid: x larger than y, while optimized for y larger x"); } if (degree ==... | PolyUtils { public static double[][] polyval(final double[] x, final double[] y, final double coeff[], int degree) { setLoggerLevel(); if (degree < -1) { logger.warn("polyValGrid: degree < -1 ????"); } if (x.length > y.length) { logger.warn("polValGrid: x larger than y, while optimized for y larger x"); } if (degree ==... | PolyUtils { public static double[][] polyval(final double[] x, final double[] y, final double coeff[], int degree) { setLoggerLevel(); if (degree < -1) { logger.warn("polyValGrid: degree < -1 ????"); } if (x.length > y.length) { logger.warn("polValGrid: x larger than y, while optimized for y larger x"); } if (degree ==... |
@Test public void testMultilook() throws Exception { int[] mlookFactorAz = new int[]{1, 2, 5, 5}; int[] mlookFactorRg = new int[]{2, 2, 1, 5}; for (int i = 0; i < mlookFactorAz.length; i++) { int facAz = mlookFactorAz[i]; int facRg = mlookFactorRg[i]; ComplexDoubleMatrix cplxData_mlook_ACTUAL = SarUtils.multilook(cplxD... | public static ComplexDoubleMatrix multilook(final ComplexDoubleMatrix inputMatrix, final int factorRow, final int factorColumn) { if (factorRow == 1 && factorColumn == 1) { return inputMatrix; } logger.debug("multilook input [inputMatrix] size: " + inputMatrix.length + " lines: " + inputMatrix.rows + " pixels: " + inpu... | SarUtils { public static ComplexDoubleMatrix multilook(final ComplexDoubleMatrix inputMatrix, final int factorRow, final int factorColumn) { if (factorRow == 1 && factorColumn == 1) { return inputMatrix; } logger.debug("multilook input [inputMatrix] size: " + inputMatrix.length + " lines: " + inputMatrix.rows + " pixel... | SarUtils { public static ComplexDoubleMatrix multilook(final ComplexDoubleMatrix inputMatrix, final int factorRow, final int factorColumn) { if (factorRow == 1 && factorColumn == 1) { return inputMatrix; } logger.debug("multilook input [inputMatrix] size: " + inputMatrix.length + " lines: " + inputMatrix.rows + " pixel... | SarUtils { public static ComplexDoubleMatrix multilook(final ComplexDoubleMatrix inputMatrix, final int factorRow, final int factorColumn) { if (factorRow == 1 && factorColumn == 1) { return inputMatrix; } logger.debug("multilook input [inputMatrix] size: " + inputMatrix.length + " lines: " + inputMatrix.rows + " pixel... | SarUtils { public static ComplexDoubleMatrix multilook(final ComplexDoubleMatrix inputMatrix, final int factorRow, final int factorColumn) { if (factorRow == 1 && factorColumn == 1) { return inputMatrix; } logger.debug("multilook input [inputMatrix] size: " + inputMatrix.length + " lines: " + inputMatrix.rows + " pixel... |
@Test public void testOversample() throws Exception { int[] ovsmpFactorAz = new int[]{1, 2, 2, 3}; int[] ovsmpFactorRg = new int[]{2, 1, 2, 3}; for (int i = 0; i < ovsmpFactorAz.length; i++) { int facAz = ovsmpFactorAz[i]; int facRg = ovsmpFactorRg[i]; ComplexDoubleMatrix cplxData_ovsmp_ACTUAL = SarUtils.oversample(cpl... | public static ComplexDoubleMatrix oversample(ComplexDoubleMatrix inputMatrix, final int factorRow, final int factorCol) throws IllegalArgumentException { final int l = inputMatrix.rows; final int p = inputMatrix.columns; final int halfL = l / 2; final int halfP = p / 2; final int L2 = factorRow * l; final int P2 = fact... | SarUtils { public static ComplexDoubleMatrix oversample(ComplexDoubleMatrix inputMatrix, final int factorRow, final int factorCol) throws IllegalArgumentException { final int l = inputMatrix.rows; final int p = inputMatrix.columns; final int halfL = l / 2; final int halfP = p / 2; final int L2 = factorRow * l; final in... | SarUtils { public static ComplexDoubleMatrix oversample(ComplexDoubleMatrix inputMatrix, final int factorRow, final int factorCol) throws IllegalArgumentException { final int l = inputMatrix.rows; final int p = inputMatrix.columns; final int halfL = l / 2; final int halfP = p / 2; final int L2 = factorRow * l; final in... | SarUtils { public static ComplexDoubleMatrix oversample(ComplexDoubleMatrix inputMatrix, final int factorRow, final int factorCol) throws IllegalArgumentException { final int l = inputMatrix.rows; final int p = inputMatrix.columns; final int halfL = l / 2; final int halfP = p / 2; final int L2 = factorRow * l; final in... | SarUtils { public static ComplexDoubleMatrix oversample(ComplexDoubleMatrix inputMatrix, final int factorRow, final int factorCol) throws IllegalArgumentException { final int l = inputMatrix.rows; final int p = inputMatrix.columns; final int halfL = l / 2; final int halfP = p / 2; final int L2 = factorRow * l; final in... |
@Test public void testCoherence() throws Exception { String fileTestDataName_1 = testDataLocationCoh + "CINT_input" + ".cr4.swap"; String fileTestDataName_2 = testDataLocationCoh + "NORMS_input" + ".cr4.swap"; final int nRows = 128; final int nCols = 512; final ComplexDoubleMatrix masterCplx = readCplxFloatData(fileTes... | @Deprecated public static DoubleMatrix coherence(final ComplexDoubleMatrix inputMatrix, final ComplexDoubleMatrix normsMatrix, final int winL, final int winP) { logger.trace("coherence ver #2"); if (!(winL >= winP)) { logger.warn("coherence: estimator window size L<P not very efficiently programmed."); } if (inputMatri... | SarUtils { @Deprecated public static DoubleMatrix coherence(final ComplexDoubleMatrix inputMatrix, final ComplexDoubleMatrix normsMatrix, final int winL, final int winP) { logger.trace("coherence ver #2"); if (!(winL >= winP)) { logger.warn("coherence: estimator window size L<P not very efficiently programmed."); } if ... | SarUtils { @Deprecated public static DoubleMatrix coherence(final ComplexDoubleMatrix inputMatrix, final ComplexDoubleMatrix normsMatrix, final int winL, final int winP) { logger.trace("coherence ver #2"); if (!(winL >= winP)) { logger.warn("coherence: estimator window size L<P not very efficiently programmed."); } if ... | SarUtils { @Deprecated public static DoubleMatrix coherence(final ComplexDoubleMatrix inputMatrix, final ComplexDoubleMatrix normsMatrix, final int winL, final int winP) { logger.trace("coherence ver #2"); if (!(winL >= winP)) { logger.warn("coherence: estimator window size L<P not very efficiently programmed."); } if ... | SarUtils { @Deprecated public static DoubleMatrix coherence(final ComplexDoubleMatrix inputMatrix, final ComplexDoubleMatrix normsMatrix, final int winL, final int winP) { logger.trace("coherence ver #2"); if (!(winL >= winP)) { logger.warn("coherence: estimator window size L<P not very efficiently programmed."); } if ... |
@Test public void testCoherence2() throws Exception { String fileTestDataName_1 = testDataLocationCoh + "CINT_input" + ".cr4.swap"; String fileTestDataName_2 = testDataLocationCoh + "NORMS_input" + ".cr4.swap"; final int nRows = 128; final int nCols = 512; final ComplexDoubleMatrix masterCplx = readCplxFloatData(fileTe... | public static DoubleMatrix coherence2(final ComplexDoubleMatrix input, final ComplexDoubleMatrix norms, final int winL, final int winP) { logger.trace("coherence ver #2"); if (!(winL >= winP)) { logger.warn("coherence: estimator window size L<P not very efficiently programmed."); } if (input.rows != norms.rows || input... | SarUtils { public static DoubleMatrix coherence2(final ComplexDoubleMatrix input, final ComplexDoubleMatrix norms, final int winL, final int winP) { logger.trace("coherence ver #2"); if (!(winL >= winP)) { logger.warn("coherence: estimator window size L<P not very efficiently programmed."); } if (input.rows != norms.ro... | SarUtils { public static DoubleMatrix coherence2(final ComplexDoubleMatrix input, final ComplexDoubleMatrix norms, final int winL, final int winP) { logger.trace("coherence ver #2"); if (!(winL >= winP)) { logger.warn("coherence: estimator window size L<P not very efficiently programmed."); } if (input.rows != norms.ro... | SarUtils { public static DoubleMatrix coherence2(final ComplexDoubleMatrix input, final ComplexDoubleMatrix norms, final int winL, final int winP) { logger.trace("coherence ver #2"); if (!(winL >= winP)) { logger.warn("coherence: estimator window size L<P not very efficiently programmed."); } if (input.rows != norms.ro... | SarUtils { public static DoubleMatrix coherence2(final ComplexDoubleMatrix input, final ComplexDoubleMatrix norms, final int winL, final int winP) { logger.trace("coherence ver #2"); if (!(winL >= winP)) { logger.warn("coherence: estimator window size L<P not very efficiently programmed."); } if (input.rows != norms.ro... |
@Test public void testComplexOvsmpIfg() throws Exception { int[] ovsmpAz = new int[]{1, 2, 2, 3}; int[] ovsmpRg = new int[]{2, 1, 2, 3}; for (int i = 0; i < ovsmpAz.length; i++) { int ovsAz = ovsmpAz[i]; int ovsRg = ovsmpRg[i]; String fileTestDataName = testDataLocation + "testdata_ifg_ovsmp_" + ovsAz + "_" + ovsRg + "... | public static ComplexDoubleMatrix computeIfg(final ComplexDoubleMatrix masterData, final ComplexDoubleMatrix slaveData) throws Exception { return LinearAlgebraUtils.dotmult(masterData, slaveData.conj()); } | SarUtils { public static ComplexDoubleMatrix computeIfg(final ComplexDoubleMatrix masterData, final ComplexDoubleMatrix slaveData) throws Exception { return LinearAlgebraUtils.dotmult(masterData, slaveData.conj()); } } | SarUtils { public static ComplexDoubleMatrix computeIfg(final ComplexDoubleMatrix masterData, final ComplexDoubleMatrix slaveData) throws Exception { return LinearAlgebraUtils.dotmult(masterData, slaveData.conj()); } } | SarUtils { public static ComplexDoubleMatrix computeIfg(final ComplexDoubleMatrix masterData, final ComplexDoubleMatrix slaveData) throws Exception { return LinearAlgebraUtils.dotmult(masterData, slaveData.conj()); } static ComplexDoubleMatrix oversample(ComplexDoubleMatrix inputMatrix, final int factorRow, final int ... | SarUtils { public static ComplexDoubleMatrix computeIfg(final ComplexDoubleMatrix masterData, final ComplexDoubleMatrix slaveData) throws Exception { return LinearAlgebraUtils.dotmult(masterData, slaveData.conj()); } static ComplexDoubleMatrix oversample(ComplexDoubleMatrix inputMatrix, final int factorRow, final int ... |
@Test public void testComplexIfg() throws Exception { String fileTestDataName = testDataLocation + "testdata_ifg_ovsmp_" + 1 + "_" + 1 + ".cr8"; ComplexDoubleMatrix ifgCplx_EXPECTED = readCplxDoubleData(fileTestDataName, nRows, nCols, ByteOrder.LITTLE_ENDIAN); ComplexDoubleMatrix ifgCplx_ACTUAL = SarUtils.computeIfg(cp... | public static ComplexDoubleMatrix computeIfg(final ComplexDoubleMatrix masterData, final ComplexDoubleMatrix slaveData) throws Exception { return LinearAlgebraUtils.dotmult(masterData, slaveData.conj()); } | SarUtils { public static ComplexDoubleMatrix computeIfg(final ComplexDoubleMatrix masterData, final ComplexDoubleMatrix slaveData) throws Exception { return LinearAlgebraUtils.dotmult(masterData, slaveData.conj()); } } | SarUtils { public static ComplexDoubleMatrix computeIfg(final ComplexDoubleMatrix masterData, final ComplexDoubleMatrix slaveData) throws Exception { return LinearAlgebraUtils.dotmult(masterData, slaveData.conj()); } } | SarUtils { public static ComplexDoubleMatrix computeIfg(final ComplexDoubleMatrix masterData, final ComplexDoubleMatrix slaveData) throws Exception { return LinearAlgebraUtils.dotmult(masterData, slaveData.conj()); } static ComplexDoubleMatrix oversample(ComplexDoubleMatrix inputMatrix, final int factorRow, final int ... | SarUtils { public static ComplexDoubleMatrix computeIfg(final ComplexDoubleMatrix masterData, final ComplexDoubleMatrix slaveData) throws Exception { return LinearAlgebraUtils.dotmult(masterData, slaveData.conj()); } static ComplexDoubleMatrix oversample(ComplexDoubleMatrix inputMatrix, final int factorRow, final int ... |
@Test public void testIntensity() throws Exception { DoubleMatrix intensity_ACTUAL = SarUtils.intensity(cplxData); Assert.assertEquals(DoubleMatrix.ones(cplxData.rows, cplxData.columns), intensity_ACTUAL); } | public static DoubleMatrix intensity(final ComplexDoubleMatrix inputMatrix) { return pow(inputMatrix.real(), 2).add(pow(inputMatrix.imag(), 2)); } | SarUtils { public static DoubleMatrix intensity(final ComplexDoubleMatrix inputMatrix) { return pow(inputMatrix.real(), 2).add(pow(inputMatrix.imag(), 2)); } } | SarUtils { public static DoubleMatrix intensity(final ComplexDoubleMatrix inputMatrix) { return pow(inputMatrix.real(), 2).add(pow(inputMatrix.imag(), 2)); } } | SarUtils { public static DoubleMatrix intensity(final ComplexDoubleMatrix inputMatrix) { return pow(inputMatrix.real(), 2).add(pow(inputMatrix.imag(), 2)); } static ComplexDoubleMatrix oversample(ComplexDoubleMatrix inputMatrix, final int factorRow, final int factorCol); static DoubleMatrix intensity(final ComplexDoub... | SarUtils { public static DoubleMatrix intensity(final ComplexDoubleMatrix inputMatrix) { return pow(inputMatrix.real(), 2).add(pow(inputMatrix.imag(), 2)); } static ComplexDoubleMatrix oversample(ComplexDoubleMatrix inputMatrix, final int factorRow, final int factorCol); static DoubleMatrix intensity(final ComplexDoub... |
@Test public void testMagnitude() throws Exception { DoubleMatrix magnitude_ACTUAL = SarUtils.magnitude(cplxData); Assert.assertEquals(DoubleMatrix.ones(cplxData.rows, cplxData.columns), magnitude_ACTUAL); } | public static DoubleMatrix magnitude(final ComplexDoubleMatrix inputMatrix) { return sqrt(intensity(inputMatrix)); } | SarUtils { public static DoubleMatrix magnitude(final ComplexDoubleMatrix inputMatrix) { return sqrt(intensity(inputMatrix)); } } | SarUtils { public static DoubleMatrix magnitude(final ComplexDoubleMatrix inputMatrix) { return sqrt(intensity(inputMatrix)); } } | SarUtils { public static DoubleMatrix magnitude(final ComplexDoubleMatrix inputMatrix) { return sqrt(intensity(inputMatrix)); } static ComplexDoubleMatrix oversample(ComplexDoubleMatrix inputMatrix, final int factorRow, final int factorCol); static DoubleMatrix intensity(final ComplexDoubleMatrix inputMatrix); static ... | SarUtils { public static DoubleMatrix magnitude(final ComplexDoubleMatrix inputMatrix) { return sqrt(intensity(inputMatrix)); } static ComplexDoubleMatrix oversample(ComplexDoubleMatrix inputMatrix, final int factorRow, final int factorCol); static DoubleMatrix intensity(final ComplexDoubleMatrix inputMatrix); static ... |
@Ignore @Test public void testShowdata() throws Exception { inputEll.showdata(); } | public void showdata() { logger.info("ELLIPSOID: \tEllipsoid used (orbit, output): " + name + "."); logger.info("ELLIPSOID: a = " + a); logger.info("ELLIPSOID: b = " + b); logger.info("ELLIPSOID: e2 = " + e2); logger.info("ELLIPSOID: e2' = " + e2b); } | Ellipsoid { public void showdata() { logger.info("ELLIPSOID: \tEllipsoid used (orbit, output): " + name + "."); logger.info("ELLIPSOID: a = " + a); logger.info("ELLIPSOID: b = " + b); logger.info("ELLIPSOID: e2 = " + e2); logger.info("ELLIPSOID: e2' = " + e2b); } } | Ellipsoid { public void showdata() { logger.info("ELLIPSOID: \tEllipsoid used (orbit, output): " + name + "."); logger.info("ELLIPSOID: a = " + a); logger.info("ELLIPSOID: b = " + b); logger.info("ELLIPSOID: e2 = " + e2); logger.info("ELLIPSOID: e2' = " + e2b); } Ellipsoid(); Ellipsoid(final double semiMajor, final do... | Ellipsoid { public void showdata() { logger.info("ELLIPSOID: \tEllipsoid used (orbit, output): " + name + "."); logger.info("ELLIPSOID: a = " + a); logger.info("ELLIPSOID: b = " + b); logger.info("ELLIPSOID: e2 = " + e2); logger.info("ELLIPSOID: e2' = " + e2b); } Ellipsoid(); Ellipsoid(final double semiMajor, final do... | Ellipsoid { public void showdata() { logger.info("ELLIPSOID: \tEllipsoid used (orbit, output): " + name + "."); logger.info("ELLIPSOID: a = " + a); logger.info("ELLIPSOID: b = " + b); logger.info("ELLIPSOID: e2 = " + e2); logger.info("ELLIPSOID: e2' = " + e2b); } Ellipsoid(); Ellipsoid(final double semiMajor, final do... |
@Test public void testXyz2ell() throws Exception { double[] phi_lambda_height = Ellipsoid.xyz2ell(new Point(cr_XYZ_expected)); Assert.assertEquals(cr_GEO_expected[0], Math.toDegrees(phi_lambda_height[0]), deltaGEO); Assert.assertEquals(cr_GEO_expected[1], Math.toDegrees(phi_lambda_height[1]), deltaGEO); Assert.assertEq... | public static double[] xyz2ell(final Point xyz) { final double r = Math.sqrt(Math.pow(xyz.x, 2) + Math.pow(xyz.y, 2)); final double nu = Math.atan2((xyz.z * a), (r * b)); final double sin3 = Math.pow(Math.sin(nu), 3); final double cos3 = Math.pow(Math.cos(nu), 3); final double phi = Math.atan2((xyz.z + e2b * b * sin3),... | Ellipsoid { public static double[] xyz2ell(final Point xyz) { final double r = Math.sqrt(Math.pow(xyz.x, 2) + Math.pow(xyz.y, 2)); final double nu = Math.atan2((xyz.z * a), (r * b)); final double sin3 = Math.pow(Math.sin(nu), 3); final double cos3 = Math.pow(Math.cos(nu), 3); final double phi = Math.atan2((xyz.z + e2b ... | Ellipsoid { public static double[] xyz2ell(final Point xyz) { final double r = Math.sqrt(Math.pow(xyz.x, 2) + Math.pow(xyz.y, 2)); final double nu = Math.atan2((xyz.z * a), (r * b)); final double sin3 = Math.pow(Math.sin(nu), 3); final double cos3 = Math.pow(Math.cos(nu), 3); final double phi = Math.atan2((xyz.z + e2b ... | Ellipsoid { public static double[] xyz2ell(final Point xyz) { final double r = Math.sqrt(Math.pow(xyz.x, 2) + Math.pow(xyz.y, 2)); final double nu = Math.atan2((xyz.z * a), (r * b)); final double sin3 = Math.pow(Math.sin(nu), 3); final double cos3 = Math.pow(Math.cos(nu), 3); final double phi = Math.atan2((xyz.z + e2b ... | Ellipsoid { public static double[] xyz2ell(final Point xyz) { final double r = Math.sqrt(Math.pow(xyz.x, 2) + Math.pow(xyz.y, 2)); final double nu = Math.atan2((xyz.z * a), (r * b)); final double sin3 = Math.pow(Math.sin(nu), 3); final double cos3 = Math.pow(Math.cos(nu), 3); final double phi = Math.atan2((xyz.z + e2b ... |
@Test public void testEll2xyz() throws Exception { Point cr4_XYZ_actual = Ellipsoid.ell2xyz(cr_GEO_expected[0] * DTOR, cr_GEO_expected[1] * DTOR, cr_GEO_expected[2]); for (int i = 0; i < cr_XYZ_expected.length; i++) { Assert.assertEquals(cr_XYZ_expected[i],cr4_XYZ_actual.toArray()[i], deltaXYZ); } } | public static Point ell2xyz(final double phi, final double lambda, final double height) throws IllegalArgumentException { if (phi > Math.PI || phi < -Math.PI || lambda > Math.PI || lambda < -Math.PI) { throw new IllegalArgumentException("Ellipsoid.ell2xyz : input values for phi/lambda have to be in radians!"); } final ... | Ellipsoid { public static Point ell2xyz(final double phi, final double lambda, final double height) throws IllegalArgumentException { if (phi > Math.PI || phi < -Math.PI || lambda > Math.PI || lambda < -Math.PI) { throw new IllegalArgumentException("Ellipsoid.ell2xyz : input values for phi/lambda have to be in radians!... | Ellipsoid { public static Point ell2xyz(final double phi, final double lambda, final double height) throws IllegalArgumentException { if (phi > Math.PI || phi < -Math.PI || lambda > Math.PI || lambda < -Math.PI) { throw new IllegalArgumentException("Ellipsoid.ell2xyz : input values for phi/lambda have to be in radians!... | Ellipsoid { public static Point ell2xyz(final double phi, final double lambda, final double height) throws IllegalArgumentException { if (phi > Math.PI || phi < -Math.PI || lambda > Math.PI || lambda < -Math.PI) { throw new IllegalArgumentException("Ellipsoid.ell2xyz : input values for phi/lambda have to be in radians!... | Ellipsoid { public static Point ell2xyz(final double phi, final double lambda, final double height) throws IllegalArgumentException { if (phi > Math.PI || phi < -Math.PI || lambda > Math.PI || lambda < -Math.PI) { throw new IllegalArgumentException("Ellipsoid.ell2xyz : input values for phi/lambda have to be in radians!... |
@Test public void testEll2xyz_ARRAYS() throws Exception { GeoPoint geoPoint_EXPECTED = new GeoPoint(cr_GEO_expected[0], cr_GEO_expected[1]); double[] xyz_ACTUAL = new double[3]; Ellipsoid.ell2xyz(geoPoint_EXPECTED, cr_GEO_expected[2], xyz_ACTUAL); for (int i = 0; i < cr_XYZ_expected.length; i++) { Assert.assertEquals(c... | public static Point ell2xyz(final double phi, final double lambda, final double height) throws IllegalArgumentException { if (phi > Math.PI || phi < -Math.PI || lambda > Math.PI || lambda < -Math.PI) { throw new IllegalArgumentException("Ellipsoid.ell2xyz : input values for phi/lambda have to be in radians!"); } final ... | Ellipsoid { public static Point ell2xyz(final double phi, final double lambda, final double height) throws IllegalArgumentException { if (phi > Math.PI || phi < -Math.PI || lambda > Math.PI || lambda < -Math.PI) { throw new IllegalArgumentException("Ellipsoid.ell2xyz : input values for phi/lambda have to be in radians!... | Ellipsoid { public static Point ell2xyz(final double phi, final double lambda, final double height) throws IllegalArgumentException { if (phi > Math.PI || phi < -Math.PI || lambda > Math.PI || lambda < -Math.PI) { throw new IllegalArgumentException("Ellipsoid.ell2xyz : input values for phi/lambda have to be in radians!... | Ellipsoid { public static Point ell2xyz(final double phi, final double lambda, final double height) throws IllegalArgumentException { if (phi > Math.PI || phi < -Math.PI || lambda > Math.PI || lambda < -Math.PI) { throw new IllegalArgumentException("Ellipsoid.ell2xyz : input values for phi/lambda have to be in radians!... | Ellipsoid { public static Point ell2xyz(final double phi, final double lambda, final double height) throws IllegalArgumentException { if (phi > Math.PI || phi < -Math.PI || lambda > Math.PI || lambda < -Math.PI) { throw new IllegalArgumentException("Ellipsoid.ell2xyz : input values for phi/lambda have to be in radians!... |
@Test public void testPointByReference_lph2xyz() throws Exception { Point t1 = orbit_ACTUAL.lph2xyz(1, 1, 0, slcimage); Point t2 = orbit_ACTUAL.lph2xyz(1, 1, 1, slcimage); Assert.assertFalse(t1 == t2); } | public Point lph2xyz(final double line, final double pixel, final double height, final SLCImage slcimage) throws Exception { logger.setLevel(Level.OFF); Point satellitePosition; Point satelliteVelocity; Point ellipsoidPosition; double[] equationSet = new double[3]; double[][] partialsXYZ = new double[3][3]; double azTi... | Orbit { public Point lph2xyz(final double line, final double pixel, final double height, final SLCImage slcimage) throws Exception { logger.setLevel(Level.OFF); Point satellitePosition; Point satelliteVelocity; Point ellipsoidPosition; double[] equationSet = new double[3]; double[][] partialsXYZ = new double[3][3]; dou... | Orbit { public Point lph2xyz(final double line, final double pixel, final double height, final SLCImage slcimage) throws Exception { logger.setLevel(Level.OFF); Point satellitePosition; Point satelliteVelocity; Point ellipsoidPosition; double[] equationSet = new double[3]; double[][] partialsXYZ = new double[3][3]; dou... | Orbit { public Point lph2xyz(final double line, final double pixel, final double height, final SLCImage slcimage) throws Exception { logger.setLevel(Level.OFF); Point satellitePosition; Point satelliteVelocity; Point ellipsoidPosition; double[] equationSet = new double[3]; double[][] partialsXYZ = new double[3][3]; dou... | Orbit { public Point lph2xyz(final double line, final double pixel, final double height, final SLCImage slcimage) throws Exception { logger.setLevel(Level.OFF); Point satellitePosition; Point satelliteVelocity; Point ellipsoidPosition; double[] equationSet = new double[3]; double[][] partialsXYZ = new double[3][3]; dou... |
@Test public void testLph2ell() throws Exception { final double[] crGEO_ACTUAL = orbit_ACTUAL.lph2ell(subPixel_EXPECTED.y, subPixel_EXPECTED.x, subPixel_EXPECTED.z, slcimage); Assert.assertEquals(crGEO_EXPECTED[0], crGEO_ACTUAL[0] * Constants.RTOD, eps_06); Assert.assertEquals(crGEO_EXPECTED[1], crGEO_ACTUAL[1] * Const... | public synchronized double[] lph2ell(final double line, final double pixel, final double height, final SLCImage slcimage) throws Exception { final Point xyz = lph2xyz(line, pixel, height, slcimage); return Ellipsoid.xyz2ell(xyz); } | Orbit { public synchronized double[] lph2ell(final double line, final double pixel, final double height, final SLCImage slcimage) throws Exception { final Point xyz = lph2xyz(line, pixel, height, slcimage); return Ellipsoid.xyz2ell(xyz); } } | Orbit { public synchronized double[] lph2ell(final double line, final double pixel, final double height, final SLCImage slcimage) throws Exception { final Point xyz = lph2xyz(line, pixel, height, slcimage); return Ellipsoid.xyz2ell(xyz); } Orbit(); Orbit(double[] timeVector, double[] xVector, double[] yVector, double[... | Orbit { public synchronized double[] lph2ell(final double line, final double pixel, final double height, final SLCImage slcimage) throws Exception { final Point xyz = lph2xyz(line, pixel, height, slcimage); return Ellipsoid.xyz2ell(xyz); } Orbit(); Orbit(double[] timeVector, double[] xVector, double[] yVector, double[... | Orbit { public synchronized double[] lph2ell(final double line, final double pixel, final double height, final SLCImage slcimage) throws Exception { final Point xyz = lph2xyz(line, pixel, height, slcimage); return Ellipsoid.xyz2ell(xyz); } Orbit(); Orbit(double[] timeVector, double[] xVector, double[] yVector, double[... |
@Test public void testDinsar() throws Exception { ComplexDoubleMatrix defoData = cplxIfg.dup(); StopWatch watch = new StopWatch(); watch.start(); DInSAR dinsar = new DInSAR(masterMeta, masterOrbit, defoSlaveMeta, defoSlaveOrbit, topoSlaveMeta, topoSlaveOrbit); dinsar.setDataWindow(totalDataWindow); dinsar.computeBperpR... | public DInSAR(SLCImage masterMeta, Orbit masterOrbit, SLCImage slaveDefoMeta, Orbit slaveDefoOrbit, SLCImage topoSlaveMeta, Orbit slaveTopoOrbit) { this.masterMeta = masterMeta; this.masterOrbit = masterOrbit; this.slaveDefoMeta = slaveDefoMeta; this.slaveDefoOrbit = slaveDefoOrbit; this.topoSlaveMeta = topoSlaveMeta; ... | DInSAR { public DInSAR(SLCImage masterMeta, Orbit masterOrbit, SLCImage slaveDefoMeta, Orbit slaveDefoOrbit, SLCImage topoSlaveMeta, Orbit slaveTopoOrbit) { this.masterMeta = masterMeta; this.masterOrbit = masterOrbit; this.slaveDefoMeta = slaveDefoMeta; this.slaveDefoOrbit = slaveDefoOrbit; this.topoSlaveMeta = topoSl... | DInSAR { public DInSAR(SLCImage masterMeta, Orbit masterOrbit, SLCImage slaveDefoMeta, Orbit slaveDefoOrbit, SLCImage topoSlaveMeta, Orbit slaveTopoOrbit) { this.masterMeta = masterMeta; this.masterOrbit = masterOrbit; this.slaveDefoMeta = slaveDefoMeta; this.slaveDefoOrbit = slaveDefoOrbit; this.topoSlaveMeta = topoSl... | DInSAR { public DInSAR(SLCImage masterMeta, Orbit masterOrbit, SLCImage slaveDefoMeta, Orbit slaveDefoOrbit, SLCImage topoSlaveMeta, Orbit slaveTopoOrbit) { this.masterMeta = masterMeta; this.masterOrbit = masterOrbit; this.slaveDefoMeta = slaveDefoMeta; this.slaveDefoOrbit = slaveDefoOrbit; this.topoSlaveMeta = topoSl... | DInSAR { public DInSAR(SLCImage masterMeta, Orbit masterOrbit, SLCImage slaveDefoMeta, Orbit slaveDefoOrbit, SLCImage topoSlaveMeta, Orbit slaveTopoOrbit) { this.masterMeta = masterMeta; this.masterOrbit = masterOrbit; this.slaveDefoMeta = slaveDefoMeta; this.slaveDefoOrbit = slaveDefoOrbit; this.topoSlaveMeta = topoSl... |
@Test public void testSchwabisch() throws Exception{ int nPoints = 200; int nHeights = 3; int degree1d = 2; int degree2d = 5; DoubleMatrix inputTile = unwrappedPhase.dup(); StopWatch watch = new StopWatch(); watch.start(); final Slant2Height slant = new Slant2Height(nPoints, nHeights, degree1d, degree2d, master, master... | public void schwabisch() throws Exception { logger.trace("slant2h Schwabisch (PM 01-Apr-2011)"); final int heightStep = MAXHEIGHT / (nHeights - 1); DoubleMatrix refPhaseMatrix = new DoubleMatrix(nPoints, nHeights); int[][] positionArray = MathUtils.distributePoints(nPoints, dataWindow); DoubleMatrix Position = new Doub... | Slant2Height { public void schwabisch() throws Exception { logger.trace("slant2h Schwabisch (PM 01-Apr-2011)"); final int heightStep = MAXHEIGHT / (nHeights - 1); DoubleMatrix refPhaseMatrix = new DoubleMatrix(nPoints, nHeights); int[][] positionArray = MathUtils.distributePoints(nPoints, dataWindow); DoubleMatrix Posi... | Slant2Height { public void schwabisch() throws Exception { logger.trace("slant2h Schwabisch (PM 01-Apr-2011)"); final int heightStep = MAXHEIGHT / (nHeights - 1); DoubleMatrix refPhaseMatrix = new DoubleMatrix(nPoints, nHeights); int[][] positionArray = MathUtils.distributePoints(nPoints, dataWindow); DoubleMatrix Posi... | Slant2Height { public void schwabisch() throws Exception { logger.trace("slant2h Schwabisch (PM 01-Apr-2011)"); final int heightStep = MAXHEIGHT / (nHeights - 1); DoubleMatrix refPhaseMatrix = new DoubleMatrix(nPoints, nHeights); int[][] positionArray = MathUtils.distributePoints(nPoints, dataWindow); DoubleMatrix Posi... | Slant2Height { public void schwabisch() throws Exception { logger.trace("slant2h Schwabisch (PM 01-Apr-2011)"); final int heightStep = MAXHEIGHT / (nHeights - 1); DoubleMatrix refPhaseMatrix = new DoubleMatrix(nPoints, nHeights); int[][] positionArray = MathUtils.distributePoints(nPoints, dataWindow); DoubleMatrix Posi... |
@Test public void testPix2tr() throws Exception { double rgTime_ACTUAL = master.pix2tr(pixel_EXPECTED); Assert.assertEquals(rgTime_EXPECTED, rgTime_ACTUAL, eps05); } | public double pix2tr(double pixel) { return tRange1 + ((pixel - 1.0) / rsr2x); } | SLCImage { public double pix2tr(double pixel) { return tRange1 + ((pixel - 1.0) / rsr2x); } } | SLCImage { public double pix2tr(double pixel) { return tRange1 + ((pixel - 1.0) / rsr2x); } SLCImage(); SLCImage(MetadataElement element); } | SLCImage { public double pix2tr(double pixel) { return tRange1 + ((pixel - 1.0) / rsr2x); } SLCImage(); SLCImage(MetadataElement element); void parseResFile(File resFileName); double pix2tr(double pixel); double pix2range(double pixel); double tr2pix(double rangeTime); double line2ta(double line); double ta2line(doubl... | SLCImage { public double pix2tr(double pixel) { return tRange1 + ((pixel - 1.0) / rsr2x); } SLCImage(); SLCImage(MetadataElement element); void parseResFile(File resFileName); double pix2tr(double pixel); double pix2range(double pixel); double tr2pix(double rangeTime); double line2ta(double line); double ta2line(doubl... |
@Test public void testTr2pix() throws Exception { double pixel_ACTUAL = master.tr2pix(rgTime_EXPECTED); Assert.assertEquals(pixel_EXPECTED, pixel_ACTUAL, eps05); } | public double tr2pix(double rangeTime) { return 1.0 + (rsr2x * (rangeTime - tRange1)); } | SLCImage { public double tr2pix(double rangeTime) { return 1.0 + (rsr2x * (rangeTime - tRange1)); } } | SLCImage { public double tr2pix(double rangeTime) { return 1.0 + (rsr2x * (rangeTime - tRange1)); } SLCImage(); SLCImage(MetadataElement element); } | SLCImage { public double tr2pix(double rangeTime) { return 1.0 + (rsr2x * (rangeTime - tRange1)); } SLCImage(); SLCImage(MetadataElement element); void parseResFile(File resFileName); double pix2tr(double pixel); double pix2range(double pixel); double tr2pix(double rangeTime); double line2ta(double line); double ta2li... | SLCImage { public double tr2pix(double rangeTime) { return 1.0 + (rsr2x * (rangeTime - tRange1)); } SLCImage(); SLCImage(MetadataElement element); void parseResFile(File resFileName); double pix2tr(double pixel); double pix2range(double pixel); double tr2pix(double rangeTime); double line2ta(double line); double ta2li... |
@Test public void testLine2ta() throws Exception { double azTime_ACTUAL = master.line2ta(line_EXPECTED); Assert.assertEquals(azTime_EXPECTED, azTime_ACTUAL, eps05); } | public double line2ta(double line) { return tAzi1 + ((line - 1.0) / PRF); } | SLCImage { public double line2ta(double line) { return tAzi1 + ((line - 1.0) / PRF); } } | SLCImage { public double line2ta(double line) { return tAzi1 + ((line - 1.0) / PRF); } SLCImage(); SLCImage(MetadataElement element); } | SLCImage { public double line2ta(double line) { return tAzi1 + ((line - 1.0) / PRF); } SLCImage(); SLCImage(MetadataElement element); void parseResFile(File resFileName); double pix2tr(double pixel); double pix2range(double pixel); double tr2pix(double rangeTime); double line2ta(double line); double ta2line(double azi... | SLCImage { public double line2ta(double line) { return tAzi1 + ((line - 1.0) / PRF); } SLCImage(); SLCImage(MetadataElement element); void parseResFile(File resFileName); double pix2tr(double pixel); double pix2range(double pixel); double tr2pix(double rangeTime); double line2ta(double line); double ta2line(double azi... |
@Test public void testTa2line() throws Exception { double line_ACTUAL = master.ta2line(azTime_EXPECTED); Assert.assertEquals(line_EXPECTED, line_ACTUAL, eps02); } | public double ta2line(double azitime) { return 1.0 + PRF * (azitime - tAzi1); } | SLCImage { public double ta2line(double azitime) { return 1.0 + PRF * (azitime - tAzi1); } } | SLCImage { public double ta2line(double azitime) { return 1.0 + PRF * (azitime - tAzi1); } SLCImage(); SLCImage(MetadataElement element); } | SLCImage { public double ta2line(double azitime) { return 1.0 + PRF * (azitime - tAzi1); } SLCImage(); SLCImage(MetadataElement element); void parseResFile(File resFileName); double pix2tr(double pixel); double pix2range(double pixel); double tr2pix(double rangeTime); double line2ta(double line); double ta2line(double... | SLCImage { public double ta2line(double azitime) { return 1.0 + PRF * (azitime - tAzi1); } SLCImage(); SLCImage(MetadataElement element); void parseResFile(File resFileName); double pix2tr(double pixel); double pix2range(double pixel); double tr2pix(double rangeTime); double line2ta(double line); double ta2line(double... |
@Test public void testLp2t() throws Exception { final Point sarPoint = new Point(pixel_EXPECTED, line_EXPECTED); final Point timePoint = master.lp2t(sarPoint); Assert.assertEquals(rgTime_EXPECTED, timePoint.x, eps05); Assert.assertEquals(azTime_EXPECTED, timePoint.y, eps05); } | public Point lp2t(Point p) { return new Point(pix2tr(p.x), line2ta(p.y)); } | SLCImage { public Point lp2t(Point p) { return new Point(pix2tr(p.x), line2ta(p.y)); } } | SLCImage { public Point lp2t(Point p) { return new Point(pix2tr(p.x), line2ta(p.y)); } SLCImage(); SLCImage(MetadataElement element); } | SLCImage { public Point lp2t(Point p) { return new Point(pix2tr(p.x), line2ta(p.y)); } SLCImage(); SLCImage(MetadataElement element); void parseResFile(File resFileName); double pix2tr(double pixel); double pix2range(double pixel); double tr2pix(double rangeTime); double line2ta(double line); double ta2line(double azi... | SLCImage { public Point lp2t(Point p) { return new Point(pix2tr(p.x), line2ta(p.y)); } SLCImage(); SLCImage(MetadataElement element); void parseResFile(File resFileName); double pix2tr(double pixel); double pix2range(double pixel); double tr2pix(double rangeTime); double line2ta(double line); double ta2line(double azi... |
@Test public void testComputeDeltaRange() throws Exception { Assert.assertEquals(deltaRange_EXPECTED, master.computeDeltaRange(CORNER_REFLECTOR_4), eps05); } | public double computeDeltaRange(double pixel) { return mlRg * (pix2range(pixel + 1) - pix2range(pixel)); } | SLCImage { public double computeDeltaRange(double pixel) { return mlRg * (pix2range(pixel + 1) - pix2range(pixel)); } } | SLCImage { public double computeDeltaRange(double pixel) { return mlRg * (pix2range(pixel + 1) - pix2range(pixel)); } SLCImage(); SLCImage(MetadataElement element); } | SLCImage { public double computeDeltaRange(double pixel) { return mlRg * (pix2range(pixel + 1) - pix2range(pixel)); } SLCImage(); SLCImage(MetadataElement element); void parseResFile(File resFileName); double pix2tr(double pixel); double pix2range(double pixel); double tr2pix(double rangeTime); double line2ta(double l... | SLCImage { public double computeDeltaRange(double pixel) { return mlRg * (pix2range(pixel + 1) - pix2range(pixel)); } SLCImage(); SLCImage(MetadataElement element); void parseResFile(File resFileName); double pix2tr(double pixel); double pix2range(double pixel); double tr2pix(double rangeTime); double line2ta(double l... |
@Test public void testComputeRangeResolution() throws Exception { Assert.assertEquals(rangeResolution_EXPECTED, master.computeRangeResolution(CORNER_REFLECTOR_4), eps05); } | public double computeRangeResolution(double pixel) { return ((rsr2x / 2.) / rangeBandwidth) * (computeDeltaRange(pixel) / mlRg); } | SLCImage { public double computeRangeResolution(double pixel) { return ((rsr2x / 2.) / rangeBandwidth) * (computeDeltaRange(pixel) / mlRg); } } | SLCImage { public double computeRangeResolution(double pixel) { return ((rsr2x / 2.) / rangeBandwidth) * (computeDeltaRange(pixel) / mlRg); } SLCImage(); SLCImage(MetadataElement element); } | SLCImage { public double computeRangeResolution(double pixel) { return ((rsr2x / 2.) / rangeBandwidth) * (computeDeltaRange(pixel) / mlRg); } SLCImage(); SLCImage(MetadataElement element); void parseResFile(File resFileName); double pix2tr(double pixel); double pix2range(double pixel); double tr2pix(double rangeTime);... | SLCImage { public double computeRangeResolution(double pixel) { return ((rsr2x / 2.) / rangeBandwidth) * (computeDeltaRange(pixel) / mlRg); } SLCImage(); SLCImage(MetadataElement element); void parseResFile(File resFileName); double pix2tr(double pixel); double pix2range(double pixel); double tr2pix(double rangeTime);... |
@Test public void firstTest_MagSpace() throws Exception { clock.start(); processingPath = "/d2/test.processing/unit_tests/etna.volcano/process/crop/01486_21159.cpm/"; dataPath = "coarseCorr/magSpace/"; masterFileName = "master.cr4"; slaveFileName = "slave.cr4"; masterMagnitudeFileName = "masterMagnitude.r4"; slaveMagni... | public DoubleMatrix correlate(DoubleMatrix A, DoubleMatrix Mask) { double varM = 0.; Mask.subi(Mask.mean()); for (int ii = 0; ii < Mask.length; ii++) { varM += Math.pow(Mask.get(ii), 2); } int beginl = (Mask.rows - 1) / 2; int beginp = (Mask.columns - 1) / 2; DoubleMatrix Result = DoubleMatrix.zeros(A.rows, A.columns);... | Coregistration implements ICoregistration { public DoubleMatrix correlate(DoubleMatrix A, DoubleMatrix Mask) { double varM = 0.; Mask.subi(Mask.mean()); for (int ii = 0; ii < Mask.length; ii++) { varM += Math.pow(Mask.get(ii), 2); } int beginl = (Mask.rows - 1) / 2; int beginp = (Mask.columns - 1) / 2; DoubleMatrix Res... | Coregistration implements ICoregistration { public DoubleMatrix correlate(DoubleMatrix A, DoubleMatrix Mask) { double varM = 0.; Mask.subi(Mask.mean()); for (int ii = 0; ii < Mask.length; ii++) { varM += Math.pow(Mask.get(ii), 2); } int beginl = (Mask.rows - 1) / 2; int beginp = (Mask.columns - 1) / 2; DoubleMatrix Res... | Coregistration implements ICoregistration { public DoubleMatrix correlate(DoubleMatrix A, DoubleMatrix Mask) { double varM = 0.; Mask.subi(Mask.mean()); for (int ii = 0; ii < Mask.length; ii++) { varM += Math.pow(Mask.get(ii), 2); } int beginl = (Mask.rows - 1) / 2; int beginp = (Mask.columns - 1) / 2; DoubleMatrix Res... | Coregistration implements ICoregistration { public DoubleMatrix correlate(DoubleMatrix A, DoubleMatrix Mask) { double varM = 0.; Mask.subi(Mask.mean()); for (int ii = 0; ii < Mask.length; ii++) { varM += Math.pow(Mask.get(ii), 2); } int beginl = (Mask.rows - 1) / 2; int beginp = (Mask.columns - 1) / 2; DoubleMatrix Res... |
@Test public void secondTest_MagFFT() throws Exception { processingPath = "/d2/test.processing/unit_tests/etna.volcano/process/crop/01486_21159.cpm/"; dataPath = "coarseCorr/magFFT/"; masterFileName = "master.cr4"; slaveFileName = "slave.cr4"; rows = 256; cols = 256; masterCplx = DataReader.readCplxFloatData(processing... | @Override public double crosscorrelate(ComplexDoubleMatrix Master, ComplexDoubleMatrix Mask, int ovsfactor, int AccL, int AccP, double offsetL, double offsetP) { logger.trace("crosscorrelate (PM 15-Apr-2012)"); final int L = Master.rows; final int P = Master.columns; final int twoL = 2 * L; final int twoP = 2 * P; fina... | Coregistration implements ICoregistration { @Override public double crosscorrelate(ComplexDoubleMatrix Master, ComplexDoubleMatrix Mask, int ovsfactor, int AccL, int AccP, double offsetL, double offsetP) { logger.trace("crosscorrelate (PM 15-Apr-2012)"); final int L = Master.rows; final int P = Master.columns; final in... | Coregistration implements ICoregistration { @Override public double crosscorrelate(ComplexDoubleMatrix Master, ComplexDoubleMatrix Mask, int ovsfactor, int AccL, int AccP, double offsetL, double offsetP) { logger.trace("crosscorrelate (PM 15-Apr-2012)"); final int L = Master.rows; final int P = Master.columns; final in... | Coregistration implements ICoregistration { @Override public double crosscorrelate(ComplexDoubleMatrix Master, ComplexDoubleMatrix Mask, int ovsfactor, int AccL, int AccP, double offsetL, double offsetP) { logger.trace("crosscorrelate (PM 15-Apr-2012)"); final int L = Master.rows; final int P = Master.columns; final in... | Coregistration implements ICoregistration { @Override public double crosscorrelate(ComplexDoubleMatrix Master, ComplexDoubleMatrix Mask, int ovsfactor, int AccL, int AccP, double offsetL, double offsetP) { logger.trace("crosscorrelate (PM 15-Apr-2012)"); final int L = Master.rows; final int P = Master.columns; final in... |
@Test public void secondTest_fineMagFFT() throws Exception { processingPath = "/d2/test.processing/unit_tests/etna.volcano/process/crop/01486_21159.cpm/"; dataPath = "fineCoreg/magFFT/"; masterFileName = "master_patch.32x32.cr4"; slaveFileName = "slave_patch.32x32.cr4"; rows = 32; cols = 32; masterCplx = DataReader.rea... | @Override public double crosscorrelate(ComplexDoubleMatrix Master, ComplexDoubleMatrix Mask, int ovsfactor, int AccL, int AccP, double offsetL, double offsetP) { logger.trace("crosscorrelate (PM 15-Apr-2012)"); final int L = Master.rows; final int P = Master.columns; final int twoL = 2 * L; final int twoP = 2 * P; fina... | Coregistration implements ICoregistration { @Override public double crosscorrelate(ComplexDoubleMatrix Master, ComplexDoubleMatrix Mask, int ovsfactor, int AccL, int AccP, double offsetL, double offsetP) { logger.trace("crosscorrelate (PM 15-Apr-2012)"); final int L = Master.rows; final int P = Master.columns; final in... | Coregistration implements ICoregistration { @Override public double crosscorrelate(ComplexDoubleMatrix Master, ComplexDoubleMatrix Mask, int ovsfactor, int AccL, int AccP, double offsetL, double offsetP) { logger.trace("crosscorrelate (PM 15-Apr-2012)"); final int L = Master.rows; final int P = Master.columns; final in... | Coregistration implements ICoregistration { @Override public double crosscorrelate(ComplexDoubleMatrix Master, ComplexDoubleMatrix Mask, int ovsfactor, int AccL, int AccP, double offsetL, double offsetP) { logger.trace("crosscorrelate (PM 15-Apr-2012)"); final int L = Master.rows; final int P = Master.columns; final in... | Coregistration implements ICoregistration { @Override public double crosscorrelate(ComplexDoubleMatrix Master, ComplexDoubleMatrix Mask, int ovsfactor, int AccL, int AccP, double offsetL, double offsetP) { logger.trace("crosscorrelate (PM 15-Apr-2012)"); final int L = Master.rows; final int P = Master.columns; final in... |
@Test public void thirdTest_shiftSpectrum() throws Exception { processingPath = "/d2/test.processing/unit_tests/etna.volcano/process/crop/01486_21159.cpm/"; dataPath = "fineCoreg/magFFT/"; masterFileName = "master_patch.32x32.cr4"; slaveFileName = "slave_patch.32x32.cr4"; rows = 32; cols = 32; masterCplx = DataReader.r... | public void shiftazispectrum(final ComplexDoubleMatrix data, final double prf, final double rsr2x, final double[] doppler, final double shift) { if (doppler[0] == 0 && doppler[1] == 0 && doppler[2] == 0) return; final int NLINES = data.rows; final int NCOLS = data.columns; final int SIGN = (shift < 0) ? -1 : 1; final d... | Coregistration implements ICoregistration { public void shiftazispectrum(final ComplexDoubleMatrix data, final double prf, final double rsr2x, final double[] doppler, final double shift) { if (doppler[0] == 0 && doppler[1] == 0 && doppler[2] == 0) return; final int NLINES = data.rows; final int NCOLS = data.columns; fi... | Coregistration implements ICoregistration { public void shiftazispectrum(final ComplexDoubleMatrix data, final double prf, final double rsr2x, final double[] doppler, final double shift) { if (doppler[0] == 0 && doppler[1] == 0 && doppler[2] == 0) return; final int NLINES = data.rows; final int NCOLS = data.columns; fi... | Coregistration implements ICoregistration { public void shiftazispectrum(final ComplexDoubleMatrix data, final double prf, final double rsr2x, final double[] doppler, final double shift) { if (doppler[0] == 0 && doppler[1] == 0 && doppler[2] == 0) return; final int NLINES = data.rows; final int NCOLS = data.columns; fi... | Coregistration implements ICoregistration { public void shiftazispectrum(final ComplexDoubleMatrix data, final double prf, final double rsr2x, final double[] doppler, final double shift) { if (doppler[0] == 0 && doppler[1] == 0 && doppler[2] == 0) return; final int NLINES = data.rows; final int NCOLS = data.columns; fi... |
@Test public void fifthTest_coherenceSpace() throws Exception { processingPath = "/d2/test.processing/unit_tests/etna.volcano/process/crop/01486_21159.cpm/"; dataPath = "fineCoreg/magSpace/"; masterFileName = "master_patch.48x48.cr4"; slaveFileName = "slave_patch.48x48.cr4"; rows = 48; cols = 48; masterCplx = DataReade... | @Override public double coherencespace(final int AccL, final int AccP, final int osfactor, ComplexDoubleMatrix Master, ComplexDoubleMatrix Mask, double offsetL, double offsetP) { logger.trace("coherencespace (PM 14-Feb-2012)"); final int L = Master.rows; final int P = Master.columns; final int factor = osfactor; final ... | Coregistration implements ICoregistration { @Override public double coherencespace(final int AccL, final int AccP, final int osfactor, ComplexDoubleMatrix Master, ComplexDoubleMatrix Mask, double offsetL, double offsetP) { logger.trace("coherencespace (PM 14-Feb-2012)"); final int L = Master.rows; final int P = Master.... | Coregistration implements ICoregistration { @Override public double coherencespace(final int AccL, final int AccP, final int osfactor, ComplexDoubleMatrix Master, ComplexDoubleMatrix Mask, double offsetL, double offsetP) { logger.trace("coherencespace (PM 14-Feb-2012)"); final int L = Master.rows; final int P = Master.... | Coregistration implements ICoregistration { @Override public double coherencespace(final int AccL, final int AccP, final int osfactor, ComplexDoubleMatrix Master, ComplexDoubleMatrix Mask, double offsetL, double offsetP) { logger.trace("coherencespace (PM 14-Feb-2012)"); final int L = Master.rows; final int P = Master.... | Coregistration implements ICoregistration { @Override public double coherencespace(final int AccL, final int AccP, final int osfactor, ComplexDoubleMatrix Master, ComplexDoubleMatrix Mask, double offsetL, double offsetP) { logger.trace("coherencespace (PM 14-Feb-2012)"); final int L = Master.rows; final int P = Master.... |
@Test public void sixthTest_Resampling() throws Exception { logger.trace("Start Resampling [development code]"); processingPath = "/d2/test.processing/unit_tests/etna.volcano/process/crop/01486_21159.cpm/"; dataPath = "rsmp/"; SLCImage master = new SLCImage(); master.parseResFile(new File(processingPath + dataPath + "0... | @Deprecated public static Window getOverlap(final Window master, final Window slave) { Window overlap = new Window(slave); if (master.linelo > overlap.linelo) overlap.linelo = master.linelo; if (master.linehi < overlap.linehi) overlap.linehi = master.linehi; if (master.pixlo > overlap.pixlo) overlap.pixlo = master.pixl... | Coregistration implements ICoregistration { @Deprecated public static Window getOverlap(final Window master, final Window slave) { Window overlap = new Window(slave); if (master.linelo > overlap.linelo) overlap.linelo = master.linelo; if (master.linehi < overlap.linehi) overlap.linehi = master.linehi; if (master.pixlo ... | Coregistration implements ICoregistration { @Deprecated public static Window getOverlap(final Window master, final Window slave) { Window overlap = new Window(slave); if (master.linelo > overlap.linelo) overlap.linelo = master.linelo; if (master.linehi < overlap.linehi) overlap.linehi = master.linehi; if (master.pixlo ... | Coregistration implements ICoregistration { @Deprecated public static Window getOverlap(final Window master, final Window slave) { Window overlap = new Window(slave); if (master.linelo > overlap.linelo) overlap.linelo = master.linelo; if (master.linehi < overlap.linehi) overlap.linehi = master.linehi; if (master.pixlo ... | Coregistration implements ICoregistration { @Deprecated public static Window getOverlap(final Window master, final Window slave) { Window overlap = new Window(slave); if (master.linelo > overlap.linelo) overlap.linelo = master.linelo; if (master.linehi < overlap.linehi) overlap.linehi = master.linehi; if (master.pixlo ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.