()
| 487 | |
| 488 | |
| 489 | @Test |
| 490 | public void testPigServer() throws Throwable { |
| 491 | log.debug("creating pig server"); |
| 492 | PigContext pigContext = new PigContext(cluster.getExecType(), cluster.getProperties()); |
| 493 | PigServer pig = new PigServer(pigContext); |
| 494 | System.out.println("testing capacity"); |
| 495 | long capacity = pig.capacity(); |
| 496 | assertTrue(capacity > 0); |
| 497 | String sampleFileName = "/tmp/fileTest"; |
| 498 | if (!pig.existsFile(sampleFileName)) { |
| 499 | ElementDescriptor path = pigContext.getDfs().asElement(sampleFileName); |
| 500 | OutputStream os = path.create(); |
| 501 | os.write("Ben was here!".getBytes()); |
| 502 | os.close(); |
| 503 | } |
| 504 | long length = pig.fileSize(sampleFileName); |
| 505 | assertTrue(length > 0); |
| 506 | } |
| 507 | |
| 508 | /*** |
| 509 | * For generating a sample dataset as |
nothing calls this directly
no test coverage detected