private void shouldDealWithOutgoingEdgesOnlyOption(final AccumuloStore store){
  try {
    final Set<Element> data=new HashSet<>();
    data.add(AccumuloTestData.EDGE_A1_B1);
    data.add(AccumuloTestData.EDGE_B2_A2);
    addElements(data,store,new User());
    final AbstractAccumuloTwoSetSeededOperation<EntitySeed,Element> opA1B1=new GetElementsBetweenSets<>(AccumuloTestData.SEED_A1_SET,AccumuloTestData.SEED_B1_SET,defaultView);
    opA1B1.setIncludeEntities(false);
    opA1B1.setIncludeIncomingOutGoing(IncludeIncomingOutgoingType.OUTGOING);
    final Set<Element> a1B1OutgoingEdgeResults=returnElementsFromOperation(store,opA1B1,new User(),false);
    assertThat(a1B1OutgoingEdgeResults,IsCollectionContaining.hasItem(AccumuloTestData.EDGE_A1_B1));
    opA1B1.setIncludeIncomingOutGoing(IncludeIncomingOutgoingType.INCOMING);
    final Set<Element> a1B1EdgeIncomingResults=returnElementsFromOperation(store,opA1B1,new User(),false);
    assertEquals(0,a1B1EdgeIncomingResults.size());
    final AbstractAccumuloTwoSetSeededOperation<EntitySeed,Element> opA2B2=new GetElementsBetweenSets<>(AccumuloTestData.SEED_A2_SET,AccumuloTestData.SEED_B2_SET,defaultView);
    opA2B2.setIncludeEntities(false);
    opA2B2.setIncludeIncomingOutGoing(IncludeIncomingOutgoingType.INCOMING);
    final Set<Element> a2B2EdgeIncomingResults=returnElementsFromOperation(store,opA2B2,new User(),false);
    assertThat(a2B2EdgeIncomingResults,IsCollectionContaining.hasItem(AccumuloTestData.EDGE_B2_A2));
    opA2B2.setIncludeIncomingOutGoing(IncludeIncomingOutgoingType.OUTGOING);
    final Set<Element> a2B2EdgeOutgoingResults=returnElementsFromOperation(store,opA2B2,new User(),false);
    assertEquals(0,a2B2EdgeOutgoingResults.size());
  }
 catch (  StoreException e) {
    fail("Failed to set up graph in Accumulo with exception: " + e);
  }
}

private void shouldDealWithOutgoingEdgesOnlyOption ( final AccumuloStore store ) { try { final Set < Element > data = new HashSet < > ( ) ; data . add ( AccumuloTestData . EDGE_A1_B1 ) ; data . add ( AccumuloTestData . EDGE_B2_A2 ) ; addElements ( data , store , new User ( ) ) ; final AbstractAccumuloTwoSetSeededOperation < EntitySeed , Element > opA1B1 = new GetElementsBetweenSets < > ( AccumuloTestData . SEED_A1_SET , AccumuloTestData . SEED_B1_SET , defaultView ) ; opA1B1 . setIncludeEntities ( false ) ; opA1B1 . setIncludeIncomingOutGoing ( IncludeIncomingOutgoingType . OUTGOING ) ; final Set < Element > a1B1OutgoingEdgeResults = returnElementsFromOperation ( store , opA1B1 , new User ( ) , false ) ; assertThat ( a1B1OutgoingEdgeResults , IsCollectionContaining . hasItem ( AccumuloTestData . EDGE_A1_B1 ) ) ; opA1B1 . setIncludeIncomingOutGoing ( IncludeIncomingOutgoingType . INCOMING ) ; final Set < Element > a1B1EdgeIncomingResults = returnElementsFromOperation ( store , opA1B1 , new User ( ) , false ) ; assertEquals ( 0 , a1B1EdgeIncomingResults . size ( ) ) ; final AbstractAccumuloTwoSetSeededOperation < EntitySeed , Element > opA2B2 = new GetElementsBetweenSets < > ( AccumuloTestData . SEED_A2_SET , AccumuloTestData . SEED_B2_SET , defaultView ) ; opA2B2 . setIncludeEntities ( false ) ; opA2B2 . setIncludeIncomingOutGoing ( IncludeIncomingOutgoingType . INCOMING ) ; final Set < Element > a2B2EdgeIncomingResults = returnElementsFromOperation ( store , opA2B2 , new User ( ) , false ) ; assertThat ( a2B2EdgeIncomingResults , IsCollectionContaining . hasItem ( AccumuloTestData . EDGE_B2_A2 ) ) ; opA2B2 . setIncludeIncomingOutGoing ( IncludeIncomingOutgoingType . OUTGOING ) ; final Set < Element > a2B2EdgeOutgoingResults = returnElementsFromOperation ( store , opA2B2 , new User ( ) , false ) ; assertEquals ( 0 , a2B2EdgeOutgoingResults . size ( ) ) ; } catch ( StoreException e ) { fail ( "Failed to set up graph in Accumulo with exception: " + e ) ; } }
tests that the options to set outgoing edges or incoming edges only options work correctly .
