Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
ab2f413
:bug: create or update a document from an InputStream and optionally …
Mar 31, 2017
5dfe788
Merge branch 'develop' into fix_create_document
germanattanasio Mar 31, 2017
30dfb6a
Merge branch 'develop' into fix_create_document
germanattanasio Mar 31, 2017
8357064
Merge pull request #630 from tdumitriu/fix_create_document
germanattanasio Apr 2, 2017
f0aac33
Checkstyle Fail build if checkstyle fails (#636)
blakesteve Apr 4, 2017
2aa5214
revert merge conflict resolution
blakesteve Apr 4, 2017
d370f00
Merge branch 'develop' into encoding-revert
germanattanasio Apr 4, 2017
19948d5
:bug: escape semicolon prior to sending to server
blakesteve Apr 4, 2017
4520f02
Merge branch 'encoding-revert' of https://github.com/watson-developer…
blakesteve Apr 4, 2017
f9899ba
Merge pull request #638 from watson-developer-cloud/encoding-revert
germanattanasio Apr 5, 2017
d581c3f
:new: Provide a specific document Id when creating a document
Apr 5, 2017
8acb411
NLU: Add model for disambiguation and property in EntitiesResults
Apr 6, 2017
9328c5f
Add test for disambiguation info
Apr 6, 2017
4e53c8f
Add README.md for Natural Language Understanding
Apr 6, 2017
facb636
Merge branch 'develop' into 634/add-nlu-readme
germanattanasio Apr 7, 2017
6b1db92
Merge pull request #643 from mkistler/634/add-nlu-readme
germanattanasio Apr 7, 2017
cedb142
Merge branch 'develop' into create_document_with_id
kognate Apr 7, 2017
0dcb8bd
Merge branch 'develop' into 640-add-disambiguation-property
germanattanasio Apr 7, 2017
d86a593
Merge pull request #639 from tdumitriu/create_document_with_id
kognate Apr 7, 2017
71dbe66
Merge branch 'develop' into 640-add-disambiguation-property
germanattanasio Apr 7, 2017
4d16b7a
Merge pull request #641 from mkistler/640-add-disambiguation-property
germanattanasio Apr 7, 2017
a470349
fix broken tts test
Apr 7, 2017
5d69e1d
remove unused variable
Apr 7, 2017
a95c68d
:tshirt: fix checkstyle
germanattanasio Apr 7, 2017
b4c3c5e
Merge branch 'develop' into fix_tts_tests
germanattanasio Apr 7, 2017
b181354
Merge pull request #644 from watson-developer-cloud/fix_tts_tests
germanattanasio Apr 7, 2017
bc987e6
Update javadoc for interimResult, fixes #504
germanattanasio Apr 7, 2017
bd29fc2
Organize imports
germanattanasio Apr 7, 2017
5ae0d24
TTS Synthesize using POST, fixes #635 and #602
germanattanasio Apr 7, 2017
37abc86
:bug: Language translator, update service name
germanattanasio Apr 7, 2017
f7cd661
:memo: Update README version to 3.7.2
germanattanasio Apr 7, 2017
838961f
:memo: Update CHANGELOG.md
germanattanasio Apr 7, 2017
ada8029
:t-shirt: Fix training space
germanattanasio Apr 7, 2017
ce323d7
:tshirt: Fix check style in test case
germanattanasio Apr 7, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ script:
- ./gradlew test
- ./gradlew codeCoverageReport
- ./gradlew docs > /dev/null # build the javadoc
- ./gradlew checkstyleMain
- ./gradlew checkstyleTest

after_success:
- bash <(curl -s https://codecov.io/bash)
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
Change Log
==========

## Version 3.7.2

_2017-04-07_

* New: Provide a specific document Id when creating a document d581c3f
* New: NLU: Add model for disambiguation and property in EntitiesResults 8acb411
* New: Add test for disambiguation info 9328c5f
* Fix: Discovery: create or update a document from an InputStream and optionally spec… … ab2f413
* Fix: Add README.md for Natural Language Understanding 4e53c8f
* Fix: 👕 Checkstyle Verified a95c68d
* Fix: TTS Synthesize using POST, fixes #635 and #602 Verified 5ae0d24
* Fix: Language translator, update service name Verified 37abc86

## Version 3.7.1

_2017-03-31_
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ All the services:
<dependency>
<groupId>com.ibm.watson.developer_cloud</groupId>
<artifactId>java-sdk</artifactId>
<version>3.7.1</version>
<version>3.7.2</version>
</dependency>
```

Expand All @@ -63,25 +63,25 @@ Only Retrieve and Rank:
<dependency>
<groupId>com.ibm.watson.developer_cloud</groupId>
<artifactId>retrieve-and-rank</artifactId>
<version>3.7.1</version>
<version>3.7.2</version>
</dependency>
```

##### Gradle

All the services:
```gradle
'com.ibm.watson.developer_cloud:java-sdk:3.7.1'
'com.ibm.watson.developer_cloud:java-sdk:3.7.2'
```

Only Retrieve and Rank:
```gradle
'com.ibm.watson.developer_cloud:retrieve-and-rank:3.7.1'
'com.ibm.watson.developer_cloud:retrieve-and-rank:3.7.2'
```

Only Visual Recognition:
```gradle
'com.ibm.watson.developer_cloud:visual-recognition:3.7.1'
'com.ibm.watson.developer_cloud:visual-recognition:3.7.2'
```

Snapshots of the development version are available in [Sonatype's snapshots repository][sonatype_snapshots].
Expand Down Expand Up @@ -286,7 +286,7 @@ Gradle:

```sh
$ cd java-sdk
$ gradle jar # build jar file (build/libs/watson-developer-cloud-3.7.1.jar)
$ gradle jar # build jar file (build/libs/watson-developer-cloud-3.7.2.jar)
$ gradle test # run tests
$ gradle check # performs quality checks on source files and generates reports
$ gradle testReport # run tests and generate the aggregated test report (build/reports/allTests)
Expand Down Expand Up @@ -323,4 +323,4 @@ See [CONTRIBUTING.md](.github/CONTRIBUTING.md).
[apache_maven]: http://maven.apache.org/
[sonatype_snapshots]: https://oss.sonatype.org/content/repositories/snapshots/com/ibm/watson/developer_cloud/

[jar]: https://github.com/watson-developer-cloud/java-sdk/releases/download/java-sdk-3.7.1/java-sdk-3.7.1-jar-with-dependencies.jar
[jar]: https://github.com/watson-developer-cloud/java-sdk/releases/download/java-sdk-3.7.2/java-sdk-3.7.2-jar-with-dependencies.jar
4 changes: 2 additions & 2 deletions alchemy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
<dependency>
<groupId>com.ibm.watson.developer_cloud</groupId>
<artifactId>alchemy</artifactId>
<version>3.7.1</version>
<version>3.7.2</version>
</dependency>
```

##### Gradle
```gradle
'com.ibm.watson.developer_cloud:alchemy:3.7.1'
'com.ibm.watson.developer_cloud:alchemy:3.7.2'
```

## Alchemy Language
Expand Down
1 change: 1 addition & 0 deletions alchemy/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ signArchives {

checkstyle {
configFile = rootProject.file('checkstyle.xml')
ignoreFailures = false
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;

import com.ibm.watson.developer_cloud.WatsonServiceTest;
import com.ibm.watson.developer_cloud.alchemy.v1.model.CombinedResults;
Expand All @@ -45,10 +46,12 @@
import com.ibm.watson.developer_cloud.alchemy.v1.model.TypedEntity;
import com.ibm.watson.developer_cloud.alchemy.v1.model.TypedRelation;
import com.ibm.watson.developer_cloud.alchemy.v1.model.TypedRelations;
import com.ibm.watson.developer_cloud.util.RetryRunner;

/**
* Alchemy Language Integration tests.
*/
@RunWith(RetryRunner.class)
public class AlchemyLanguageIT extends WatsonServiceTest {

private static final String testURL =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.junit.Assume;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

import com.ibm.watson.developer_cloud.WatsonServiceTest;
import com.ibm.watson.developer_cloud.alchemy.v1.model.ImageFaces;
Expand All @@ -28,12 +29,14 @@
import com.ibm.watson.developer_cloud.alchemy.v1.model.ImageSceneText;
import com.ibm.watson.developer_cloud.alchemy.v1.model.ImageSceneTextLine;
import com.ibm.watson.developer_cloud.alchemy.v1.model.ImageSceneTextLine.Word;
import com.ibm.watson.developer_cloud.util.RetryRunner;

import okhttp3.HttpUrl;

/**
* The Class AlchemyVisionTest.
*/
@RunWith(RetryRunner.class)
public class AlchemyVisionIT extends WatsonServiceTest {

private static final String IMAGE_OBAMA = "src/test/resources/alchemy/obama.jpg";
Expand Down
19 changes: 18 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@ javadoc {
source = 'src/main/java'
}

checkstyle {
ignoreFailures = false
}

checkstyleMain {
ignoreFailures = false
}

checkstyleTest {
ignoreFailures = false
}


task docs(type: Javadoc) {
destinationDir = file("$buildDir/docs/all")
}
Expand Down Expand Up @@ -45,8 +58,12 @@ allprojects {

subprojects {

checkstyleMain {
ignoreFailures = false
}

checkstyleTest {
ignoreFailures = true
ignoreFailures = false
}

afterEvaluate {
Expand Down
4 changes: 2 additions & 2 deletions conversation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
<dependency>
<groupId>com.ibm.watson.developer_cloud</groupId>
<artifactId>conversation</artifactId>
<version>3.7.1</version>
<version>3.7.2</version>
</dependency>
```

##### Gradle
```gradle
'com.ibm.watson.developer_cloud:conversation:3.7.1'
'com.ibm.watson.developer_cloud:conversation:3.7.2'
```

## Usage
Expand Down
1 change: 1 addition & 0 deletions conversation/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ signArchives {

checkstyle {
configFile = rootProject.file('checkstyle.xml')
ignoreFailures = false
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,18 @@
import org.junit.Assume;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

import com.ibm.watson.developer_cloud.WatsonServiceTest;
import com.ibm.watson.developer_cloud.conversation.v1.model.Intent;
import com.ibm.watson.developer_cloud.conversation.v1.model.MessageRequest;
import com.ibm.watson.developer_cloud.conversation.v1.model.MessageResponse;
import com.ibm.watson.developer_cloud.util.RetryRunner;

/**
* Integration test for the {@link ConversationService}.
*/
@RunWith(RetryRunner.class)
public class ConversationServiceIT extends WatsonServiceTest {

private ConversationService service;
Expand Down
5 changes: 1 addition & 4 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,10 @@ signArchives {
}
}

checkstyleTest {
ignoreFailures = true
}

checkstyle {
configFile = rootProject.file('checkstyle.xml')
ignoreFailures = true
ignoreFailures = false
}

task testJar(type: Jar) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ protected OkHttpClient configureHttpClient() {
.build();

builder.connectionSpecs(Arrays.asList(spec, ConnectionSpec.CLEARTEXT));

return builder.build();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
/*
* Copyright 2017 IBM Corp. All Rights Reserved.
*
* Licensed 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 com.ibm.watson.developer_cloud.util;

import java.util.logging.Logger;

import org.junit.Ignore;
import org.junit.internal.AssumptionViolatedException;
import org.junit.internal.runners.model.EachTestNotifier;
import org.junit.runner.Description;
import org.junit.runner.notification.RunNotifier;
import org.junit.runner.notification.StoppedByUserException;
import org.junit.runners.BlockJUnit4ClassRunner;
import org.junit.runners.model.FrameworkMethod;
import org.junit.runners.model.InitializationError;
import org.junit.runners.model.Statement;

/**
* Junit Runner that retry tests. Useful when tests could fail due to network issues.
*/
public class RetryRunner extends BlockJUnit4ClassRunner {
private static final Logger LOG = Logger.getLogger(RetryRunner.class.getName());

private static final int RETRY_COUNT = 2;

/**
* Instantiates a new retry runner.
*
* @param clazz the class
* @throws InitializationError the initialization error
*/
public RetryRunner(Class<?> clazz) throws InitializationError {
super(clazz);
}

/*
* (non-Javadoc)
*
* @see org.junit.runners.ParentRunner#run(org.junit.runner.notification.RunNotifier)
*/
@Override
public void run(final RunNotifier notifier) {
EachTestNotifier testNotifier = new EachTestNotifier(notifier, getDescription());
Statement statement = classBlock(notifier);
try {
statement.evaluate();
} catch (AssumptionViolatedException ave) {
testNotifier.fireTestIgnored();
} catch (StoppedByUserException sbue) {
throw sbue;
} catch (Throwable t) {
LOG.warning("Retry class: " + getDescription().getDisplayName());
retry(testNotifier, statement, t, getDescription());
}
}

/*
* (non-Javadoc)
*
* @see org.junit.runners.BlockJUnit4ClassRunner#runChild(org.junit.runners.model.FrameworkMethod,
* org.junit.runner.notification.RunNotifier)
*/
@Override
protected void runChild(final FrameworkMethod method, RunNotifier notifier) {
Description description = describeChild(method);
if (method.getAnnotation(Ignore.class) != null) {
notifier.fireTestIgnored(description);
} else {
runTest(methodBlock(method), description, notifier);
}
}

private void runTest(Statement statement, Description description, RunNotifier notifier) {
EachTestNotifier eachNotifier = new EachTestNotifier(notifier, description);
eachNotifier.fireTestStarted();
try {
statement.evaluate();
} catch (AssumptionViolatedException e) {
eachNotifier.addFailedAssumption(e);
} catch (Throwable e) {
LOG.warning("Retry test: " + description.getDisplayName());
retry(eachNotifier, statement, e, description);
} finally {
eachNotifier.fireTestFinished();
}
}

private void retry(EachTestNotifier notifier, Statement statement, Throwable currentThrowable, Description info) {
int failedAttempts = 0;
Throwable caughtThrowable = currentThrowable;
while (RETRY_COUNT > failedAttempts) {
try {
LOG.warning("Retry attempt " + (failedAttempts + 1) + " for " + info.getDisplayName());
statement.evaluate();
return;
} catch (Throwable t) {
failedAttempts++;
caughtThrowable = t;
}
}
notifier.addFailure(caughtThrowable);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@

public class WaitFor {

private WaitFor() {}
private WaitFor() {

}

/**
* Static method used to wait for a specific condition to be satisfied.
Expand Down
4 changes: 1 addition & 3 deletions dialog/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,9 @@ signArchives {
}
}

checkstyleTest {
ignoreFailures = true
}
checkstyle {
configFile = rootProject.file('checkstyle.xml')
ignoreFailures = false
}

task testJar(type: Jar) {
Expand Down
Loading