Skip to content

Commit 3273b8f

Browse files
committed
Merge branch '4.1' into 4.0-master
2 parents 7ea967d + 1d7bfca commit 3273b8f

File tree

68 files changed

+8145
-235
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+8145
-235
lines changed

.github/CONTRIBUTING.md

Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
# Contributing to the Java Client API
2+
3+
The Java Client API welcomes new contributors. This document will guide you
4+
through the process.
5+
6+
- [Question or Problem?](#question)
7+
- [Issues and Bugs](#issue)
8+
- [Feature Requests](#feature)
9+
- [Submission Guidelines](#submit)
10+
11+
## <a name="question"></a> Got a Question or Problem?
12+
13+
If you have questions about how to use the Java Client API, you can ask on
14+
[StackOverflow](http://stackoverflow.com/tags/marklogic), tagging the question
15+
with MarkLogic.
16+
17+
## <a name="issue"></a> Found an Issue?
18+
If you find a bug in the source code or a mistake in the documentation, you can help us by
19+
submitting an issue to our [GitHub Issue
20+
Tracker](https://github.com/marklogic/java-client-api/issues). Even better you
21+
can submit a Pull Request with a fix for the issue you filed.
22+
23+
## <a name="feature"></a> Want a Feature?
24+
You can request a new feature by submitting an issue to our
25+
[GitHub Issue Tracker](https://github.com/marklogic/java-client-api/issues).
26+
If you would like to implement a new feature then first create a new issue and
27+
discuss it with one of our project maintainers.
28+
29+
## <a name="submit"></a> Submission Guidelines
30+
31+
### Submitting an Issue
32+
If your issue appears to be a bug, and hasn't been reported, open a new issue.
33+
Providing the following information will increase the chances of your issue
34+
being dealt with quickly:
35+
36+
* **Overview of the Issue** - if an error is being thrown a stack trace helps
37+
* **Motivation for or Use Case** - explain why this is a bug for you
38+
* **Environment** - Mac, windows? Firefox, Chrome? details help
39+
* **Suggest a Fix** - if you can't fix the bug yourself, perhaps you can point
40+
to what might be causing the problem (line of code or commit)
41+
42+
### Submitting a Pull Request
43+
44+
#### Fill in the CLA
45+
46+
Before we can accept your pull request, we need you to sign the [Contributor
47+
License Agreement](http://developer.marklogic.com/products/cla).
48+
49+
#### Fork the Java Client API
50+
51+
Fork the project [on GitHub](https://github.com/marklogic/java-client-api/fork)
52+
and clone your copy.
53+
54+
$ git clone [email protected]:username/java-client-api.git
55+
$ cd java-client-api
56+
$ git remote add upstream git://github.com/marklogic/java-client-api.git
57+
58+
All bug fixes and new features go into the
59+
[develop](https://github.com/marklogic/java-client-api/tree/develop) branch.
60+
61+
We ask that you open an issue in the
62+
[issue tracker](https://github.com/marklogic/java-client-api/issues)
63+
and get agreement from at least one of the project maintainers before you start
64+
coding.
65+
66+
Nothing is more frustrating than seeing your hard work go to waste because
67+
your vision does not align with that of a project maintainer.
68+
69+
#### Choose the appropriate branch
70+
71+
While the \*master branches reflect the latest released code for the
72+
corresponding server release, the \*develop branches reflect the latest changes
73+
that will be released next and are therefore the right place to commit changes.
74+
To be clear, the following branches have the assigned meaning:
75+
* develop - the place to make changes for the next release
76+
* master - the stable code from the last release
77+
* 3.0-develop - the place to make changes for the next 3.x release (corresponds with the next server 8.x release)
78+
* 3.0-master - the stable code from the last 3.x release (corresponds with the latest server 8.x release)
79+
* 2.0-develop - the place to make changes for the next 2.x release (corresponds with the next server 7.x release)
80+
* 2.0-master - the stable code from the last 2.x release (corresponds with the latest server 7.x release)
81+
* 1.0-develop - the place to make changes for the next 1.x release (corresponds with the next server 6.x release)
82+
* 1.0-master - the stable code from the last 1.x release (corresponds with the latest server 6.x release)
83+
84+
#### Create a branch for your changes
85+
86+
Okay, so you have decided to fix something. Create a feature branch
87+
and start hacking:
88+
89+
$ git checkout -b my-feature-branch -t origin/develop
90+
91+
#### Commit your changes
92+
93+
Make sure git knows your name and email address:
94+
95+
$ git config --global user.name "J. Random User"
96+
$ git config --global user.email "[email protected]"
97+
98+
Writing good commit logs is important. A commit log should describe what
99+
changed and why. Follow these guidelines when writing one:
100+
101+
1. The first line should be 50 characters or less and contain a short
102+
description of the change including the Issue number prefixed by a hash (#).
103+
2. Keep the second line blank.
104+
3. Wrap all other lines at 72 columns.
105+
106+
A good commit log looks like this:
107+
108+
```
109+
Fixing Issue #123: make the whatchamajigger work in MarkLogic 8
110+
111+
Body of commit message is a few lines of text, explaining things
112+
in more detail, possibly giving some background about the issue
113+
being fixed, etc etc.
114+
115+
The body of the commit message can be several paragraphs, and
116+
please do proper word-wrap and keep columns shorter than about
117+
72 characters or so. That way `git log` will show things
118+
nicely even when it is indented.
119+
```
120+
121+
The header line should be meaningful; it is what other people see when they
122+
run `git shortlog` or `git log --oneline`.
123+
124+
#### Rebase your repo
125+
126+
Use `git rebase` (not `git merge`) to sync your work from time to time.
127+
128+
$ git fetch upstream
129+
$ git rebase upstream/develop
130+
131+
#### Test your code
132+
133+
Be sure to run the tests before submitting your pull request. PRs with failing
134+
tests won't be accepted.
135+
136+
First verify that you have valid server and admin auth info in
137+
`SERVER_ADMIN_USER` and `SERVER_ADMIN_PASS` fields in
138+
src/test/java/com/marklogic/client/test/Common.java
139+
140+
$ ./gradlew clean
141+
$ ./gradlew testServerInit
142+
$ ./gradlew test
143+
144+
145+
#### If your server is not on localhost
146+
147+
You can either create SSH tunnels to your server on ports 8000, 8002, and 8012
148+
by a command like:
149+
150+
ssh -L 8000:localhost:8000 -L 8002:localhost:8002 -L 8012:localhost:8012 user@hostname
151+
152+
Or you can update the static `HOST` field in
153+
src/test/java/com/marklogic/client/test/Common.java
154+
and the `example.host` property in src/main/resources/Example.properties.
155+
156+
#### Push your changes
157+
158+
$ git push origin my-feature-branch
159+
160+
#### Submit the pull request
161+
162+
Go to https://github.com/username/java-client-api and select your feature
163+
branch. Click the 'Pull Request' button and fill out the form.
164+
165+
Pull requests are usually reviewed within a few days. If you get comments that
166+
need to be to addressed, apply your changes in a separate commit and push that
167+
to your feature branch. Post a comment in the pull request afterwards; GitHub
168+
does not send out notifications when you add commits to existing pull requests.
169+
170+
That's it! Thank you for your contribution!
171+
172+
173+
#### After your pull request is merged
174+
175+
After your pull request is merged, you can safely delete your branch and pull
176+
the changes from the main (upstream) repository:
177+
178+
* Delete the remote branch on GitHub either through the GitHub web UI or your
179+
local shell as follows:
180+
181+
$ git push origin --delete my-feature-branch
182+
183+
* Check out the *develop* branch:
184+
185+
$ git checkout develop -f
186+
187+
* Delete the local branch:
188+
189+
$ git branch -D my-feature-branch
190+
191+
* Update your *develop* with the latest upstream version:
192+
193+
$ git pull --ff upstream develop

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# CHANGELOG
22

3+
## 4.1.0
4+
5+
#### New Functionality
6+
- [#943](https://github.com/marklogic/java-client-api/issues/943) - Add base class for Proxy Services and integrate with the DatabaseClient
7+
- [#942](https://github.com/marklogic/java-client-api/issues/942) - Add value conversion utilities for Proxy Services
8+
- [#951](https://github.com/marklogic/java-client-api/issues/951) - Add utility to produce an SJS/Xquery main module from Proxy services function declaration
9+
10+
#### Improvements and Bug Fixes
11+
- [881](https://github.com/marklogic/java-client-api/issues/881) - Added a BlockingRunsPolicy for rejected tasks for better threadpool utilization
12+
- [920](https://github.com/marklogic/java-client-api/issues/920) - Prevents QueryBatcher hang when you have a single thread
13+
- [971](https://github.com/marklogic/java-client-api/issues/971) - Passed the TrustManager to SSLContext so that the trust manager is taken into account
14+
315
## 4.0.4
416

517
#### New Functionality

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ To use the API in your maven project, include the following in your pom.xml:
6060
<dependency>
6161
<groupId>com.marklogic</groupId>
6262
<artifactId>marklogic-client-api</artifactId>
63-
<version>4.0.4</version>
63+
<version>4.1.0</version>
6464
</dependency>
6565

6666
And add this repository to your pom.xml repositories section:
@@ -73,7 +73,7 @@ And add this repository to your pom.xml repositories section:
7373
For gradle projects, include the following:
7474

7575
dependencies {
76-
compile group: 'com.marklogic', name: 'marklogic-client-api', version: '4.0.4'
76+
compile group: 'com.marklogic', name: 'marklogic-client-api', version: '4.1.0'
7777
}
7878

7979
Use gradle 1.7+ and add this to your build.gradle repositories section:
@@ -102,14 +102,14 @@ https://developer.marklogic.com/free-developer
102102

103103
To obtain verified downloads signed with MarkLogic's PGP key, use maven tools or directly download
104104
the .jar and .asc files from
105-
[maven central](http://repo1.maven.org/maven2/com/marklogic/marklogic-client-api/4.0.4/). MarkLogic's
105+
[maven central](http://repo1.maven.org/maven2/com/marklogic/marklogic-client-api/4.1.0/). MarkLogic's
106106
pgp key ID is 48D4B86E and it is available from pgp.mit.edu by installing gnupg and running the command:
107107

108108
$ gpg --keyserver pgp.mit.edu --recv-key 48D4B86E
109109

110110
Files can be verified with the command:
111111

112-
$ gpg marklogic-client-api-4.0.4.jar.asc
112+
$ gpg marklogic-client-api-4.1.0.jar.asc
113113

114114

115115
### Building and Contributing

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
group=com.marklogic
2-
version=4.0.4
3-
releaseVersion=4.0.4
2+
version=4.1.0
3+
releaseVersion=4.1.0
44
describedName=MarkLogic Java Client API
55
publishUrl=file:../marklogic-java/releases

marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/datamovement/functionaltests/StringQueryHostBatcherTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ public void testAndWordQuery() throws Exception
278278
*
279279
* @throws Exception
280280
*/
281-
@Test
281+
@Ignore
282282
public void testAndWordQueryWithMultipleForests() throws Exception
283283
{
284284
String testMultipleDB = "QBMultipleForestDB";

marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/functionaltest/TestOpticOnCtsQuery.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public class TestOpticOnCtsQuery extends BasicJavaClientREST {
6666
private static String[] fNames = { "TestOpticOnCtsQueryDB-1" };
6767
private static String[] schemafNames = { "TestOpticOnCtsQuerySchemaDB-1" };
6868

69-
private static DatabaseClient client;
69+
private static DatabaseClient client;
7070
private static String datasource = "src/test/java/com/marklogic/client/functionaltest/data/optics/";
7171

7272
@BeforeClass
@@ -129,14 +129,18 @@ public static void setUp() throws KeyManagementException, NoSuchAlgorithmExcepti
129129
createForest(schemafNames[0], schemadbName);
130130
// Set the schemadbName database as the Schema database.
131131
setDatabaseProperties(dbName, "schema-database", schemadbName);
132+
133+
createUserRolesWithPrevilages("opticRole", "xdbc:eval", "xdbc:eval-in", "xdmp:eval-in", "any-uri", "xdbc:invoke");
134+
createRESTUser("opticUser", "0pt1c", "tde-admin", "tde-view", "opticRole", "rest-admin", "rest-writer",
135+
"rest-reader", "rest-extension-user", "manage-user");
132136

133137
if (IsSecurityEnabled()) {
134-
schemaDBclient = getDatabaseClientOnDatabase(getRestServerHostName(), getRestServerPort(), schemadbName, "admin", "admin", Authentication.DIGEST);
135-
client = getDatabaseClient("admin", "admin", Authentication.DIGEST);
138+
schemaDBclient = getDatabaseClientOnDatabase(getRestServerHostName(), getRestServerPort(), schemadbName, "opticUser", "0pt1c", Authentication.DIGEST);
139+
client = getDatabaseClient("opticUser", "0pt1c", Authentication.DIGEST);
136140
}
137141
else {
138-
schemaDBclient = DatabaseClientFactory.newClient(getRestServerHostName(), getRestServerPort(), schemadbName, new DigestAuthContext("admin", "admin"));
139-
client = DatabaseClientFactory.newClient(getRestServerHostName(), getRestServerPort(), new DigestAuthContext("admin", "admin"));
142+
schemaDBclient = DatabaseClientFactory.newClient(getRestServerHostName(), getRestServerPort(), schemadbName, new DigestAuthContext("opticUser", "0pt1c"));
143+
client = DatabaseClientFactory.newClient(getRestServerHostName(), getRestServerPort(), new DigestAuthContext("opticUser", "0pt1c"));
140144
}
141145

142146
// Install the TDE templates
@@ -823,6 +827,8 @@ public static void tearDownAfterClass() throws Exception
823827
System.out.println("In tear down");
824828
// Delete the temp schema DB after resetting the Schema DB on content DB.
825829
// Else delete fails.
830+
deleteUserRole("opticRole");
831+
deleteRESTUser("opticUser");
826832
setDatabaseProperties(dbName, "schema-database", dbName);
827833
deleteDB(schemadbName);
828834
deleteForest(schemafNames[0]);

marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/functionaltest/TestOpticOnLexicons.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public class TestOpticOnLexicons extends BasicJavaClientREST {
6565
private static String schemadbName = "TestOpticOnLexiconsSchemaDB";
6666
private static String[] fNames = { "TestOpticOnLexiconsDB-1" };
6767
private static String[] schemafNames = { "TestOpticOnLexiconsSchemaDB-1" };
68-
68+
6969
private static DatabaseClient client;
7070
private static String datasource = "src/test/java/com/marklogic/client/functionaltest/data/optics/";
7171

@@ -127,16 +127,21 @@ public static void setUp() throws KeyManagementException, NoSuchAlgorithmExcepti
127127
createForest(schemafNames[0], schemadbName);
128128
// Set the schemadbName database as the Schema database.
129129
setDatabaseProperties(dbName, "schema-database", schemadbName);
130+
131+
createUserRolesWithPrevilages("opticRole", "xdbc:eval", "xdbc:eval-in", "xdmp:eval-in", "any-uri", "xdbc:invoke");
132+
createRESTUser("opticUser", "0pt1c", "tde-admin", "tde-view", "opticRole", "rest-admin", "rest-writer",
133+
"rest-reader", "rest-extension-user", "manage-user");
130134

131135
if (IsSecurityEnabled()) {
132-
schemaDBclient = getDatabaseClientOnDatabase(getRestServerHostName(), getRestServerPort(), schemadbName, "admin", "admin", Authentication.DIGEST);
133-
client = getDatabaseClient("admin", "admin", Authentication.DIGEST);
136+
schemaDBclient = getDatabaseClientOnDatabase(getRestServerHostName(), getRestServerPort(), schemadbName, "opticUser", "0pt1c", Authentication.DIGEST);
137+
client = getDatabaseClient("opticUser", "0pt1c", Authentication.DIGEST);
134138
}
135139
else {
136-
schemaDBclient = DatabaseClientFactory.newClient(getRestServerHostName(), getRestServerPort(), schemadbName, new DigestAuthContext("admin", "admin"));
137-
client = DatabaseClientFactory.newClient(getRestServerHostName(), getRestServerPort(), new DigestAuthContext("admin", "admin"));
140+
schemaDBclient = DatabaseClientFactory.newClient(getRestServerHostName(), getRestServerPort(), schemadbName, new DigestAuthContext("opticUser", "0pt1c"));
141+
client = DatabaseClientFactory.newClient(getRestServerHostName(), getRestServerPort(), new DigestAuthContext("opticUser", "0pt1c"));
138142
}
139143

144+
140145
// Install the TDE templates
141146
// loadFileToDB(client, filename, docURI, collection, document format)
142147
loadFileToDB(schemaDBclient, "masterDetail.tdex", "/optic/view/test/masterDetail.tdex", "XML", new String[] { "http://marklogic.com/xdmp/tde" });
@@ -1433,6 +1438,8 @@ public static void tearDownAfterClass() throws Exception {
14331438
System.out.println("In tear down");
14341439
// Delete the temp schema DB after resetting the Schema DB on content DB.
14351440
// Else delete fails.
1441+
deleteUserRole("opticRole");
1442+
deleteRESTUser("opticUser");
14361443
setDatabaseProperties(dbName, "schema-database", dbName);
14371444
deleteDB(schemadbName);
14381445
deleteForest(schemafNames[0]);

0 commit comments

Comments
 (0)