test_class.declarator: logger = LoggerFactory.getLogger(XlsSerializerTest.class)
test_class.modifier: private final static
test_class.original_string: private final static Logger logger = LoggerFactory.getLogger(XlsSerializerTest.class);
test_class.type: Logger
test_class.var_name: logger
test_class.declarator: metadataBuilder
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private DataSetMetadataBuilder metadataBuilder;
test_class.type: DataSetMetadataBuilder
test_class.var_name: metadataBuilder
test_class.declarator: formatDetector
test_class.modifier: @Autowired
test_class.original_string: @Autowired
      CompositeFormatDetector formatDetector;
test_class.type: CompositeFormatDetector
test_class.var_name: formatDetector
test_class.declarator: xlsSchemaParser
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private XlsSchemaParser xlsSchemaParser;
test_class.type: XlsSchemaParser
test_class.var_name: xlsSchemaParser
test_class.declarator: xlsSerializer
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private XlsSerializer xlsSerializer;
test_class.type: XlsSerializer
test_class.var_name: xlsSerializer
test_class.declarator: mapper
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private ObjectMapper mapper;
test_class.type: ObjectMapper
test_class.var_name: mapper
test_class.declarator: rule = new LocalizationRule(Locale.US)
test_class.modifier: @Rule
      public
test_class.original_string: @Rule
      public LocalizationRule rule = new LocalizationRule(Locale.US);
test_class.type: LocalizationRule
test_class.var_name: rule
test_class.file: dataprep-backend-service/src/test/java/org/talend/dataprep/schema/xls/XlsSerializerTest.java
test_class.identifier: XlsSerializerTest
test_class.superclass: extends AbstractSchemaTestUtils
test_case.body: @Test
      public void testGeneralNumberFormat_TDP_222() throws Exception {
          final DataSetMetadata metadata = metadataBuilder
                  .metadata()
                  .id("1234")
                  .row(column().name("id").id(0).type(Type.INTEGER), column().name("value1").id(1).type(Type.INTEGER))
                  .build();
          Format format = assertFormat("excel_numbers.xls");
          // Test number serialization in XLS type guess
          InputStream input = this.getClass().getResourceAsStream("excel_numbers.xls");
          final String result =
                  IOUtils.toString(format.getFormatFamily().getSerializer().serialize(input, metadata, -1), UTF_8);
          final String expected =
                  "[{\"0000\":\"1\",\"0001\":\"123\"},{\"0000\":\"2\",\"0001\":\"123.1\"},{\"0000\":\"3\",\"0001\":\"209.9\"}]";
          assertThat(result, sameJSONAs(expected));
      }
test_case.class_method_signature: XlsSerializerTest.testGeneralNumberFormat_TDP_222()
test_case.full_signature: @Test public void testGeneralNumberFormat_TDP_222()
test_case.identifier: testGeneralNumberFormat_TDP_222
test_case.invocations: build row id metadata type id name column type id name column assertFormat getResourceAsStream getClass toString serialize getSerializer getFormatFamily assertThat sameJSONAs
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGeneralNumberFormat_TDP_222()
focal_class.declarator: mapper
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private ObjectMapper mapper;
focal_class.type: ObjectMapper
focal_class.var_name: mapper
focal_class.declarator: executor
focal_class.modifier: @Resource(name = "serializer#excel#executor")
      private
focal_class.original_string: @Resource(name = "serializer#excel#executor")
      private TaskExecutor executor;
