@SuppressWarnings("rawtypes") public void test_clearSolutionSet(){
  final List<IBindingSet[]> in=new LinkedList<IBindingSet[]>();
{
    final IVariable<?> x=Var.var("x");
    final IVariable<?> y=Var.var("y");
    final IVariable<?> z=Var.var("z");
{
      final List<IBindingSet> t=new LinkedList<IBindingSet>();
{
        final ListBindingSet b=new ListBindingSet();
        b.set(x,new Constant<IV>(termId2));
        b.set(y,new Constant<IV>(inlineIV));
        b.set(z,new Constant<IV>(blobIV));
        t.add(b);
      }
      in.add(t.toArray(new IBindingSet[0]));
    }
{
      final List<IBindingSet> t=new LinkedList<IBindingSet>();
{
        final ListBindingSet b=new ListBindingSet();
        b.set(x,new Constant<IV>(termId));
        b.set(y,new Constant<IV>(termId2));
        t.add(b);
      }
      in.add(t.toArray(new IBindingSet[0]));
    }
{
      final List<IBindingSet> t=new LinkedList<IBindingSet>();
{
        final ListBindingSet b=new ListBindingSet();
        t.add(b);
      }
      in.add(t.toArray(new IBindingSet[0]));
    }
  }
  final String solutionSet=getName();
  try {
    solutionSetsManager.getSolutions(solutionSet);
    fail("Expecting: " + IllegalStateException.class);
  }
 catch (  IllegalStateException ex) {
    if (log.isInfoEnabled())     log.info("Ignoring expected exception: " + ex);
  }
  solutionSetsManager.putSolutions(solutionSet,new CloseableIteratorWrapper<IBindingSet[]>(in.iterator()));
{
    final ICloseableIterator<IBindingSet[]> out=solutionSetsManager.getSolutions(solutionSet);
    assertSameSolutionsAnyOrder(flatten(in.iterator()),out);
  }
{
    final ICloseableIterator<IBindingSet[]> out=solutionSetsManager.getSolutions(solutionSet);
    assertSameSolutionsAnyOrder(flatten(in.iterator()),out);
  }
  solutionSetsManager.clearSolutions(solutionSet);
  try {
    solutionSetsManager.getSolutions(solutionSet);
    fail("Expecting: " + IllegalStateException.class);
  }
 catch (  IllegalStateException ex) {
    if (log.isInfoEnabled())     log.info("Ignoring expected exception: " + ex);
  }
}

@ SuppressWarnings ( "rawtypes" ) public void test_clearSolutionSet ( ) { final List < IBindingSet [ ] > in = new LinkedList < IBindingSet [ ] > ( ) ; { final IVariable < ? > x = Var . var ( "x" ) ; final IVariable < ? > y = Var . var ( "y" ) ; final IVariable < ? > z = Var . var ( "z" ) ; { final List < IBindingSet > t = new LinkedList < IBindingSet > ( ) ; { final ListBindingSet b = new ListBindingSet ( ) ; b . set ( x , new Constant < IV > ( termId2 ) ) ; b . set ( y , new Constant < IV > ( inlineIV ) ) ; b . set ( z , new Constant < IV > ( blobIV ) ) ; t . add ( b ) ; } in . add ( t . toArray ( new IBindingSet [ 0 ] ) ) ; } { final List < IBindingSet > t = new LinkedList < IBindingSet > ( ) ; { final ListBindingSet b = new ListBindingSet ( ) ; b . set ( x , new Constant < IV > ( termId ) ) ; b . set ( y , new Constant < IV > ( termId2 ) ) ; t . add ( b ) ; } in . add ( t . toArray ( new IBindingSet [ 0 ] ) ) ; } { final List < IBindingSet > t = new LinkedList < IBindingSet > ( ) ; { final ListBindingSet b = new ListBindingSet ( ) ; t . add ( b ) ; } in . add ( t . toArray ( new IBindingSet [ 0 ] ) ) ; } } final String solutionSet = getName ( ) ; try { solutionSetsManager . getSolutions ( solutionSet ) ; fail ( "Expecting: " + IllegalStateException . class ) ; } catch ( IllegalStateException ex ) { if ( log . isInfoEnabled ( ) ) log . info ( "Ignoring expected exception: " + ex ) ; } solutionSetsManager . putSolutions ( solutionSet , new CloseableIteratorWrapper < IBindingSet [ ] > ( in . iterator ( ) ) ) ; { final ICloseableIterator < IBindingSet [ ] > out = solutionSetsManager . getSolutions ( solutionSet ) ; assertSameSolutionsAnyOrder ( flatten ( in . iterator ( ) ) , out ) ; } { final ICloseableIterator < IBindingSet [ ] > out = solutionSetsManager . getSolutions ( solutionSet ) ; assertSameSolutionsAnyOrder ( flatten ( in . iterator ( ) ) , out ) ; } solutionSetsManager . clearSolutions ( solutionSet ) ; try { solutionSetsManager . getSolutions ( solutionSet ) ; fail ( "Expecting: " + IllegalStateException . class ) ; } catch ( IllegalStateException ex ) { if ( log . isInfoEnabled ( ) ) log . info ( "Ignoring expected exception: " + ex ) ; } }
unit test for clearing a named solution set .
