Examples of RecordImpl


Examples of no.priv.garshol.duke.RecordImpl

    props.put("ID", Collections.singleton("abc"));
    Collection<String> list = new ArrayList();
    list.add("b");
    list.add("c");
    props.put("NAME", list);
    Record r = new RecordImpl(props);
    db.index(r);
    db.commit();

    // Then, retrieve it and verify that it's correct
    r = db.findRecordById("abc");
    assertEquals("abc", r.getValue("ID"));
    list = r.getValues("NAME");
    assertEquals(2, list.size());
    assertTrue(list.contains("b"));
    assertTrue(list.contains("c"));
  }
View Full Code Here

Examples of no.priv.garshol.duke.RecordImpl

    int max_hits = 10000;
    if (parser.getOptionValue("maxhits") != null)
      max_hits = Integer.parseInt(parser.getOptionValue("maxhits"));

    // build record
    RecordImpl prototype = new RecordImpl();
    prototype.addValue(argv[1], argv[2]);

    // search
    Collection<Record> records = database.findCandidateMatches(prototype);
    int hitno = 1;
    for (Record record : records) {
View Full Code Here

Examples of no.priv.garshol.duke.RecordImpl

import no.priv.garshol.duke.matchers.AbstractMatchListener;

public class TestUtils {

  public static Record makeRecord() {
    return new RecordImpl(new HashMap());   
  }
View Full Code Here

Examples of no.priv.garshol.duke.RecordImpl

      }
    }

    // this finds the next record in the data stream
    private Record parseRecord() {
      RecordImpl record = new RecordImpl();
      String current = subject;

      // we've stored the first statement about the next resource, so we
      // need to process that before we move on to read anything
     
View Full Code Here

Examples of no.priv.garshol.duke.RecordImpl

     
      if (types.isEmpty())
        return;
     
      for (String uri : new ArrayList<String>(records.keySet())) {
        RecordImpl r = records.get(uri);
        if (!filterbytype(r))
          records.remove(uri);
        else
          r.remove(RDF_TYPE);
      }
    }
View Full Code Here

Examples of no.priv.garshol.duke.RecordImpl

    }

    // FIXME: refactor this so that we share code with addStatement()
    public void statement(String subject, String property, String object,
                          boolean literal) {
      RecordImpl record = records.get(subject);
      if (record == null) {
        record = new RecordImpl();
        records.put(subject, record);
      }
      addStatement(record, subject, property, object);
    }
View Full Code Here

Examples of no.priv.garshol.duke.RecordImpl

    } catch (InterruptedException e) {
    }
  }

  private Record makeRecord() {
    return new RecordImpl(new HashMap());
  }
View Full Code Here

Examples of no.priv.garshol.duke.RecordImpl

  }

  private Record makeRecord(String prop, String val) {
    Map<String, Collection<String>> data = new HashMap();
    data.put(prop, Collections.singleton(val));
    return new RecordImpl(data);
  }
View Full Code Here

Examples of org.lilyproject.repository.impl.RecordImpl

    @Test
    public void testEmptyRecord() throws Exception {
        converter = new AvroConverter();
        FieldTypes fieldTypesSnapshot = control.createMock(FieldTypes.class);
        recordFactory.newRecord();
        expectLastCall().andReturn(new RecordImpl()).anyTimes();
        typeManager.getFieldTypesSnapshot();
        expectLastCall().andReturn(fieldTypesSnapshot).anyTimes();
        control.replay();
        Record record = new RecordImpl();
        record.setRecordType(new QName("ns", "recordTypeName"), null);

        assertEquals(record, converter.convertRecord(converter.convert(record, repository), repository));
        assertEquals(converter.convert(record, repository),
                converter.convert(converter.convertRecord(converter.convert(record, repository), repository), repository));
        control.verify();
View Full Code Here

Examples of org.lilyproject.repository.impl.RecordImpl

        FieldTypes fieldTypesSnapshot = control.createMock(FieldTypes.class);
        ValueType valueType = new StringValueType();
        IdGenerator idGenerator = new IdGeneratorImpl();

        recordFactory.newRecord();
        expectLastCall().andReturn(new RecordImpl()).anyTimes();
        repository.getIdGenerator();
        expectLastCall().andReturn(idGenerator).anyTimes();
        typeManager.getFieldTypesSnapshot();
        expectLastCall().andReturn(fieldTypesSnapshot).anyTimes();
        fieldTypesSnapshot.getFieldType(isA(QName.class));
        expectLastCall().andReturn(fieldType).anyTimes();
        fieldType.getValueType();
        expectLastCall().andReturn(valueType).anyTimes();
        typeManager.getValueType("STRING");
        expectLastCall().andReturn(valueType).anyTimes();
        control.replay();

        Record record = new RecordImpl();
        RecordId recordId = repository.getIdGenerator().newRecordId();
        record.setId(recordId);
        // Scope.NON_VERSIONED recordType and master record type are the same
        record.setRecordType(Scope.NON_VERSIONED, new QName("ns", "nvrt"), 1L);
        record.setRecordType(Scope.VERSIONED, new QName("ns", "vrt"), 2L);
        record.setRecordType(Scope.VERSIONED_MUTABLE, new QName("ns", "vmrt"), 3L);
        QName fieldName = new QName("ns", "aName");
        record.setField(fieldName, "aValue");
        QName fieldName2 = new QName("ns", "aName2");
        record.setField(fieldName2, "aValue2");
        record.addFieldsToDelete(Arrays.asList(new QName("devnull", "fieldToDelete")));

        assertEquals(record, converter.convertRecord(converter.convert(record, repository), repository));
        control.verify();
    }
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.