Skip to content

Commit 9da4d63

Browse files
authored
Merge branch 'master' into feature-asoc
2 parents 5fbb307 + 8458e10 commit 9da4d63

File tree

29 files changed

+112
-96
lines changed

29 files changed

+112
-96
lines changed

.releaserc

Lines changed: 0 additions & 20 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@ env:
2626

2727
before_install:
2828
- sed -i.bak -e 's|https://nexus.codehaus.org/snapshots/|https://oss.sonatype.org/content/repositories/codehaus-snapshots/|g' ~/.m2/settings.xml
29-
- sudo apt-get update
30-
- sudo apt-get install python
31-
- npm install npm@latest -g
32-
- nvm install node
33-
- nvm use node
3429
# Work around missing crypto in openjdk7
3530
- |
3631
if [ "$TRAVIS_JDK_VERSION" == "openjdk7" ]; then
@@ -40,9 +35,6 @@ before_install:
4035
fi
4136
4237
install:
43-
- pip install --user bumpversion
44-
- npm install [email protected]
45-
- npm install @semantic-release/exec
4638
- 'if [ "${TRAVIS_TAG}" = "${TRAVIS_BRANCH}" ]; then cd appscan; make asoc-tool; cd ../; fi'
4739

4840
before_script:

.utility/generate-api-diff.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ mvn dependency:get \
1818
LOCAL_MAVEN_REPO_PATH="${HOME}/.m2/repository"
1919
RELEASE_JAR_BASEPATH="${LOCAL_MAVEN_REPO_PATH}/com/ibm/watson/developer_cloud/java-sdk"
2020
pushd $RELEASE_JAR_BASEPATH
21-
LATEST_RELEASE_VERSION=`ls | grep -d read "[0-9]\.[0-9]\.[0-9]" | sort | tail -n 1`
21+
LATEST_RELEASE_VERSION=$(ls | grep -d read "[0-9]\.[0-9]\.[0-9]" | sort | tail -n 1)
2222
LATEST_RELEASE_JAR_FILENAME="java-sdk-${LATEST_RELEASE_VERSION}-jar-with-dependencies.jar"
2323
LATEST_RELEASE_JAR_PATH="${RELEASE_JAR_BASEPATH}/${LATEST_RELEASE_VERSION}/${LATEST_RELEASE_JAR_FILENAME}"
2424

@@ -34,7 +34,7 @@ popd
3434
./gradlew shadowJar
3535

3636
# Step 5: Construct the filepath to the current version of java-sdk.
37-
CURRENT_VERSION=`cat ../gradle.properties | grep "version=[0-9]\.[0-9]\.[0-9]" | cut -d '=' -f 2`
37+
CURRENT_VERSION=$(< ../gradle.properties grep "version=[0-9]\.[0-9]\.[0-9]" | cut -d '=' -f 2)
3838
CURRENT_JAR_FILENAME="java-sdk-${CURRENT_VERSION}-jar-with-dependencies.jar"
3939
CURRENT_JAR_BASEPATH="java-sdk/build/libs"
4040
CURRENT_JAR_PATH="${CURRENT_JAR_BASEPATH}/${CURRENT_JAR_FILENAME}"

