Example #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void testSimpleIntBlocks() throws Exception
        public virtual void testSimpleIntBlocks()
        {
            Directory dir = newDirectory();

            IntStreamFactory f = (new MockFixedIntBlockPostingsFormat(128)).IntFactory;

            IntIndexOutput @out = f.createOutput(dir, "test", newIOContext(random()));

            for (int i = 0; i < 11777; i++)
            {
                @out.write(i);
            }
            @out.close();

            IntIndexInput @in = f.openInput(dir, "test", newIOContext(random()));

            IntIndexInput.Reader r = @in.reader();

            for (int i = 0; i < 11777; i++)
            {
                assertEquals(i, r.next());
            }
            @in.close();

            dir.close();
        }
Example #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void testEmptySimpleIntBlocks() throws Exception
        public virtual void testEmptySimpleIntBlocks()
        {
            Directory dir = newDirectory();

            IntStreamFactory f    = (new MockFixedIntBlockPostingsFormat(128)).IntFactory;
            IntIndexOutput   @out = f.createOutput(dir, "test", newIOContext(random()));

            // write no ints
            @out.close();

            IntIndexInput @in = f.openInput(dir, "test", newIOContext(random()));

            @in.reader();
            // read no ints
            @in.close();
            dir.close();
        }