Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix IllegalAccessException #346

Merged
merged 6 commits into from
Aug 31, 2024
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions src/test/java/com/ql/util/express/test/ForFlowFunctionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,37 @@

import com.ql.util.express.DefaultContext;
import com.ql.util.express.ExpressRunner;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

import java.io.ByteArrayOutputStream;
import java.io.OutputStream;
import java.io.PrintStream;

public class ForFlowFunctionTest {
class MyPrintStream01 extends PrintStream {
public MyPrintStream01(OutputStream out) {
super(out);
}

@Override
public void println(String x) {
super.println(x);
}
}
private final ByteArrayOutputStream outContent = new ByteArrayOutputStream();
private final PrintStream originalOut = System.out;
@Before
public void setUpStreams() {
System.setOut(new MyPrintStream01(outContent));
jackie-coming marked this conversation as resolved.
Show resolved Hide resolved
}

@After
public void restoreStreams() {
System.setOut(originalOut);
}

@Test
public void testABC() throws Exception {
Expand Down