diff options
Diffstat (limited to 'src/test/java/TestHos.java')
| -rw-r--r-- | src/test/java/TestHos.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/test/java/TestHos.java b/src/test/java/TestHos.java new file mode 100644 index 0000000..4bafa46 --- /dev/null +++ b/src/test/java/TestHos.java @@ -0,0 +1,30 @@ +import java.io.*; + +import static cn.ac.iie.storm.utils.config.GetMap.getDy; +import static cn.ac.iie.storm.utils.config.GetMap.getSzd; +import static cn.ac.iie.storm.utils.http.HttpAsncClient.getConnAnsyHttpPost; + +public class TestHos { + public static void main(String[] args) throws IOException { + InputStream input = new FileInputStream(new File("src/resources/test")); + + byte[] buffer = null; + + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + + byte[] b = new byte[1024]; + + int n; + + while ((n = input.read(b)) != -1) + { + bos.write(b, 0, n); + } + + input.close(); + + bos.close(); + buffer = bos.toByteArray(); + getConnAnsyHttpPost("http://10.111.151.217:8888/yd-test/testfile?method=put",buffer); + } +} |
