Skip to content

Commit ff7dbbb

Browse files
authored
Merge pull request #44 from IBMStreams/develop
Develop
2 parents f31cc3d + 933c083 commit ff7dbbb

File tree

10 files changed

+22
-15
lines changed

10 files changed

+22
-15
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,7 @@
4444
## v4.3.0
4545
* Enhancement: New parameter 'sslAppConfigName' to get the SSL server key/certificate and the client trust material from Streams application configuration with this name
4646

47+
## v4.3.1
48+
* Fix: Use relative path in all sample index.html files to be able to be used behind proxy
49+
* Fix: Correct timing issue in junit tests
50+

com.ibm.streamsx.inetserver/impl/java/src/com/ibm/streamsx/inet/rest/servlets/InjectForm.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ public void doGet(HttpServletRequest request, HttpServletResponse response)
4343
out.println("</head>");
4444
out.println("<body>");
4545
out.println("<H1>" + port.getName() + "</H1>");
46-
String action = request.getRequestURI().replace("form", "inject");
47-
out.println("<FORM METHOD=POST ACTION=\"" + action + "\">");
46+
out.println("<FORM METHOD=POST ACTION=\"inject\">");
4847
for (Attribute attr : port.getStreamSchema()) {
4948
out.print(attr.getName());
5049
out.println(": <input type=text size=30 value=\"\" name=" + attr.getName() + "><br/>");

com.ibm.streamsx.inetserver/info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This toolkit separates its functionality into a number of namespaces:
1414
* [namespace:com.ibm.streamsx.inet.wsserver|com.ibm.streamsx.inet.wsserver]: Operators that embed a (jetty) WebSocket server to expose streaming data as WebSocket messages.
1515

1616
</description>
17-
<version>4.3.0</version>
17+
<version>4.3.1</version>
1818
<requiredProductVersion>4.0.1.0</requiredProductVersion>
1919
</identity>
2020
<dependencies/>

samples/HTTPTupleInjectAndView/opt/html/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ <h2>Information About All Exposed Contexts (JSON)</h2>
1010
<a href="contexts/info">contexts/info</a>
1111
<h2>Further static contextes</h2>
1212
<h3>Static Context from WebContext operator</h3>
13-
<a href="/wct">/wct</a>
13+
<a href="wct">wct</a>
1414
<h3>Static Context HTTPTupleView operator</h3>
15-
<a href="/state">/state</a>
15+
<a href="state">state</a>
1616
<h3>Inet Resources</h3>
17-
<a href="/streamsx.inet.resources">/streamsx.inet.resources</a>
17+
<a href="streamsx.inet.resources">streamsx.inet.resources</a>
1818
<h3>Dojo</h3>
19-
<a href="/streamsx.inet.dojo">/streamsx.inet.dojo</a>
19+
<a href="streamsx.inet.dojo">streamsx.inet.dojo</a>
2020
</body>

samples/RequestProcessTuple/application/DynaTuple.spl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use com.ibm.streamsx.inet.rest::HTTPRequest ;
1616
*
1717
* The goal:
1818
* * Demonstrate the processing of forms.
19-
* * Reinterate how important it is NOT to mess with the id.
19+
* * Reiterate how important it is NOT to mess with the id.
2020
*
2121
* Procedure:
2222
* * build the sample - execute 'make'

samples/RequestProcessTuple/opt/html/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<meta charset='utf-8'>
44
<b3>Input form test for Streams</h3>
55
<p>Input a use name and password to be judged by streams.</p>
6-
<form action="/livepage/HttpTuple/ports/analyze/0/login" method="post" >
6+
<form action="HttpTuple/ports/analyze/0/login" method="post" >
77
User: <input type="text" name="name"><br>
88
Profession: <input type="text" name="profession"><br>
99
Pass: <input type="text" name="password"><br>

tests/junit/src/com/ibm/streamsx/inet/rest/test/InjectBLOBTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ public void _testBigInject(int nk) throws Exception {
218218
}
219219
}
220220

