Skip to content
Permalink
Browse files
Rename the Value.getValue() to Value.getString() (cf DIRAPI-328)
  • Loading branch information
elecharny committed Jan 7, 2019
1 parent 0a198ab commit 0cce09b356195411ad262a635e5fa145ea6fc268
Show file tree
Hide file tree
Showing 61 changed files with 1,881 additions and 359 deletions.
878 deps.txt

Large diffs are not rendered by default.

@@ -176,21 +176,21 @@ public Element toDsml( Element root )
// Looping on Values
for ( Value value : attribute )
{
if ( ParserUtils.needsBase64Encoding( value.getValue() ) )
if ( ParserUtils.needsBase64Encoding( value.getString() ) )
{
Namespace xsdNamespace = new Namespace( "xsd", ParserUtils.XML_SCHEMA_URI );
Namespace xsiNamespace = new Namespace( "xsi", ParserUtils.XML_SCHEMA_INSTANCE_URI );
attributeElement.getDocument().getRootElement().add( xsdNamespace );
attributeElement.getDocument().getRootElement().add( xsiNamespace );

Element valueElement = attributeElement.addElement( "value" ).addText(
ParserUtils.base64Encode( value.getValue() ) );
ParserUtils.base64Encode( value.getString() ) );
valueElement
.addAttribute( new QName( "type", xsiNamespace ), "xsd:" + ParserUtils.BASE64BINARY );
}
else
{
attributeElement.addElement( "value" ).addText( value.getValue() );
attributeElement.addElement( "value" ).addText( value.getString() );
}
}
}
@@ -73,7 +73,7 @@ else if ( object instanceof byte[] )
}
else if ( object instanceof Value )
{
return ( ( Value ) object ).getValue();
return ( ( Value ) object ).getString();
}
else
{
@@ -97,7 +97,7 @@ public Element toDsml( Element root )
}
if ( request.getAssertionValue() != null )
{
assertionElement.addElement( "value" ).setText( request.getAssertionValue().getValue() );
assertionElement.addElement( "value" ).setText( request.getAssertionValue().getString() );
}

return element;
@@ -169,23 +169,23 @@ public Element toDsml( Element root )

for ( Value value : modification.getAttribute() )
{
if ( value.getValue() != null )
if ( value.getString() != null )
{
if ( ParserUtils.needsBase64Encoding( value.getValue() ) )
if ( ParserUtils.needsBase64Encoding( value.getString() ) )
{
Namespace xsdNamespace = new Namespace( "xsd", ParserUtils.XML_SCHEMA_URI );
Namespace xsiNamespace = new Namespace( "xsi", ParserUtils.XML_SCHEMA_INSTANCE_URI );
element.getDocument().getRootElement().add( xsdNamespace );
element.getDocument().getRootElement().add( xsiNamespace );

Element valueElement = modElement.addElement( "value" ).addText(
ParserUtils.base64Encode( value.getValue() ) );
ParserUtils.base64Encode( value.getString() ) );
valueElement.addAttribute( new QName( "type", xsiNamespace ), "xsd:"
+ ParserUtils.BASE64BINARY );
}
else
{
modElement.addElement( "value" ).setText( value.getValue() );
modElement.addElement( "value" ).setText( value.getString() );
}
}
}
@@ -572,7 +572,7 @@ else if ( filter instanceof GreaterEqNode )
}
else
{
newElement.addElement( VALUE ).setText( value.getValue() );
newElement.addElement( VALUE ).setText( value.getString() );
}
}
}
@@ -602,12 +602,12 @@ else if ( filter instanceof ExtensibleNode )
element.getDocument().getRootElement().add( xsiNamespace );

Element valueElement = newElement.addElement( VALUE ).addText(
ParserUtils.base64Encode( value.getValue() ) );
ParserUtils.base64Encode( value.getString() ) );
valueElement.addAttribute( new QName( "type", xsiNamespace ), "xsd:" + ParserUtils.BASE64BINARY );
}
else
{
newElement.addElement( VALUE ).setText( value.getValue() );
newElement.addElement( VALUE ).setText( value.getString() );
}
}

@@ -157,7 +157,7 @@ public Element toDsml( Element root )

for ( Value value : attribute )
{
if ( ParserUtils.needsBase64Encoding( value.getValue() ) )
if ( ParserUtils.needsBase64Encoding( value.getString() ) )
{
Namespace xsdNamespace = new Namespace( ParserUtils.XSD, ParserUtils.XML_SCHEMA_URI );
Namespace xsiNamespace = new Namespace( ParserUtils.XSI, ParserUtils.XML_SCHEMA_INSTANCE_URI );
@@ -171,13 +171,13 @@ public Element toDsml( Element root )
}

Element valueElement = attributeElement.addElement( "value" ).addText(
ParserUtils.base64Encode( value.getValue() ) );
ParserUtils.base64Encode( value.getString() ) );
valueElement.addAttribute( new QName( "type", xsiNamespace ), ParserUtils.XSD + ":"
+ ParserUtils.BASE64BINARY );
}
else
{
attributeElement.addElement( "value" ).addText( value.getValue() );
attributeElement.addElement( "value" ).addText( value.getString() );
}
}
}
@@ -411,7 +411,7 @@ public void testRequestWith1AttrWithValue()
Iterator<Value> valueIterator = attribute.iterator();
assertTrue( valueIterator.hasNext() );
Value value = valueIterator.next();
assertEquals( "top", value.getValue() );
assertEquals( "top", value.getString() );
}


