Package org.apache.xindice.core.data

Examples of org.apache.xindice.core.data.Record


         throws Exception {
      assertTrue(filer.writeRecord(TEST_KEY, TEST_VALUE));
      assertEquals(1, filer.getRecordCount());

      // Non-existant key
      Record result = filer.readRecord(new Key("non-existant-key"));
      assertNull(result);
   }
View Full Code Here


      assertEquals(1, filer.getRecordCount());

      // Valid key
      filer.deleteRecord(TEST_KEY);
      assertEquals(0, filer.getRecordCount());
      Record result = filer.readRecord(TEST_KEY);
      assertNull(result);
   }
View Full Code Here

      Document doc = null;
      if ( documentCache != null )
         doc = documentCache.getDocument(this, key);

      if ( doc == null ) {
         Record record = filer.readRecord(key);
         if ( record == null )
            return null;

         Value value = record.getValue();

         if ( compressed ) {
            doc = new DocumentImpl(value.getData(), symbols, new NodeSource(this, key));

            if ( documentCache != null )
View Full Code Here

         return set.hasMoreRecords();
      }

      public Container getNextContainer() throws DBException {
         if (set.hasMoreRecords()) {
            Record rec = set.getNextRecord();
            Key key = rec.getKey();
            Value val = rec.getValue();
            if ( val.getData() != null ) {
               try {
                  if ( compressed ) {
                     Document doc = new DocumentImpl(val.getData(), symbols, new NodeSource(Collection.this, key));
                     return new ColContainer(key, doc);
View Full Code Here

    public void testSuccessWriteRecord() throws Exception {
        assertTrue(filer.writeRecord(TEST_KEY, TEST_VALUE));
        assertEquals(1, filer.getRecordCount());

        Record result = filer.readRecord(TEST_KEY);
        assertEquals(TEST_VALUE, result.getValue());

        RecordSet set = filer.getRecordSet();
        assertEquals(result.getValue(), set.getNextRecord().getValue());
        assertTrue(set.hasMoreRecords() == false);

        filer.deleteRecord(TEST_KEY);
        assertEquals(0, filer.getRecordCount());
    }
View Full Code Here

        filer.deleteRecord(TEST_KEY);
        assertEquals(0, filer.getRecordCount());
    }

    public void testFailReadDeletedRecord() throws Exception {
        Record result = filer.readRecord(TEST_KEY);
        assertNull(result);
    }
View Full Code Here

    public void testReadRecord() throws Exception {
        assertTrue(filer.writeRecord(TEST_KEY, TEST_VALUE));
        assertEquals(1, filer.getRecordCount());

        // Valid key
        Record result = filer.readRecord(TEST_KEY);
        assertEquals(TEST_VALUE, result.getValue());
    }
View Full Code Here

    public void testFailReadRecordNullKey() throws Exception {
        assertTrue(filer.writeRecord(TEST_KEY, TEST_VALUE));
        assertEquals(1, filer.getRecordCount());

        // Null key
        Record result = filer.readRecord(null);
        assertNull(result);
    }
View Full Code Here

    public void testFailReadRecordEmptyKey() throws Exception {
        assertTrue(filer.writeRecord(TEST_KEY, TEST_VALUE));
        assertEquals(1, filer.getRecordCount());

        // Empty key
        Record result = filer.readRecord(new Key(""));
        assertNull(result);
    }
View Full Code Here

    public void testFailReadRecordUnknownKey() throws Exception {
        assertTrue(filer.writeRecord(TEST_KEY, TEST_VALUE));
        assertEquals(1, filer.getRecordCount());

        // Non-existant key
        Record result = filer.readRecord(new Key("non-existant-key"));
        assertNull(result);
    }
View Full Code Here

TOP

Related Classes of org.apache.xindice.core.data.Record

Copyright © 2018 www.massapicom. 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.