Search in sources :

Example 1 with RecordingModelListener

use of org.apache.jena.rdf.model.test.helpers.RecordingModelListener in project jena by apache.

the class TestModelEvents method setUp.

@Override
public void setUp() {
    super.setUp();
    SL = new RecordingModelListener();
}
Also used : RecordingModelListener(org.apache.jena.rdf.model.test.helpers.RecordingModelListener)

Example 2 with RecordingModelListener

use of org.apache.jena.rdf.model.test.helpers.RecordingModelListener in project jena by apache.

the class TestReaderEvents method testReaderEvent.

public void testReaderEvent(final String language, final String emptyModel) {
    final RecordingModelListener L = new RecordingModelListener();
    model.register(L);
    final RDFReader r = model.getReader(language);
    final StringReader stringReader = new StringReader(emptyModel);
    r.read(model, stringReader, "");
    L.assertHasStart(new Object[] { "someEvent", model, GraphEvents.startRead });
    L.assertHasEnd(new Object[] { "someEvent", model, GraphEvents.finishRead });
}
Also used : StringReader(java.io.StringReader) RDFReader(org.apache.jena.rdf.model.RDFReader) RecordingModelListener(org.apache.jena.rdf.model.test.helpers.RecordingModelListener)

Example 3 with RecordingModelListener

use of org.apache.jena.rdf.model.test.helpers.RecordingModelListener in project jena by apache.

the class TestModelEvents method testTwoListeners.

public void testTwoListeners() {
    final Statement S = ModelHelper.statement(model, "S P O");
    final RecordingModelListener SL1 = new RecordingModelListener();
    final RecordingModelListener SL2 = new RecordingModelListener();
    model.register(SL1).register(SL2);
    model.add(S);
    SL2.assertHas(new Object[] { "add", S });
    SL1.assertHas(new Object[] { "add", S });
}
Also used : Statement(org.apache.jena.rdf.model.Statement) RecordingModelListener(org.apache.jena.rdf.model.test.helpers.RecordingModelListener)

Aggregations

RecordingModelListener (org.apache.jena.rdf.model.test.helpers.RecordingModelListener)3 StringReader (java.io.StringReader)1 RDFReader (org.apache.jena.rdf.model.RDFReader)1 Statement (org.apache.jena.rdf.model.Statement)1