focal_class.type: TaskExecutor
focal_class.var_name: executor
focal_class.file: dataprep-backend-service/src/main/java/org/talend/dataprep/schema/xls/XlsSerializer.java
focal_class.identifier: XlsSerializer
focal_class.interfaces: implements Serializer
focal_class.class_method_signature: XlsSerializer.isHeaderLine(int lineIndex, List<ColumnMetadata> columns)
focal_class.full_signature: public static boolean isHeaderLine(int lineIndex, List<ColumnMetadata> columns)
focal_class.identifier: isHeaderLine
focal_class.modifiers: public static
focal_class.parameters: (int lineIndex, List<ColumnMetadata> columns)
focal_class.return: boolean
focal_class.signature: boolean isHeaderLine(int lineIndex, List<ColumnMetadata> columns)
focal_class.class_method_signature: XlsSerializer.serialize(InputStream givenInputStream, DataSetMetadata metadata, long limit)
focal_class.full_signature: @Override public InputStream serialize(InputStream givenInputStream, DataSetMetadata metadata, long limit)
focal_class.identifier: serialize
focal_class.modifiers: @Override public
focal_class.parameters: (InputStream givenInputStream, DataSetMetadata metadata, long limit)
focal_class.return: InputStream
focal_class.signature: InputStream serialize(InputStream givenInputStream, DataSetMetadata metadata, long limit)
focal_class.class_method_signature: XlsSerializer.serializeNew(InputStream rawContent, DataSetMetadata metadata, long limit,
              PipedOutputStream jsonOutput)
focal_class.full_signature: private Runnable serializeNew(InputStream rawContent, DataSetMetadata metadata, long limit,
              PipedOutputStream jsonOutput)
focal_class.identifier: serializeNew
focal_class.modifiers: private
focal_class.parameters: (InputStream rawContent, DataSetMetadata metadata, long limit,
              PipedOutputStream jsonOutput)
focal_class.return: Runnable
focal_class.signature: Runnable serializeNew(InputStream rawContent, DataSetMetadata metadata, long limit,
              PipedOutputStream jsonOutput)
focal_class.class_method_signature: XlsSerializer.serializeOld(InputStream rawContent, DataSetMetadata metadata, long limit,
              PipedOutputStream jsonOutput)
focal_class.full_signature: private Runnable serializeOld(InputStream rawContent, DataSetMetadata metadata, long limit,
              PipedOutputStream jsonOutput)
focal_class.identifier: serializeOld
focal_class.modifiers: private
focal_class.parameters: (InputStream rawContent, DataSetMetadata metadata, long limit,
              PipedOutputStream jsonOutput)
focal_class.return: Runnable
focal_class.signature: Runnable serializeOld(InputStream rawContent, DataSetMetadata metadata, long limit,
              PipedOutputStream jsonOutput)
focal_method.body: @Override
      public InputStream serialize(InputStream givenInputStream, DataSetMetadata metadata, long limit) {
          try {
  
              PipedInputStream pipe = new PipedInputStream();
              PipedOutputStream jsonOutput = new PipedOutputStream(pipe);
  
              // override the parameter in case it needs to be wrapped in a buffered inputstream
              InputStream inputStream = givenInputStream;
              if (!inputStream.markSupported()) {
                  inputStream = new BufferedInputStream(inputStream);
              }
  
              inputStream.mark(Integer.MAX_VALUE);
  
              boolean newExcelFormat = XlsUtils.isNewExcelFormat(inputStream);
  
              inputStream.reset();
  
              Runnable runnable = newExcelFormat ? //
                      serializeNew(inputStream, metadata, limit, jsonOutput)
                      : serializeOld(inputStream, metadata, limit, jsonOutput);
  
              // Serialize asynchronously for better performance (especially if caller doesn't consume all, see sampling).
              executor.execute(runnable);
  
              return pipe;
          } catch (IOException e) {
              throw new TDPException(CommonErrorCodes.UNABLE_TO_SERIALIZE_TO_JSON, e);
          }
      }
focal_method.class_method_signature: XlsSerializer.serialize(InputStream givenInputStream, DataSetMetadata metadata, long limit)
focal_method.full_signature: @Override public InputStream serialize(InputStream givenInputStream, DataSetMetadata metadata, long limit)
focal_method.identifier: serialize
focal_method.invocations: markSupported mark isNewExcelFormat reset serializeNew serializeOld execute
focal_method.modifiers: @Override public
focal_method.parameters: (InputStream givenInputStream, DataSetMetadata metadata, long limit)
focal_method.return: InputStream
focal_method.signature: InputStream serialize(InputStream givenInputStream, DataSetMetadata metadata, long limit)