Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
org.dartlang.vm.service.SampleOutPrinter Class Reference

Public Member Functions

 SampleOutPrinter (String prefix, InputStream stream)
 
void assertEmpty ()
 
void assertLastLine (String text)
 

Detailed Description

Echo the content of a stream to System.out with the given prefix.

Definition at line 26 of file SampleOutPrinter.java.

Constructor & Destructor Documentation

◆ SampleOutPrinter()

org.dartlang.vm.service.SampleOutPrinter.SampleOutPrinter ( String  prefix,
InputStream  stream 
)
inline

Definition at line 64 of file SampleOutPrinter.java.

64 {
65 this.prefix = prefix;
66 this.reader = new BufferedReader(new InputStreamReader(stream, Charsets.UTF_8));
67 new LinesReaderThread().start();
68 }

Member Function Documentation

◆ assertEmpty()

void org.dartlang.vm.service.SampleOutPrinter.assertEmpty ( )
inline

Definition at line 70 of file SampleOutPrinter.java.

70 {
71 synchronized (currentLineLock) {
72 if (currentLine != null) {
73 throw new RuntimeException("Did not expect " + prefix + ": \"" + currentLine + "\"");
74 }
75 }
76 }

◆ assertLastLine()

void org.dartlang.vm.service.SampleOutPrinter.assertLastLine ( String  text)
inline

Definition at line 78 of file SampleOutPrinter.java.

78 {
79 synchronized (currentLineLock) {
80 if (text == null) {
81 if (currentLine != null) {
82 throw new RuntimeException("Did not expect " + prefix + ": \"" + currentLine + "\"");
83 }
84 } else {
85 if (currentLine == null || !currentLine.contains(text)) {
86 throw new RuntimeException("Expected current line to contain text\n"
87 + "\nexpected: [" + text + "]"
88 + "\nactual: [" + currentLine + "]");
89 }
90 }
91 }
92 }
std::u16string text

The documentation for this class was generated from the following file: