@Test public void parseCxxRecordDefinition() throws Exception { ByteArrayInputStream is = new ByteArrayInputStream( "|-CXXRecordDecl 0x2b24038 <line:12:1, line:36:1> line:12:7 class Alice definition " .getBytes()); ClassDescriptor mockClassDescriptor = mock(ClassDescriptor.class); when(store.create(ClassDescriptor.class)).thenReturn(mockClassDescriptor); cppAstParser.readStream(store, is); verify(store).create(ClassDescriptor.class); verify(mockClassDescriptor).setName("Alice"); }
public void readStream(final Store store, final InputStream stream) { BufferedReader reader = new BufferedReader(new InputStreamReader(stream)); try { while(reader.ready()) { parseLine(store, reader.readLine()); } } catch (IOException e) { LOGGER.warn("Exception while reading AST file, could not read all lines; reason: "+e); } }
CppAstParser { public void readStream(final Store store, final InputStream stream) { BufferedReader reader = new BufferedReader(new InputStreamReader(stream)); try { while(reader.ready()) { parseLine(store, reader.readLine()); } } catch (IOException e) { LOGGER.warn("Exception while reading AST file, could not read all lines; reason: "+e); } } }
CppAstParser { public void readStream(final Store store, final InputStream stream) { BufferedReader reader = new BufferedReader(new InputStreamReader(stream)); try { while(reader.ready()) { parseLine(store, reader.readLine()); } } catch (IOException e) { LOGGER.warn("Exception while reading AST file, could not read all lines; reason: "+e); } }  }
CppAstParser { public void readStream(final Store store, final InputStream stream) { BufferedReader reader = new BufferedReader(new InputStreamReader(stream)); try { while(reader.ready()) { parseLine(store, reader.readLine()); } } catch (IOException e) { LOGGER.warn("Exception while reading AST file, could not read all lines; reason: "+e); } }  void readStream(final Store store, final InputStream stream); }
CppAstParser { public void readStream(final Store store, final InputStream stream) { BufferedReader reader = new BufferedReader(new InputStreamReader(stream)); try { while(reader.ready()) { parseLine(store, reader.readLine()); } } catch (IOException e) { LOGGER.warn("Exception while reading AST file, could not read all lines; reason: "+e); } }  void readStream(final Store store, final InputStream stream);  }