Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit c43f9e7

Browse files
authored
Merge pull request #192 from paxtonhare/prep-okhttp
support for marklogic-client-api 4.0.2
2 parents 4e72497 + a0a7c56 commit c43f9e7

File tree

9 files changed

+45
-37
lines changed

9 files changed

+45
-37
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: java
22
jdk:
3-
- oraclejdk7
3+
- oraclejdk8
44
sudo: true
55
before_install:
66
- echo 'America/Los_Angeles' | sudo tee /etc/timezone
@@ -13,4 +13,5 @@ script:
1313
#whitelist
1414
branches:
1515
only:
16+
- master
1617
- dev

build.gradle

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ plugins {
44
id "eclipse"
55
id "idea"
66
id "com.jfrog.bintray" version "1.5"
7-
id "com.github.jk1.dependency-license-report" version "0.3.11"
7+
id "com.github.jk1.dependency-license-report" version "0.3.11"
88
}
99

10-
sourceCompatibility = "1.7"
11-
targetCompatibility = "1.7"
10+
sourceCompatibility = "1.8"
11+
targetCompatibility = "1.8"
1212

1313
repositories {
1414
jcenter()
@@ -24,10 +24,10 @@ dependencies {
2424
testCompile ('com.marklogic:ml-junit:3.0-alpha1')
2525
testCompile('commons-io:commons-io:2.5')
2626

27-
// Forcing Spring to use logback instead of commons-logging
28-
runtime "ch.qos.logback:logback-classic:1.1.8"
29-
runtime group: "org.slf4j", name: "jcl-over-slf4j", version: "1.7.22"
30-
runtime group: "org.slf4j", name: "slf4j-api", version: "1.7.22"
27+
// Forcing Spring to use logback instead of commons-logging
28+
runtime "ch.qos.logback:logback-classic:1.1.8"
29+
runtime group: "org.slf4j", name: "jcl-over-slf4j", version: "1.7.22"
30+
runtime group: "org.slf4j", name: "slf4j-api", version: "1.7.22"
3131
}
3232

3333
// This ensures that Gradle includes in the published jar any non-java files under src/main/java
@@ -70,3 +70,10 @@ if (project.hasProperty("myBintrayUser")) {
7070
}
7171
}
7272
}
73+
74+
test {
75+
testLogging {
76+
events 'started','passed', 'skipped', 'failed'
77+
exceptionFormat 'full'
78+
}
79+
}

shared/dev-tasks/travis-install-ml.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ set | grep TRAVIS
1616
test $1 && arg1=$1
1717
if [[ $arg1 = 'release' ]]; then
1818
ver=${ML_VERSION}
19-
fname=MarkLogic-RHEL6-${ver}.x86_64.rpm
19+
fname=MarkLogic-${ver}.x86_64.rpm
2020
fnamedeb="marklogic_"
2121
fnamedeb=$fnamedeb$ver
2222
suff="_amd64.deb"
2323
fnamedeb=$fnamedeb$suff
2424