assistant/src/test/java/com/ibm/watson/developer_cloud/assistant/v1/AssistantServiceIT.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,10 @@
102102
public class AssistantServiceIT extends AssistantServiceTest {
103103

104104
private String exampleIntent;
105+
private Assistant service = getService();
106+
private String workspaceId = getWorkspaceId();
105107

106-
DateFormat isoDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSX");
108+
private DateFormat isoDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSX");
107109

108110
/**
109111
* Test README.
@@ -430,7 +432,8 @@ public void testListCounterexamplesWithPaging() {
430432
assertNotNull(response.getPagination().getNextUrl());
431433
assertNotNull(response.getPagination().getNextCursor());
432434

433-
boolean found1 = false, found2 = false;
435+
boolean found1 = false;
436+
boolean found2 = false;
434437
while (true) {
435438
assertNotNull(response.getCounterexamples());
436439
assertTrue(response.getCounterexamples().size() == 1);
@@ -691,7 +694,8 @@ public void testListExamplesWithPaging() {
691694
assertNotNull(response.getPagination().getNextUrl());
692695
assertNotNull(response.getPagination().getNextCursor());
693696

694-
boolean found1 = false, found2 = false;
697+
boolean found1 = false;
698+
boolean found2 = false;
695699
while (true) {
696700
assertNotNull(response.getExamples());
697701
assertTrue(response.getExamples().size() == 1);
@@ -993,7 +997,8 @@ public void testListIntentsWithPaging() {
993997
assertNotNull(response.getPagination().getNextUrl());
994998
assertNotNull(response.getPagination().getNextCursor());
995999

996-
boolean found1 = false, found2 = false;
1000+
boolean found1 = false;
1001+
boolean found2 = false;
9971002
while (true) {
9981003
assertNotNull(response.getIntents());
9991004
assertTrue(response.getIntents().size() == 1);
@@ -1106,7 +1111,6 @@ public void testCreateWorkspace() {
11061111
List<CreateEntity> workspaceEntities = new ArrayList<CreateEntity>();
11071112
String entityName = "Hello" + UUID.randomUUID().toString(); // gotta be unique
11081113
String entityDescription = "Description of " + entityName;
1109-
String entitySource = "Source for " + entityName;
11101114
String entityValue = "Value of " + entityName;
11111115
String entityValueSynonym = "Synonym for Value of " + entityName;
11121116
List<CreateValue> entityValues = new ArrayList<CreateValue>();

assistant/src/test/java/com/ibm/watson/developer_cloud/assistant/v1/AssistantServiceTest.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,16 @@
2020

2121
public class AssistantServiceTest extends WatsonServiceTest {
2222

23-
Assistant service;
24-
String workspaceId;
23+
private Assistant service;
24+
private String workspaceId;
25+
26+
public Assistant getService() {
27+
return this.service;
28+
}
29+
30+
public String getWorkspaceId() {
31+
return this.workspaceId;
32+
}
2533

2634
/*
2735
* (non-Javadoc)
@@ -44,7 +52,7 @@ public void setUp() throws Exception {
4452
service.setDefaultHeaders(getDefaultHeaders());
4553
}
4654

47-
long tolerance = 2000; // 2 secs in ms
55+
private long tolerance = 2000; // 2 secs in ms
4856

4957
/**
5058
* return `true` if ldate before rdate within tolerance.

assistant/src/test/java/com/ibm/watson/developer_cloud/assistant/v1/EntitiesIT.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@
4444
@RunWith(RetryRunner.class)
4545
public class EntitiesIT extends AssistantServiceTest {
4646

47+
private Assistant service = getService();
48+
private String workspaceId = getWorkspaceId();
49+
4750
/**
4851
* Test createEntity.
4952
*/

assistant/src/test/java/com/ibm/watson/developer_cloud/assistant/v1/SynonymsIT.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
@RunWith(RetryRunner.class)
3838
public class SynonymsIT extends AssistantServiceTest {
3939

40+
private Assistant service = getService();
41+
private String workspaceId = getWorkspaceId();
42+
4043
/**
4144
* Test createSynonym.
4245
*/
@@ -262,7 +265,8 @@ public void testListSynonyms() {
262265
// Should not be paginated, but just to be sure
263266
if (response.getPagination().getNextUrl() == null) {
264267
//assertTrue(response.getSynonyms().stream().filter(r -> r.getSynonym().equals(synonym1)).count() == 1);
265-
boolean found1 = false, found2 = false;
268+
boolean found1 = false;
269+
boolean found2 = false;
266270
for (Synonym synonymResponse : response.getSynonyms()) {
267271
found1 |= synonymResponse.getSynonymText().equals(synonym1);
268272
found2 |= synonymResponse.getSynonymText().equals(synonym2);

assistant/src/test/java/com/ibm/watson/developer_cloud/assistant/v1/ValuesIT.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@
4242
@RunWith(RetryRunner.class)
4343
public class ValuesIT extends AssistantServiceTest {
4444

45+
private Assistant service = getService();
46+
private String workspaceId = getWorkspaceId();
47+
4548
/**
4649
* Test createValue.
4750
*/
@@ -252,7 +255,8 @@ public void testListValues() {
252255
// Should not be paginated, but just to be sure
253256
if (response.getPagination().getNextUrl() == null) {
254257
//assertTrue(response.getValues().stream().filter(r -> r.getValue().equals(synonym1)).count() == 1);
255-
boolean found1 = false, found2 = false;
258+
boolean found1 = false;
259+
boolean found2 = false;
256260
for (ValueExport valueResponse : response.getValues()) {
257261
found1 |= valueResponse.getValueText().equals(entityValue1);
258262
found2 |= valueResponse.getValueText().equals(entityValue2);
@@ -315,7 +319,8 @@ public void testListValuesWithPaging() {
315319
assertNotNull(response.getPagination().getNextUrl());
316320
assertNotNull(response.getPagination().getNextCursor());
317321

318-
boolean found1 = false, found2 = false;
322+
boolean found1 = false;
323+
boolean found2 = false;
319324
while (true) {
320325
assertNotNull(response.getValues());
321326
assertTrue(response.getValues().size() == 1);

conversation/src/test/java/com/ibm/watson/developer_cloud/conversation/v1/ConversationServiceIT.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,10 @@
102102
public class ConversationServiceIT extends ConversationServiceTest {
103103

104104
private String exampleIntent;
105+
private Conversation service = getService();
106+
private String workspaceId = getWorkspaceId();
105107

106-
DateFormat isoDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSX");
108+
private DateFormat isoDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSX");
107109

108110
/**
109111
* Test README.
@@ -436,7 +438,8 @@ public void testListCounterexamplesWithPaging() {
436438
assertNotNull(response.getPagination().getNextUrl());
437439
assertNotNull(response.getPagination().getNextCursor());
438440

439-
boolean found1 = false, found2 = false;
441+
boolean found1 = false;
442+
boolean found2 = false;
440443
while (true) {
441444
assertNotNull(response.getCounterexamples());
442445
assertTrue(response.getCounterexamples().size() == 1);
@@ -697,7 +700,8 @@ public void testListExamplesWithPaging() {
697700
assertNotNull(response.getPagination().getNextUrl());
698701
assertNotNull(response.getPagination().getNextCursor());
699702

700-
boolean found1 = false, found2 = false;
703+
boolean found1 = false;
704+
boolean found2 = false;
701705
while (true) {
702706
assertNotNull(response.getExamples());
703707
assertTrue(response.getExamples().size() == 1);
@@ -999,7 +1003,8 @@ public void testListIntentsWithPaging() {
9991003
assertNotNull(response.getPagination().getNextUrl());
10001004
assertNotNull(response.getPagination().getNextCursor());
10011005

1002-
boolean found1 = false, found2 = false;
1006+
boolean found1 = false;
1007+
boolean found2 = false;
10031008
while (true) {
10041009
assertNotNull(response.getIntents());
10051010
assertTrue(response.getIntents().size() == 1);
@@ -1112,7 +1117,6 @@ public void testCreateWorkspace() {
11121117
List<CreateEntity> workspaceEntities = new ArrayList<CreateEntity>();
11131118
String entityName = "Hello" + UUID.randomUUID().toString(); // gotta be unique
11141119
String entityDescription = "Description of " + entityName;
1115-
String entitySource = "Source for " + entityName;
11161120
String entityValue = "Value of " + entityName;
11171121
String entityValueSynonym = "Synonym for Value of " + entityName;
11181122
List<CreateValue> entityValues = new ArrayList<CreateValue>();
@@ -1665,7 +1669,8 @@ public void testListDialogNodesWithPaging() {
16651669
assertNotNull(response.getPagination().getNextUrl());
16661670
assertNotNull(response.getPagination().getNextCursor());
16671671

1668-
boolean found1 = false, found2 = false;
1672+
boolean found1 = false;
1673+
boolean found2 = false;
16691674
while (true) {
16701675
assertNotNull(response.getDialogNodes());
16711676
assertTrue(response.getDialogNodes().size() == 1);

conversation/src/test/java/com/ibm/watson/developer_cloud/conversation/v1/ConversationServiceTest.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,15 @@
2121

2222
public class ConversationServiceTest extends WatsonServiceTest {
2323

24-
Conversation service;
25-
String workspaceId;
24+
private Conversation service;
25+
private String workspaceId;
26+
27+
public Conversation getService() {
28+
return this.service;
29+
}
30+
public String getWorkspaceId() {
31+
return this.workspaceId;
32+
}
2633

2734
/*
2835
* (non-Javadoc)
@@ -45,7 +52,7 @@ public void setUp() throws Exception {
4552
service.setDefaultHeaders(getDefaultHeaders());
4653
}
4754

48-
long tolerance = 2000; // 2 secs in ms
55+
private long tolerance = 2000; // 2 secs in ms
4956

5057
/**
5158
* return `true` if ldate before rdate within tolerance.

0 commit comments

Comments
 (0)