Exemplo n.º 1
0
        public virtual void TestResourceCleanup()
        {
            CloseCheckInputStream affixStream = new CloseCheckInputStream(this, this.GetType().getResourceAsStream("compressed.aff"));
            CloseCheckInputStream dictStream  = new CloseCheckInputStream(this, this.GetType().getResourceAsStream("compressed.dic"));

            new Dictionary(affixStream, dictStream);

            assertFalse(affixStream.Disposed);
            assertFalse(dictStream.Disposed);

            affixStream.Dispose();
            dictStream.Dispose();

            assertTrue(affixStream.Disposed);
            assertTrue(dictStream.Disposed);
        }
Exemplo n.º 2
0
        //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        //ORIGINAL LINE: public void testResourceCleanup() throws Exception
        public virtual void testResourceCleanup()
        {
            CloseCheckInputStream affixStream = new CloseCheckInputStream(this, this.GetType().getResourceAsStream("compressed.aff"));
            CloseCheckInputStream dictStream = new CloseCheckInputStream(this, this.GetType().getResourceAsStream("compressed.dic"));

            new Dictionary(affixStream, dictStream);

            assertFalse(affixStream.Closed);
            assertFalse(dictStream.Closed);

            affixStream.close();
            dictStream.close();

            assertTrue(affixStream.Closed);
            assertTrue(dictStream.Closed);
        }