Skip to content

Commit

Permalink
clarify documentation
Browse files Browse the repository at this point in the history
adjust test to accept more attributes being exposed than set
  • Loading branch information
kwin committed Apr 28, 2021
1 parent 289958c commit 3d7a7e5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions oak-doc/src/site/markdown/differences.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ See also [OAK-2644](https://issues.apache.org/jira/browse/OAK-2644).
Session Attributes
------------------

Oak exposes the following attributes via [`Session.getAttribute(...)`][1] and [`Session.getAttributeNames()`][2].
Oak exposes the following attributes via [`Session.getAttribute(...)`][1] and [`Session.getAttributeNames()`][2] in addition to the ones set through [Credentials][3]' attributes passed to [Repository.login(...)][4].

Attribute Name | Attribute Value Type | Description
--- | --- | ---
Expand All @@ -333,4 +333,6 @@ Attribute Name | Attribute Value Type | Description

[0]: https://docs.adobe.com/content/docs/en/spec/jsr170/javadocs/jcr-2.0/javax/jcr/Session.html#setNamespacePrefix(java.lang.String,%20java.lang.String)
[1]: https://docs.adobe.com/content/docs/en/spec/jsr170/javadocs/jcr-2.0/javax/jcr/Session.html#getAttribute(java.lang.String)
[2]: https://docs.adobe.com/content/docs/en/spec/jsr170/javadocs/jcr-2.0/javax/jcr/Session.html#getAttributeNames()
[2]: https://docs.adobe.com/content/docs/en/spec/jsr170/javadocs/jcr-2.0/javax/jcr/Session.html#getAttributeNames()
[3]: https://docs.adobe.com/content/docs/en/spec/jsr170/javadocs/jcr-2.0/javax/jcr/Credentials.html
[4]: https://docs.adobe.com/content/docs/en/spec/jsr170/javadocs/jcr-2.0/javax/jcr/Repository.html#login(javax.jcr.Credentials,%20java.lang.String)
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public void loginWithAttribute() throws RepositoryException {
Collections.<String, Object>singletonMap(RepositoryImpl.REFRESH_INTERVAL, 42));

String[] attributeNames = session.getAttributeNames();
assertEquals(1, attributeNames.length);
assertTrue(attributeNames.length >= 1); // additional attributes may be exposed
assertEquals(RepositoryImpl.REFRESH_INTERVAL, attributeNames[0]);
assertEquals(42L, session.getAttribute(RepositoryImpl.REFRESH_INTERVAL));
session.logout();
Expand All @@ -157,7 +157,7 @@ public void loginWithCredentialsAttribute() throws RepositoryException {
try {
session = getRepository().login(sc, null);
String[] attributeNames = session.getAttributeNames();
assertEquals(1, attributeNames.length);
assertTrue(attributeNames.length >= 1); // additional attributes may be exposed
assertEquals("attr", attributeNames[0]);
assertEquals("val", session.getAttribute("attr"));
} finally {
Expand Down

0 comments on commit 3d7a7e5

Please sign in to comment.