@Test public void testSetFields() throws Exception { StringPassResolver resolver = buildResolver(); byte[] data = new byte[] { (int) 'a', (int) 'b', (int) 'c', (int) 'd', (int) '\n', (int) 'n', (int) 'o', (int) '\n' }; List<OneField> record = Collections.singletonList(new OneField(DataType.BYTEA.getOID(), Arrays.copyOfRange(data, 0, 5))); OneRow oneRow = resolver.setFields(record); verifyOneRow(oneRow, Arrays.copyOfRange(data, 0, 5)); record = Collections.singletonList(new OneField(DataType.BYTEA.getOID(), Arrays.copyOfRange(data, 5, 8))); oneRow = resolver.setFields(record); verifyOneRow(oneRow, Arrays.copyOfRange(data, 5, 8)); }
@Override public OneRow setFields(List<OneField> record) { OneField oneField = record.get(0); if ((oneField.val instanceof InputStream && resolveWriteCount > 0) || (oneField.val instanceof byte[] && ((byte[]) oneField.val).length == 0)) { return null; } oneRow.setData(oneField.val); resolveWriteCount++; return oneRow; }
StringPassResolver extends BasePlugin implements Resolver { @Override public OneRow setFields(List<OneField> record) { OneField oneField = record.get(0); if ((oneField.val instanceof InputStream && resolveWriteCount > 0) || (oneField.val instanceof byte[] && ((byte[]) oneField.val).length == 0)) { return null; } oneRow.setData(oneField.val); resolveWriteCount++; return oneRow; } }
StringPassResolver extends BasePlugin implements Resolver { @Override public OneRow setFields(List<OneField> record) { OneField oneField = record.get(0); if ((oneField.val instanceof InputStream && resolveWriteCount > 0) || (oneField.val instanceof byte[] && ((byte[]) oneField.val).length == 0)) { return null; } oneRow.setData(oneField.val); resolveWriteCount++; return oneRow; }  }
StringPassResolver extends BasePlugin implements Resolver { @Override public OneRow setFields(List<OneField> record) { OneField oneField = record.get(0); if ((oneField.val instanceof InputStream && resolveWriteCount > 0) || (oneField.val instanceof byte[] && ((byte[]) oneField.val).length == 0)) { return null; } oneRow.setData(oneField.val); resolveWriteCount++; return oneRow; }  @Override List<OneField> getFields(OneRow onerow); @Override OneRow setFields(List<OneField> record); }
StringPassResolver extends BasePlugin implements Resolver { @Override public OneRow setFields(List<OneField> record) { OneField oneField = record.get(0); if ((oneField.val instanceof InputStream && resolveWriteCount > 0) || (oneField.val instanceof byte[] && ((byte[]) oneField.val).length == 0)) { return null; } oneRow.setData(oneField.val); resolveWriteCount++; return oneRow; }  @Override List<OneField> getFields(OneRow onerow); @Override OneRow setFields(List<OneField> record);  }