ErrorProto toPb() { ErrorProto errorPb = new ErrorProto(); if (reason != null) { errorPb.setReason(reason); } if (location != null) { errorPb.setLocation(location); } if (message != null) { errorPb.setMessage(message); } if (debugInfo != null) { errorPb.setDebugInfo(debugInfo); } return errorPb; }
new TableDataInsertAllResponse.InsertErrors() .setIndex(0L) .setErrors(ImmutableList.of(new ErrorProto().setMessage("ErrorMessage"))))); EasyMock.expect(bigqueryRpcMock.insertAll(OTHER_PROJECT, DATASET, TABLE, requestPb)) .andReturn(responsePb);
new TableDataInsertAllResponse.InsertErrors() .setIndex(0L) .setErrors(ImmutableList.of(new ErrorProto().setMessage("ErrorMessage"))))); EasyMock.expect( bigqueryRpcMock.insertAll("project-different-from-option", DATASET, TABLE, requestPb))
new TableDataInsertAllResponse.InsertErrors() .setIndex(0L) .setErrors(ImmutableList.of(new ErrorProto().setMessage("ErrorMessage"))))); EasyMock.expect(bigqueryRpcMock.insertAll(PROJECT, DATASET, TABLE, requestPb)) .andThrow(new BigQueryException(500, "InternalError"));
ErrorProto toPb() { ErrorProto errorPb = new ErrorProto(); if (reason != null) { errorPb.setReason(reason); } if (location != null) { errorPb.setLocation(location); } if (message != null) { errorPb.setMessage(message); } if (debugInfo != null) { errorPb.setDebugInfo(debugInfo); } return errorPb; }
ErrorProto toPb() { ErrorProto errorPb = new ErrorProto(); if (reason != null) { errorPb.setReason(reason); } if (location != null) { errorPb.setLocation(location); } if (message != null) { errorPb.setMessage(message); } if (debugInfo != null) { errorPb.setDebugInfo(debugInfo); } return errorPb; }
ErrorProto toPb() { ErrorProto errorPb = new ErrorProto(); if (reason != null) { errorPb.setReason(reason); } if (location != null) { errorPb.setLocation(location); } if (message != null) { errorPb.setMessage(message); } if (debugInfo != null) { errorPb.setDebugInfo(debugInfo); } return errorPb; }
.setErrorResult( new ErrorProto() .setMessage( String.format( "Job %s failed: %s", job.job.getConfiguration(), e.toString())));
@Test public void testDecodeEncodeEqual() throws Exception { BigQueryInsertError value = new BigQueryInsertError( new TableRow().setF(Collections.singletonList(new TableCell().setV("Value"))), new TableDataInsertAllResponse.InsertErrors() .setIndex(0L) .setErrors( Collections.singletonList( new ErrorProto() .setReason("a Reason") .setLocation("A location") .setMessage("A message") .setDebugInfo("The debug info"))), new TableReference() .setProjectId("dummy-project-id") .setDatasetId("dummy-dataset-id") .setTableId("dummy-table-id")); CoderProperties.coderDecodeEncodeEqual(TEST_CODER, value); } }