| 1 | |
| 2 | package be.nikiroo.gofetch.test; |
| 3 | |
| 4 | import java.io.IOException; |
| 5 | import java.io.InputStream; |
| 6 | import java.net.URL; |
| 7 | |
| 8 | import be.nikiroo.gofetch.support.Reddit; |
| 9 | import be.nikiroo.gofetch.support.Type; |
| 10 | |
| 11 | public class TestReddit extends TestBase { |
| 12 | static private Type type = Type.REDDIT; |
| 13 | static private TestBase base = null; |
| 14 | |
| 15 | public TestReddit(String[] args) { |
| 16 | super(new Reddit() { |
| 17 | @Override |
| 18 | protected InputStream open(URL url) throws IOException { |
| 19 | return base.download(url); |
| 20 | } |
| 21 | |
| 22 | @Override |
| 23 | public Type getType() { |
| 24 | return type; |
| 25 | } |
| 26 | }, args); |
| 27 | |
| 28 | base = this; |
| 29 | } |
| 30 | } |