Skip to content

Assert that stream is auto-closed in AboutTryWithResources #43

@DavidWhitlock

Description

@DavidWhitlock

Based on the discussion in #42, I suggest that we add an assertion that verifies that the close method of the InputStream is invoked in the "try with resources" try block in the AboutTryWithResources. lookMaNoClose() koan.

Unfortunately, there is no isClosed method on InputStream. @matyb suggests that the koan have a helper method that attempts to read from the closed InputStream to verify that it is closed.

See also http://stackoverflow.com/questions/8655901/how-to-check-whether-an-outputstream-is-closed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions