Github user kchilton2 commented on a diff in the pull request:

    https://github.com/apache/incubator-rya/pull/36#discussion_r59214092
  
    --- Diff: 
extras/indexing/src/test/java/mvm/rya/indexing/external/tupleSet/VisibilityBindingSetStringConverterTest.java
 ---
    @@ -0,0 +1,131 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *   http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing,
    + * software distributed under the License is distributed on an
    + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    + * KIND, either express or implied.  See the License for the
    + * specific language governing permissions and limitations
    + * under the License.
    + */
    +package mvm.rya.indexing.external.tupleSet;
    +
    +import static org.junit.Assert.assertEquals;
    +
    +import org.junit.Test;
    +import org.openrdf.model.impl.URIImpl;
    +import org.openrdf.query.BindingSet;
    +import org.openrdf.query.impl.MapBindingSet;
    +
    +import mvm.rya.indexing.accumulo.VisibilityBindingSet;
    +import 
mvm.rya.indexing.external.tupleSet.BindingSetConverter.BindingSetConversionException;
    +import mvm.rya.indexing.external.tupleSet.PcjTables.VariableOrder;
    +
    +/**
    + * Tests the methods of {@link BindingSetStringConverter}.
    + */
    +public class VisibilityBindingSetStringConverterTest {
    +    @Test
    +    public void toString_URIs() throws BindingSetConversionException {
    +        // Setup the binding set that will be converted.
    +        final MapBindingSet originalBindingSet = new MapBindingSet();
    +        originalBindingSet.addBinding("x", new URIImpl("http://a";));
    +        originalBindingSet.addBinding("y", new URIImpl("http://b";));
    +        originalBindingSet.addBinding("z", new URIImpl("http://c";));
    +
    +        final VisibilityBindingSet visiSet = new 
VisibilityBindingSet(originalBindingSet, "A&B&C");
    +
    +        // Convert it to a String.
    +        final VariableOrder varOrder = new VariableOrder("y", "z", "x");
    +        final VisibilityBindingSetStringConverter converter = new 
VisibilityBindingSetStringConverter();
    +        final String bindingSetString = converter.convert(visiSet, 
varOrder);
    +
    +        // Ensure it converted to the expected result.l
    +        final String expected =
    +                "http://b<<~>>http://www.w3.org/2001/XMLSchema#anyURI:::"; +
    +                "http://c<<~>>http://www.w3.org/2001/XMLSchema#anyURI:::"; +
    +                "http://a<<~>>http://www.w3.org/2001/XMLSchema#anyURI"; +
    +                (char)1 + "A&B&C";
    --- End diff --
    
    Might want to store the (char)1 delimiter as a constant somewhere and 
reference that here.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to