Package com.hp.hpl.jena.rdf.model

Examples of com.hp.hpl.jena.rdf.model.SimpleSelector


  /**
   * A random sub-class of SimpleSelector must not be simple.
   */
  public void testSimpleSubclassIsntSimple()
  {
    Assert.assertFalse(new SimpleSelector(null, null, (RDFNode) null) {
    }.isSimple());
  }
View Full Code Here


  }

  @Test
  public void testQuery() throws Exception
  {
    final Selector s = new SimpleSelector();
    try
    {
      securedModel.query(s);
      if (!securityEvaluator.evaluate(Action.Read))
      {
View Full Code Here

        GraphTestBase.iteratorToSet(r.listProperties().mapWith(
            Statement.Util.getSubject)));
    //
    r.removeProperties();
    Assert.assertEquals(0,
        model.query(new SimpleSelector(r, null, (RDFNode) null)).size());
  }
View Full Code Here

  }

  public void testListWithLiteralSelector()
  {

    final StmtIterator it6 = model.listStatements(new SimpleSelector(null,
        null, tvStrings[1], langs[1]));
    final List<Statement> L6 = GraphTestBase.iteratorToList(it6);
        for ( Statement aL6 : L6 )
        {
            Assert.assertEquals( langs[1], aL6.getLanguage() );
View Full Code Here

    Assert.assertEquals(2, L6.size());
  }

  public void testListWithNullSelector()
  {
    final StmtIterator it1 = model.listStatements(new SimpleSelector(null,
        null, (RDFNode) null));
    final List<Statement> L1 = GraphTestBase.iteratorToList(it1);
    Assert.assertEquals(num * num * 7, L1.size());

  }
View Full Code Here

  }

  public void testListWithPredicateSelector()
  {

    final StmtIterator it3 = model.listStatements(new SimpleSelector(null,
        predicate[1], (RDFNode) null));
    final List<Statement> L3 = GraphTestBase.iteratorToList(it3);
        for ( Statement aL3 : L3 )
        {
            Assert.assertEquals( predicate[1], aL3.getPredicate() );
View Full Code Here

  // assertEquals( 2, L4.size() );

  public void testListWithRDFSelector()
  {

    final StmtIterator it5 = model.listStatements(new SimpleSelector(null,
        null, model.createTypedLiteral(false)));
    final List<Statement> L5 = GraphTestBase.iteratorToList(it5);
        for ( Statement aL5 : L5 )
        {
            Assert.assertEquals( false, aL5.getBoolean() );
View Full Code Here

    Assert.assertEquals(2, L5.size());
  }

  public void testListWithSubjectSelector()
  {
    final StmtIterator it2 = model.listStatements(new SimpleSelector(
        subject[0], null, (RDFNode) null));
    final List<Statement> L2 = GraphTestBase.iteratorToList(it2);
        for ( Statement aL2 : L2 )
        {
            Assert.assertEquals( subject[0], aL2.getSubject() );
View Full Code Here

     * compatability. It was be logged and has now become an exception.
     */
    try
    {
      final Literal lit = model.createLiteral(null, "");
      model.query(new SimpleSelector(null, null, lit));
      Assert.fail("SHould have thrown a null pointer exception");
    }
    catch (final NullPointerException expected)
    { // expected}
    }

    try
    {
      final Literal lit = model.createLiteral(null, "en");
      model.query(new SimpleSelector(null, null, lit));
      Assert.fail("SHould have thrown a null pointer exception");
    }
    catch (final NullPointerException expected)
    { // expected}
    }

    StmtIterator iter = model.listStatements(new SimpleSelector(null, null,
        (String) null));
    while (iter.hasNext())
    {
      iter.nextStatement().getObject();
    }

    iter = model.listStatements(new SimpleSelector(null, null,
        (Object) null));
    while (iter.hasNext())
    {
      iter.nextStatement().getObject();
    }
View Full Code Here

  }

  public void testQueryWithLiteralSelector()
  {
    Statement stmt;
    final Model mm = model.query(new SimpleSelector(null, null,
        tvStrings[0], langs[0]));
    Assert.assertEquals(2, mm.size());
    final StmtIterator iter = mm.listStatements();
    try
    {
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.rdf.model.SimpleSelector

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.