2525
curl -c cookies.txt --data "email=${MLBUILD_USER}&password=${MLBUILD_PASSWORD}" https://developer.marklogic.com/login
26-
dl_link=$(curl -b cookies.txt --data "download=/download/binaries/8.0/${fname}" https://developer.marklogic.com/get-download-url | perl -pe 's/.*"path":"([^"]+).*/\1/')
26+
dl_link=$(curl -b cookies.txt --data "download=/download/binaries/9.0/${fname}" https://developer.marklogic.com/get-download-url | perl -pe 's/.*"path":"([^"]+).*/\1/')
2727
url="https://developer.marklogic.com${dl_link}"
2828

2929
echo "********* Downloading MarkLogic $ver"
@@ -45,7 +45,7 @@ else
4545
# if the user passed a day string as a param then use it instead
4646
test $1 && day=$1
4747
# make a version number out of the date
48-
ver="8.0-$day"
48+
ver="9.0-$day"
4949

5050
echo "********* Downloading MarkLogic nightly $ver"
5151

@@ -56,7 +56,7 @@ else
5656
suff="_amd64.deb"
5757
fnamedeb=$fnamedeb$suff
5858

59-
url="https://root.marklogic.com/nightly/builds/linux64/rh6-intel64-80-test-1.marklogic.com/b8_0/pkgs.$day/$fname"
59+
url="https://root.marklogic.com/nightly/builds/linux64-rh7/rh7v-intel64-90-test-build.marklogic.com/b9_0/pkgs.$day/$fname"
6060

6161
status=$(curl -k --anyauth -u $MLBUILD_USER:$MLBUILD_PASSWORD --head --write-out %{http_code} --silent --output /dev/null $url)
6262
if [[ $status = 200 ]]; then

src/main/java/com/marklogic/appdeployer/command/modules/AllButAssetsModulesFinder.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33
import com.marklogic.client.ext.modulesloader.Modules;
44
import com.marklogic.client.ext.modulesloader.impl.BaseModulesFinder;
55

6-
import java.io.File;
7-
86
public class AllButAssetsModulesFinder extends BaseModulesFinder {
97

108
@Override
11-
public Modules findModules(File baseDir) {
9+
protected Modules findModulesWithResolvedBaseDir(String baseDir) {
1210
Modules modules = new Modules();
1311
addNamespaces(modules, baseDir);
1412
addOptions(modules, baseDir);

src/main/java/com/marklogic/appdeployer/command/modules/AssetModulesFinder.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33
import com.marklogic.client.ext.modulesloader.Modules;
44
import com.marklogic.client.ext.modulesloader.impl.BaseModulesFinder;
55

6-
import java.io.File;
7-
86
public class AssetModulesFinder extends BaseModulesFinder {
97

108
@Override
11-
public Modules findModules(File baseDir) {
9+
protected Modules findModulesWithResolvedBaseDir(String baseDir) {
1210
Modules modules = new Modules();
1311
addAssetDirectories(modules, baseDir);
1412
return modules;

src/main/java/com/marklogic/appdeployer/command/modules/LoadModulesCommand.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ protected void loadModulesIntoMainServer(CommandContext context) {
6363
try {
6464
for (String modulesPath : config.getModulePaths()) {
6565
logger.info("Loading asset modules from dir: " + modulesPath);
66-
modulesLoader.loadModules(new File(modulesPath), new AssetModulesFinder(), client);
66+
modulesLoader.loadModules(modulesPath, new AssetModulesFinder(), client);
6767
}
6868

6969
for (String modulesPath : config.getModulePaths()) {
7070
logger.info("Loading all non-asset modules from dir: " + modulesPath);
71-
modulesLoader.loadModules(new File(modulesPath), new AllButAssetsModulesFinder(), client);
71+
modulesLoader.loadModules(modulesPath, new AllButAssetsModulesFinder(), client);
7272
}
7373
} finally {
7474
client.release();
@@ -88,7 +88,7 @@ protected void loadModulesIntoTestServer(CommandContext context) {
8888
try {
8989
for (String modulesPath : config.getModulePaths()) {
9090
logger.info("Loading modules into test server from dir: " + modulesPath);
91-
testLoader.loadModules(new File(modulesPath), new TestServerModulesFinder(), client);
91+
testLoader.loadModules(modulesPath, new TestServerModulesFinder(), client);
9292
}
9393
} finally {
9494
client.release();

src/main/java/com/marklogic/appdeployer/util/ModulesWatcher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public void run() {
4949
ModulesFinder finder = new DefaultModulesFinder();
5050
while (true) {
5151
for (String modulesPath : paths) {
52-
loader.loadModules(new File(modulesPath), finder, client);
52+
loader.loadModules(modulesPath, finder, client);
5353
}
5454
try {
5555
Thread.sleep(sleepTime);

src/test/java/com/marklogic/appdeployer/command/es/GenerateModelArtifactsTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
import java.io.File;
1515

16-
@Ignore("Ignoring until ML9 is released")
1716
public class GenerateModelArtifactsTest extends AbstractAppDeployerTest {
1817

1918
@After

src/test/java/com/marklogic/appdeployer/export/ExportAmpsTest.java

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ public class ExportAmpsTest extends AbstractExportTest {
2222
public void test() throws Exception {
2323
String amp1 = "{\n" +
2424
" \"namespace\": \"http://example.com/uri\",\n" +
25-
" \"local-name\": \"abctest-amp\",\n" +
25+
" \"local-name\": \"abctest-docs-amp\",\n" +
2626
" \"document-uri\": \"/module/path/name\",\n" +
2727
" \"modules-database\": \"Documents\",\n" +
2828
" \"role\": [\"rest-writer\"]\n" +
2929
"}";
3030

3131
String amp2 = "{\n" +
3232
" \"namespace\": \"http://example.com/uri\",\n" +
33-
" \"local-name\": \"abctest-amp\",\n" +
33+
" \"local-name\": \"abctest-mods-amp\",\n" +
3434
" \"document-uri\": \"/module/path/name\",\n" +
3535
" \"modules-database\": \"Modules\",\n" +
3636
" \"role\": [\"rest-writer\"]\n" +
@@ -61,8 +61,8 @@ private void verifyAmpsCanBeExportedViaRegex() throws Exception {
6161

6262
private void verifyAmpsCanBeExportedViaProperties() throws Exception {
6363
Properties props = new Properties();
64-
props.put("amps", "/manage/v2/amps/abctest-amp?namespace=http://example.com/uri&document-uri=/module/path/name&modules-database=Documents," +
65-
"/manage/v2/amps/abctest-amp?namespace=http://example.com/uri&document-uri=/module/path/name&modules-database=Modules");
64+
props.put("amps", "/manage/v2/amps/abctest-docs-amp?namespace=http://example.com/uri&document-uri=/module/path/name&modules-database=Documents," +
65+
"/manage/v2/amps/abctest-mods-amp?namespace=http://example.com/uri&document-uri=/module/path/name&modules-database=Modules");
6666
PropertiesResourceSelector selector = new PropertiesResourceSelector(props);
6767
verifyAmpsCanBeExported(selector);
6868
}
@@ -76,16 +76,21 @@ private void verifyAmpsCanBeExported(ResourceSelector selector) throws Exception
7676
// Kick the tires on our JSON annotations on Amp
7777
ResourceMapper mapper = new DefaultResourceMapper(new API(manageClient));
7878

79-
Amp amp = mapper.readResource(new String(FileCopyUtils.copyToByteArray(files.get(0))), Amp.class);
80-
assertEquals("http://example.com/uri", amp.getNamespace());
81-
assertEquals("abctest-amp", amp.getLocalName());
82-
assertEquals("/module/path/name", amp.getDocumentUri());
83-
assertEquals("Documents", amp.getModulesDatabase());
79+
// order of amps is not very reliable
80+
for (File file : files) {
81+
Amp amp = mapper.readResource(new String(FileCopyUtils.copyToByteArray(files.get(0))), Amp.class);
82+
assertEquals("http://example.com/uri", amp.getNamespace());
83+
assertEquals("/module/path/name", amp.getDocumentUri());
8484

85-
amp = mapper.readResource(new String(FileCopyUtils.copyToByteArray(files.get(1))), Amp.class);
86-
assertEquals("http://example.com/uri", amp.getNamespace());
87-
assertEquals("abctest-amp", amp.getLocalName());
88-
assertEquals("/module/path/name", amp.getDocumentUri());
89-
assertEquals("Modules", amp.getModulesDatabase());
85+
if (amp.getLocalName().equals("abctest-docs-amp")) {
86+
assertEquals("Documents", amp.getModulesDatabase());
87+
}
88+
else if (amp.getLocalName().equals("abctest-mods-amp")) {
89+
assertEquals("Modules", amp.getModulesDatabase());
90+
}
91+
else {
92+
fail("Invalid amp name");
93+
}
94+
}
9095
}
9196
}

0 commit comments

Comments
 (0)