Skip to content

Commit d85c0fc

Browse files
Merge branch 'dev'
2 parents c2278b1 + a47fa1c commit d85c0fc

File tree

4 files changed

+56
-8
lines changed

4 files changed

+56
-8
lines changed

pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,9 @@
210210
</profile>
211211
</profiles>
212212
<properties>
213+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
213214
<timestamp>${maven.build.timestamp}</timestamp>
214-
<maven.build.timestamp.format>yyyy-MM-dd HH:mm</maven.build.timestamp.format>
215+
<maven.build.timestamp.format>yyyy-MM-dd HH:mm:ssa</maven.build.timestamp.format>
215216
</properties>
216217
<artifactId>java-wrapper</artifactId>
217218
<issueManagement>

src/main/java/com/ibm/watson/developer_cloud/tradeoff_analytics/v1/TradeoffAnalytics.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public Dilemma dilemmas(final Problem problem,final Boolean generateVisualizatio
7777
try {
7878
HttpResponse response = execute(request.build());
7979
String dilemmaJson = ResponseUtil.getString(response);
80-
System.out.println(dilemmaJson);
80+
8181
Dilemma dilemma = GsonSingleton.getGson().fromJson(dilemmaJson, Dilemma.class);
8282
return dilemma;
8383
} catch (IOException e) {

src/test/java/com/ibm/watson/developer_cloud/WatsonServiceTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,12 @@ private void setupLogging() {
9292
java.util.logging.Logger.getLogger("org.apache.http.wire").setLevel(java.util.logging.Level.FINEST);
9393
java.util.logging.Logger.getLogger("org.apache.http.headers").setLevel(java.util.logging.Level.FINEST);
9494

95-
System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog");
96-
System.setProperty("org.apache.commons.logging.simplelog.showdatetime", "true");
97-
System.setProperty("org.apache.commons.logging.simplelog.log.httpclient.wire", "debug");
98-
System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.http", "debug");
99-
System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.http.impl.conn", "debug");
100-
System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.http.impl.client", "debug");
95+
// System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog");
96+
// System.setProperty("org.apache.commons.logging.simplelog.showdatetime", "true");
97+
// System.setProperty("org.apache.commons.logging.simplelog.log.httpclient.wire", "debug");
98+
// System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.http", "debug");
99+
// System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.http.impl.conn", "debug");
100+
// System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.http.impl.client", "debug");
101101
}
102102

103103
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/**
2+
* Copyright 2015 IBM Corp. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.ibm.watson.developer_cloud.tradeoff_analytics.v1;
17+
18+
import java.io.InputStream;
19+
20+
import org.junit.Assert;
21+
import org.junit.Test;
22+
23+
import com.ibm.watson.developer_cloud.WatsonServiceTest;
24+
import com.ibm.watson.developer_cloud.tradeoff_analytics.v1.model.Problem;
25+
import com.ibm.watson.developer_cloud.util.GsonSingleton;
26+
27+
/**
28+
* The Class TradeoffAnalyticsTest.
29+
*/
30+
public class ProblemTest {
31+
32+
/**
33+
* Test convert problem to json and vise versa
34+
*/
35+
@Test
36+
public void testJsonProblem() {
37+
InputStream in = this.getClass().getClassLoader().getResourceAsStream("problem.json");
38+
String problemJson = WatsonServiceTest.getStringFromInputStream(in);
39+
Problem problem = GsonSingleton.getGson().fromJson(problemJson, Problem.class);
40+
Assert.assertNotNull(problem.getSubject());
41+
Assert.assertNotNull(problem.getColumns());
42+
Assert.assertNotNull(problem.getOptions());
43+
Assert.assertNotNull(problem.getColumns().get(0));
44+
Assert.assertNotNull(problem.getOptions().get(0));
45+
}
46+
47+
}

0 commit comments

Comments
 (0)