test_java_application.py (1355:20971df0d346) test_java_application.py (1453:71af60a59338)
1import io
2import os
3import time
4import unittest
5from unit.applications.lang.java import TestApplicationJava
6
7
8class TestJavaApplication(TestApplicationJava):

--- 1071 unchanged lines hidden (view full) ---

1080
1081 self.assertEqual(self.get()['status'], 200, 'empty')
1082
1083 def test_java_application_keepalive_body(self):
1084 self.load('mirror')
1085
1086 self.assertEqual(self.post()['status'], 200, 'init')
1087
1import io
2import os
3import time
4import unittest
5from unit.applications.lang.java import TestApplicationJava
6
7
8class TestJavaApplication(TestApplicationJava):

--- 1071 unchanged lines hidden (view full) ---

1080
1081 self.assertEqual(self.get()['status'], 200, 'empty')
1082
1083 def test_java_application_keepalive_body(self):
1084 self.load('mirror')
1085
1086 self.assertEqual(self.post()['status'], 200, 'init')
1087
1088 body = '0123456789' * 500
1088 (resp, sock) = self.post(
1089 headers={
1090 'Connection': 'keep-alive',
1091 'Content-Type': 'text/html',
1092 'Host': 'localhost',
1093 },
1094 start=True,
1089 (resp, sock) = self.post(
1090 headers={
1091 'Connection': 'keep-alive',
1092 'Content-Type': 'text/html',
1093 'Host': 'localhost',
1094 },
1095 start=True,
1095 body='0123456789' * 500,
1096 body=body,
1096 read_timeout=1,
1097 )
1098
1097 read_timeout=1,
1098 )
1099
1099 self.assertEqual(resp['body'], '0123456789' * 500, 'keep-alive 1')
1100 self.assertEqual(resp['body'], body, 'keep-alive 1')
1100
1101
1102 body = '0123456789'
1101 resp = self.post(
1102 headers={
1103 'Connection': 'close',
1104 'Content-Type': 'text/html',
1105 'Host': 'localhost',
1106 },
1107 sock=sock,
1103 resp = self.post(
1104 headers={
1105 'Connection': 'close',
1106 'Content-Type': 'text/html',
1107 'Host': 'localhost',
1108 },
1109 sock=sock,
1108 body='0123456789',
1110 body=body,
1109 )
1110
1111 )
1112
1111 self.assertEqual(resp['body'], '0123456789', 'keep-alive 2')
1113 self.assertEqual(resp['body'], body, 'keep-alive 2')
1112
1113 def test_java_application_http_10(self):
1114 self.load('empty')
1115
1116 self.assertEqual(self.get(http_10=True)['status'], 200, 'HTTP 1.0')
1117
1118 def test_java_application_no_method(self):
1119 self.load('empty')

--- 145 unchanged lines hidden ---
1114
1115 def test_java_application_http_10(self):
1116 self.load('empty')
1117
1118 self.assertEqual(self.get(http_10=True)['status'], 200, 'HTTP 1.0')
1119
1120 def test_java_application_no_method(self):
1121 self.load('empty')

--- 145 unchanged lines hidden ---