@@ -451,7 +451,7 @@ public void testRequestWith1AttrWithBase64Value()
assertTrue( valueIterator.hasNext() );
Value value = valueIterator.next();
assertFalse( value.isHumanReadable() );
assertEquals( "DSMLv2.0 rocks!!", value.getValue() );
assertEquals( "DSMLv2.0 rocks!!", value.getString() );
}


@@ -490,10 +490,10 @@ public void testRequestWith2AttrWithValue()
Iterator<Value> valueIterator = attribute.iterator();
assertTrue( valueIterator.hasNext() );
Value value = valueIterator.next();
assertEquals( "top", value.getValue() );
assertEquals( "top", value.getString() );
assertTrue( valueIterator.hasNext() );
value = valueIterator.next();
assertEquals( "person", value.getValue() );
assertEquals( "person", value.getString() );
assertFalse( valueIterator.hasNext() );
}

@@ -543,10 +543,10 @@ public void testRequestWith1AttrWith2Values()
Iterator<Value> valueIterator = attribute.iterator();
assertTrue( valueIterator.hasNext() );
Value value = valueIterator.next();
assertEquals( "top", value.getValue() );
assertEquals( "top", value.getString() );
assertTrue( valueIterator.hasNext() );
value = valueIterator.next();
assertEquals( "person", value.getValue() );
assertEquals( "person", value.getString() );
assertFalse( valueIterator.hasNext() );
}

@@ -328,7 +328,7 @@ public void testRequestWith1CompleteAssertion()

assertEquals( "sn", compareRequest.getAttributeId() );

assertEquals( "Johnson", compareRequest.getAssertionValue().getValue() );
assertEquals( "Johnson", compareRequest.getAssertionValue().getString() );
}


@@ -359,7 +359,7 @@ public void testRequestWith1CompleteAssertionBase64Value()

assertEquals( "sn", compareRequest.getAttributeId() );

assertEquals( "DSMLv2.0 rocks!!", compareRequest.getAssertionValue().getValue() );
assertEquals( "DSMLv2.0 rocks!!", compareRequest.getAssertionValue().getString() );
}


@@ -312,7 +312,7 @@ public void testRequestWith1Modification() throws LdapException
Attribute attribute = modification.getAttribute();

assertEquals( "directreport", attribute.getId() );
assertEquals( "CN=John Smith, DC=microsoft, DC=com", attribute.get().getValue() );
assertEquals( "CN=John Smith, DC=microsoft, DC=com", attribute.get().getString() );
}


@@ -355,7 +355,7 @@ public void testRequestWith1ModificationBase64Value() throws LdapException
'a', 'r', 'n', 'y', ',', ' ', 'o', 'u', '=', 'p', 'e', 'o', 'p', 'l', 'e', ',', ' ', 'd', 'c', '=',
'e', 'x', 'a', 'm', 'p', 'l', 'e', ',', ' ', 'd', 'c', '=', 'c', 'o', 'm' }, StandardCharsets.UTF_8 );

assertEquals( expected, attribute.get().getValue() );
assertEquals( expected, attribute.get().getString() );
}


@@ -394,7 +394,7 @@ public void testRequestWith2Modifications() throws LdapException
Attribute attribute = modification.getAttribute();
assertEquals( "directreport", attribute.getId() );

assertEquals( "CN=John Smith, DC=microsoft, DC=com", attribute.get().getValue() );
assertEquals( "CN=John Smith, DC=microsoft, DC=com", attribute.get().getString() );

modification = iter.next();

@@ -403,7 +403,7 @@ public void testRequestWith2Modifications() throws LdapException
assertEquals( "sn", attribute.getId() );
assertEquals( ModificationOperation.REPLACE_ATTRIBUTE, modification.getOperation() );

assertEquals( "CN=Steve Jobs, DC=apple, DC=com", attribute.get().getValue() );
assertEquals( "CN=Steve Jobs, DC=apple, DC=com", attribute.get().getString() );
}


@@ -649,7 +649,7 @@ public void testRequestWithModificationWithEmptyValue() throws LdapException
assertEquals( "directreport", attribute.getId() );

assertEquals( 1, attribute.size() );
assertEquals( "", attribute.get().getValue() );
assertEquals( "", attribute.get().getString() );
}


@@ -1019,7 +1019,7 @@ public void testRequestWithApproxMatchFilter()

assertEquals( "sn", approxMatchFilter.getAttribute() );

