Examples of valid()


Examples of java.io.FileDescriptor.valid()

    assertTrue(fd.valid());
    FileOutputStream fos = new FileOutputStream(fd);
    fos.write("foo".getBytes());
    fos.close();

    assertFalse(fd.valid());

    LOG.info("Test exclusive create");
    try {
      fd = NativeIO.open(
        new File(TEST_DIR, "testWorkingOpen").getAbsolutePath(),
View Full Code Here

Examples of java.io.FileDescriptor.valid()

    for (int i = 0; i < 10000; i++) {
      FileDescriptor fd = NativeIO.open(
        new File(TEST_DIR, "testNoFdLeak").getAbsolutePath(),
        NativeIO.O_WRONLY | NativeIO.O_CREAT, 0700);
      assertNotNull(true);
      assertTrue(fd.valid());
      FileOutputStream fos = new FileOutputStream(fd);
      fos.write("foo".getBytes());
      fos.close();
    }
  }
View Full Code Here

Examples of java.io.FileDescriptor.valid()

    LOG.info("Test creating a file with O_CREAT");
    FileDescriptor fd = NativeIO.POSIX.open(
      new File(TEST_DIR, "testWorkingOpen").getAbsolutePath(),
      NativeIO.POSIX.O_WRONLY | NativeIO.POSIX.O_CREAT, 0700);
    assertNotNull(true);
    assertTrue(fd.valid());
    FileOutputStream fos = new FileOutputStream(fd);
    fos.write("foo".getBytes());
    fos.close();

    assertFalse(fd.valid());
View Full Code Here

Examples of java.io.FileDescriptor.valid()

    assertTrue(fd.valid());
    FileOutputStream fos = new FileOutputStream(fd);
    fos.write("foo".getBytes());
    fos.close();

    assertFalse(fd.valid());

    LOG.info("Test exclusive create");
    try {
      fd = NativeIO.POSIX.open(
        new File(TEST_DIR, "testWorkingOpen").getAbsolutePath(),
View Full Code Here

Examples of java.io.FileDescriptor.valid()

    for (int i = 0; i < 10000; i++) {
      FileDescriptor fd = NativeIO.POSIX.open(
        new File(TEST_DIR, "testNoFdLeak").getAbsolutePath(),
        NativeIO.POSIX.O_WRONLY | NativeIO.POSIX.O_CREAT, 0700);
      assertNotNull(true);
      assertTrue(fd.valid());
      FileOutputStream fos = new FileOutputStream(fd);
      fos.write("foo".getBytes());
      fos.close();
    }
  }
View Full Code Here

Examples of java.io.FileDescriptor.valid()

                f = new File(System.getProperty("user.dir"), "fd.tst");
                f.delete();
                os = new BufferedOutputStream(fos = new FileOutputStream(f
                                .getPath()), 4096);
                FileDescriptor fd = fos.getFD();
                assertTrue("Valid fd returned false", fd.valid());
                os.close();
                assertTrue("Invalid fd returned true", !fd.valid());
  }

  /**
 
View Full Code Here

Examples of java.io.FileDescriptor.valid()

                os = new BufferedOutputStream(fos = new FileOutputStream(f
                                .getPath()), 4096);
                FileDescriptor fd = fos.getFD();
                assertTrue("Valid fd returned false", fd.valid());
                os.close();
                assertTrue("Invalid fd returned true", !fd.valid());
  }

  /**
   * Sets up the fixture, for example, open a network connection. This method
   * is called before a test is executed.
View Full Code Here

Examples of java.io.FileDescriptor.valid()

    LOG.info("Test creating a file with O_CREAT");
    FileDescriptor fd = NativeIO.POSIX.open(
      new File(TEST_DIR, "testWorkingOpen").getAbsolutePath(),
      NativeIO.POSIX.O_WRONLY | NativeIO.POSIX.O_CREAT, 0700);
    assertNotNull(true);
    assertTrue(fd.valid());
    FileOutputStream fos = new FileOutputStream(fd);
    fos.write("foo".getBytes());
    fos.close();

    assertFalse(fd.valid());
View Full Code Here

Examples of java.io.FileDescriptor.valid()

    assertTrue(fd.valid());
    FileOutputStream fos = new FileOutputStream(fd);
    fos.write("foo".getBytes());
    fos.close();

    assertFalse(fd.valid());

    LOG.info("Test exclusive create");
    try {
      fd = NativeIO.POSIX.open(
        new File(TEST_DIR, "testWorkingOpen").getAbsolutePath(),
View Full Code Here

Examples of java.io.FileDescriptor.valid()

    for (int i = 0; i < 10000; i++) {
      FileDescriptor fd = NativeIO.POSIX.open(
        new File(TEST_DIR, "testNoFdLeak").getAbsolutePath(),
        NativeIO.POSIX.O_WRONLY | NativeIO.POSIX.O_CREAT, 0700);
      assertNotNull(true);
      assertTrue(fd.valid());
      FileOutputStream fos = new FileOutputStream(fd);
      fos.write("foo".getBytes());
      fos.close();
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.