221-
private static void postBLOBAndTest(URL postTuple, byte[] data, MostRecent<Tuple> mrt, boolean checkHeaderAttrib) throws IOException {
221+
private static void postBLOBAndTest(URL postTuple, byte[] data, MostRecent<Tuple> mrt, boolean checkHeaderAttrib) throws IOException, InterruptedException {
222222
System.out.println(postTuple.toString());
223223
HttpURLConnection conn = (HttpURLConnection) postTuple.openConnection();
224224
conn.setDoOutput(true);
@@ -231,7 +231,7 @@ private static void postBLOBAndTest(URL postTuple, byte[] data, MostRecent<Tuple
231231
System.out.println(conn.getResponseMessage());
232232
assertEquals(HttpURLConnection.HTTP_NO_CONTENT, conn.getResponseCode());
233233
conn.disconnect();
234-
234+
Thread.sleep(1000);
235235
Blob tuple = mrt.getMostRecentTuple().getBlob(0);
236236
System.out.println(tuple.toString());
237237
assertTrue(Arrays.equals(data, tuple.getData()));

tests/junit/src/com/ibm/streamsx/inet/rest/test/InjectFormTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ public void testInjectSinglePort() throws Exception {
5656
System.out.println(conn.getResponseMessage());
5757
assertEquals(HttpURLConnection.HTTP_NO_CONTENT, conn.getResponseCode());
5858
conn.disconnect();
59+
Thread.sleep(1000);
5960
System.out.println(mrt.getMostRecentTuple().toString());
6061
assertEquals(0, mrt.getMostRecentTuple().getInt(0));
6162
assertEquals("", mrt.getMostRecentTuple().getString(1));
@@ -77,6 +78,7 @@ public void testInjectSinglePort() throws Exception {
7778
System.out.println(conn.getResponseMessage());
7879
assertEquals(HttpURLConnection.HTTP_NO_CONTENT, conn.getResponseCode());
7980
conn.disconnect();
81+
Thread.sleep(1000);
8082
System.out.println(mrt.getMostRecentTuple().toString());
8183
assertEquals(0, mrt.getMostRecentTuple().getInt(0));
8284
assertEquals(quote, mrt.getMostRecentTuple().getString(1));
@@ -97,6 +99,7 @@ public void testInjectSinglePort() throws Exception {
9799
System.out.println(conn.getResponseMessage());
98100
assertEquals(HttpURLConnection.HTTP_NO_CONTENT, conn.getResponseCode());
99101
conn.disconnect();
102+
Thread.sleep(1000);
100103
System.out.println(mrt.getMostRecentTuple().toString());
101104
assertEquals(73, mrt.getMostRecentTuple().getInt(0));
102105
assertEquals(quote, mrt.getMostRecentTuple().getString(1));

tests/junit/src/com/ibm/streamsx/inet/rest/test/InjectJSONTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
import java.io.IOException;
1313
import java.io.OutputStream;
14+
import java.io.UnsupportedEncodingException;
1415
import java.net.HttpURLConnection;
1516
import java.net.URL;
1617
import java.util.Random;
@@ -187,7 +188,7 @@ public void _testBigInject(int nk) throws Exception {
187188
}
188189
}
189190

190-
private static void postJSONAndTest(URL postTuple, JSONObject json, MostRecent<Tuple> mrt) throws IOException {
191+
private static void postJSONAndTest(URL postTuple, JSONObject json, MostRecent<Tuple> mrt) throws UnsupportedEncodingException, IOException, InterruptedException {
191192
System.out.println(postTuple.toString());
192193
byte[] dataBytes = json.serialize().getBytes("UTF-8");
193194
HttpURLConnection conn = (HttpURLConnection) postTuple.openConnection();
@@ -201,7 +202,7 @@ private static void postJSONAndTest(URL postTuple, JSONObject json, MostRecent<T
201202
System.out.println(conn.getResponseMessage());
202203
assertEquals(HttpURLConnection.HTTP_NO_CONTENT, conn.getResponseCode());
203204
conn.disconnect();
204-
205+
Thread.sleep(1000);
205206
JSONObject tuple = JSONObject.parse(mrt.getMostRecentTuple().getString(0));
206207
System.out.println(tuple.toString());
207208
assertEquals(json, tuple);

tests/junit/src/com/ibm/streamsx/inet/rest/test/InjectXMLTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ public void _testBigInject(int nk) throws Exception {
186186
}
187187
}
188188

189-
private static void postXMLAndTest(URL postTuple, String xml, MostRecent<Tuple> mrt) throws IOException {
189+
private static void postXMLAndTest(URL postTuple, String xml, MostRecent<Tuple> mrt) throws IOException, InterruptedException {
190190
System.out.println(postTuple.toString());
191191
byte[] dataBytes = xml.getBytes("UTF-8");
192192
HttpURLConnection conn = (HttpURLConnection) postTuple.openConnection();
@@ -200,7 +200,7 @@ private static void postXMLAndTest(URL postTuple, String xml, MostRecent<Tuple>
200200
System.out.println(conn.getResponseMessage());
201201
assertEquals(HttpURLConnection.HTTP_NO_CONTENT, conn.getResponseCode());
202202
conn.disconnect();
203-
203+
Thread.sleep(1000);
204204
String tuple = mrt.getMostRecentTuple().getString(0);
205205
System.out.println(tuple.toString());
206206
assertEquals(xml, tuple);

0 commit comments

Comments
 (0)