assertEquals( "foobar", approxMatchFilter.getValue().getValue() );
assertEquals( "foobar", approxMatchFilter.getValue().getString() );
}


@@ -1054,7 +1054,7 @@ public void testRequestWithApproxMatchFilterBase64Value()

assertEquals( "sn", approxMatchFilter.getAttribute() );

assertEquals( "DSMLv2.0 rocks!!", approxMatchFilter.getValue().getValue() );
assertEquals( "DSMLv2.0 rocks!!", approxMatchFilter.getValue().getString() );
}


@@ -1089,7 +1089,7 @@ public void testRequestWithApproxMatchFilterEmptyValue()

assertEquals( "sn", approxMatchFilter.getAttribute() );

assertEquals( "", approxMatchFilter.getValue().getValue() );
assertEquals( "", approxMatchFilter.getValue().getString() );
}


@@ -1154,7 +1154,7 @@ public void testRequestWithGreaterOrEqualFilter()

assertEquals( "sn", greaterEqFilter.getAttribute() );

assertEquals( "foobar", greaterEqFilter.getValue().getValue() );
assertEquals( "foobar", greaterEqFilter.getValue().getString() );
}


@@ -1189,7 +1189,7 @@ public void testRequestWithGreaterOrEqualFilterBase64Value()

assertEquals( "sn", greaterEqFilter.getAttribute() );

assertEquals( "DSMLv2.0 rocks!!", greaterEqFilter.getValue().getValue() );
assertEquals( "DSMLv2.0 rocks!!", greaterEqFilter.getValue().getString() );
}


@@ -1224,7 +1224,7 @@ public void testRequestWithGreaterOrEqualFilterEmptyValue()

assertEquals( "sn", greaterEqFilter.getAttribute() );

assertEquals( "", greaterEqFilter.getValue().getValue() );
assertEquals( "", greaterEqFilter.getValue().getString() );
}


@@ -1289,7 +1289,7 @@ public void testRequestWithLessOrEqualFilter()

assertEquals( "sn", lessOrEqFilter.getAttribute() );

assertEquals( "foobar", lessOrEqFilter.getValue().getValue() );
assertEquals( "foobar", lessOrEqFilter.getValue().getString() );
}


@@ -1324,7 +1324,7 @@ public void testRequestWithLessOrEqualFilterBase64Value()

assertEquals( "sn", lessOrEqFilter.getAttribute() );

assertEquals( "DSMLv2.0 rocks!!", lessOrEqFilter.getValue().getValue() );
assertEquals( "DSMLv2.0 rocks!!", lessOrEqFilter.getValue().getString() );
}


@@ -1359,7 +1359,7 @@ public void testRequestWithLessOrEqualFilterEmptyValue()

assertEquals( "sn", lessOrEqFilter.getAttribute() );

assertEquals( "", lessOrEqFilter.getValue().getValue() );
assertEquals( "", lessOrEqFilter.getValue().getString() );
}


@@ -1423,7 +1423,7 @@ public void testRequestWithEqualityMatchFilter()
EqualityNode<?> equalityFilter = ( EqualityNode<?> ) filter;

assertEquals( "sn", equalityFilter.getAttribute() );
assertEquals( "foobar", equalityFilter.getValue().getValue() );
assertEquals( "foobar", equalityFilter.getValue().getString() );
}


@@ -1458,7 +1458,7 @@ public void testRequestWithEqualityMatchFilterBase64Value()

assertEquals( "sn", equalityFilter.getAttribute() );

assertEquals( "DSMLv2.0 rocks!!", equalityFilter.getValue().getValue() );
assertEquals( "DSMLv2.0 rocks!!", equalityFilter.getValue().getString() );
}


@@ -1493,7 +1493,7 @@ public void testRequestWithEqualityMatchFilterWithEmptyValue()

assertEquals( "sn", equalityFilter.getAttribute() );

assertEquals( "", equalityFilter.getValue().getValue() );
assertEquals( "", equalityFilter.getValue().getString() );
}


@@ -1599,7 +1599,7 @@ public void testRequestWithExtensibleMatchFilter()

ExtensibleNode extensibleMatchFilter = ( ExtensibleNode ) filter;

assertEquals( "A Value", extensibleMatchFilter.getValue().getValue() );
assertEquals( "A Value", extensibleMatchFilter.getValue().getString() );

assertEquals( false, extensibleMatchFilter.hasDnAttributes() );
}
@@ -1634,7 +1634,7 @@ public void testRequestWithExtensibleMatchFilterBase64Value()

ExtensibleNode extensibleMatchFilter = ( ExtensibleNode ) filter;

assertEquals( "DSMLv2.0 rocks!!", extensibleMatchFilter.getValue().getValue() );
assertEquals( "DSMLv2.0 rocks!!", extensibleMatchFilter.getValue().getString() );

assertEquals( false, extensibleMatchFilter.hasDnAttributes() );
}

0 comments on commit 0cce09b

Please sign in to comment.