@Test public void testMap_SimpleCase() throws RecordException, IOException, InterruptedException { LineMapper lineMapper = new JythonLineMapper(pythonCode, "singleFieldRecord"); QName stringFieldName = QName.fromString("{org.lilyproject}Name"); QName intFieldName = QName.fromString("{org.lilyproject}IntField"); QName recordTypeName = QName.fromString("{org.lilyproject}NameRecord"); when(mappingContext.qn("{org.lilyproject}Name")).thenReturn(stringFieldName); when(mappingContext.qn("{org.lilyproject}IntField")).thenReturn(intFieldName); when(mappingContext.qn("{org.lilyproject}NameRecord")).thenReturn(recordTypeName); lineMapper.mapLine("nameValue", mappingContext); verify(record).setField(stringFieldName, "nameValue"); verify(record).setField(intFieldName, 42); verify(record).setRecordType(recordTypeName); verify(mappingContext).writeRecord(record); }
@Override public void mapLine(String inputLine, LineMappingContext context) { mapperCallable.__call__(new PyString(inputLine), Py.java2py(context)); }
JythonLineMapper implements LineMapper { @Override public void mapLine(String inputLine, LineMappingContext context) { mapperCallable.__call__(new PyString(inputLine), Py.java2py(context)); } }
JythonLineMapper implements LineMapper { @Override public void mapLine(String inputLine, LineMappingContext context) { mapperCallable.__call__(new PyString(inputLine), Py.java2py(context)); } JythonLineMapper(String pythonCode, String recordMapperSymbol);  JythonLineMapper(String pythonCode, String recordMapperSymbol, Writer stderrWriter); }
JythonLineMapper implements LineMapper { @Override public void mapLine(String inputLine, LineMappingContext context) { mapperCallable.__call__(new PyString(inputLine), Py.java2py(context)); } JythonLineMapper(String pythonCode, String recordMapperSymbol);  JythonLineMapper(String pythonCode, String recordMapperSymbol, Writer stderrWriter); @Override void mapLine(String inputLine, LineMappingContext context); }
JythonLineMapper implements LineMapper { @Override public void mapLine(String inputLine, LineMappingContext context) { mapperCallable.__call__(new PyString(inputLine), Py.java2py(context)); } JythonLineMapper(String pythonCode, String recordMapperSymbol);  JythonLineMapper(String pythonCode, String recordMapperSymbol, Writer stderrWriter); @Override void mapLine(String inputLine, LineMappingContext context);  }