lazylead 0.5.2 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lazylead.gemspec +3 -2
- data/lib/lazylead/opts.rb +1 -0
- data/lib/lazylead/postman.rb +4 -3
- data/lib/lazylead/system/jira.rb +21 -4
- data/lib/lazylead/task/accuracy/accuracy.rb +1 -1
- data/lib/lazylead/task/accuracy/logs.rb +5 -3
- data/lib/lazylead/task/accuracy/servers.rb +1 -1
- data/lib/lazylead/task/accuracy/stacktrace.rb +50 -10
- data/lib/lazylead/task/accuracy/testcase.rb +12 -6
- data/lib/lazylead/task/assignment.rb +96 -0
- data/lib/lazylead/task/fix_version.rb +4 -0
- data/lib/lazylead/task/svn/diff.rb +76 -0
- data/lib/lazylead/task/svn/grep.rb +111 -0
- data/lib/lazylead/task/svn/touch.rb +101 -0
- data/lib/lazylead/version.rb +1 -1
- data/lib/messages/illegal_assignee_change.erb +123 -0
- data/lib/messages/illegal_fixversion_change.erb +2 -0
- data/lib/messages/svn_diff.erb +110 -0
- data/lib/messages/{svn_log.erb → svn_diff_attachment.erb} +0 -0
- data/lib/messages/svn_grep.erb +114 -0
- data/test/lazylead/system/jira_test.rb +6 -7
- data/test/lazylead/task/accuracy/logs_test.rb +62 -2
- data/test/lazylead/task/accuracy/stacktrace_test.rb +227 -0
- data/test/lazylead/task/accuracy/testcase_test.rb +10 -0
- data/test/lazylead/task/assignment_test.rb +53 -0
- data/test/lazylead/task/svn/diff_test.rb +97 -0
- data/test/lazylead/task/svn/grep_test.rb +61 -0
- data/test/lazylead/task/{touch_test.rb → svn/touch_test.rb} +7 -34
- metadata +33 -7
- data/lib/lazylead/task/touch.rb +0 -119
File without changes
|
@@ -0,0 +1,114 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<style>
|
5
|
+
/* CSS styles taken from https://github.com/yegor256/tacit */
|
6
|
+
pre, code, kbd, samp, var, output {
|
7
|
+
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
|
8
|
+
font-size: 14.4px
|
9
|
+
}
|
10
|
+
|
11
|
+
pre code {
|
12
|
+
background: none;
|
13
|
+
border: 0;
|
14
|
+
line-height: 29.7px;
|
15
|
+
padding: 0
|
16
|
+
}
|
17
|
+
|
18
|
+
code, kbd {
|
19
|
+
background: #daf1e0;
|
20
|
+
border-radius: 3.6px;
|
21
|
+
color: #2a6f3b;
|
22
|
+
display: inline-block;
|
23
|
+
line-height: 18px;
|
24
|
+
padding: 3.6px 6.3px 2.7px
|
25
|
+
}
|
26
|
+
|
27
|
+
a {
|
28
|
+
color: #275a90;
|
29
|
+
text-decoration: none
|
30
|
+
}
|
31
|
+
|
32
|
+
a:hover {
|
33
|
+
text-decoration: underline
|
34
|
+
}
|
35
|
+
|
36
|
+
* {
|
37
|
+
border: 0;
|
38
|
+
border-collapse: separate;
|
39
|
+
border-spacing: 0;
|
40
|
+
box-sizing: border-box;
|
41
|
+
margin: 0;
|
42
|
+
max-width: 100%;
|
43
|
+
padding: 0;
|
44
|
+
vertical-align: baseline;
|
45
|
+
font-family: system-ui, "Helvetica Neue", Helvetica, Arial, sans-serif;
|
46
|
+
font-size: 13px;
|
47
|
+
font-stretch: normal;
|
48
|
+
font-style: normal;
|
49
|
+
font-weight: 400;
|
50
|
+
line-height: 29.7px
|
51
|
+
}
|
52
|
+
|
53
|
+
html, body {
|
54
|
+
width: 100%
|
55
|
+
}
|
56
|
+
|
57
|
+
html {
|
58
|
+
height: 100%
|
59
|
+
}
|
60
|
+
|
61
|
+
body {
|
62
|
+
background: #fff;
|
63
|
+
color: #1a1919;
|
64
|
+
padding: 36px
|
65
|
+
}
|
66
|
+
|
67
|
+
.commit {
|
68
|
+
min-width: 100%;
|
69
|
+
border-radius: 3.5px;
|
70
|
+
overflow: hidden;
|
71
|
+
display: inline-block;
|
72
|
+
line-height: 15px;
|
73
|
+
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
|
74
|
+
border: 1px solid #BCC6CC;
|
75
|
+
}
|
76
|
+
|
77
|
+
.commit * {
|
78
|
+
padding-left: 4px;
|
79
|
+
font-size: 8px;
|
80
|
+
line-height: 15px;
|
81
|
+
}
|
82
|
+
</style>
|
83
|
+
<title>SVN log</title>
|
84
|
+
</head>
|
85
|
+
<body>
|
86
|
+
<p>Hi,</p>
|
87
|
+
<p>The following file(s) contain text <code><%= text %></code> in
|
88
|
+
<a href="<%= svn_url %>"><%= svn_url %></a>:</p>
|
89
|
+
<% entries.each do |commit| %>
|
90
|
+
<div class="commit">
|
91
|
+
<p style="background: gainsboro;">
|
92
|
+
<a href="<%= commit_url %><%= commit.rev %>"><%= commit.msg %></a>
|
93
|
+
by <a href="<%= user %><%= commit.author %>"><%= commit.author %></a>
|
94
|
+
at <span style="color: #275a90;"><%= commit.time %></span>
|
95
|
+
</p>
|
96
|
+
<% commit.lines[2..-1].each do |line| %>
|
97
|
+
<% if line.start_with?("+++") || line.start_with?("---") %>
|
98
|
+
<p style="background: gainsboro;"><%= line.gsub(/[<>]/, '<' => '<', '>' => '>') %></p>
|
99
|
+
<% elsif text.split(",").any? { |t| line.include? t } %>
|
100
|
+
<p style="background: #F9F103;"><%= line.gsub(/[<>]/, '<' => '<', '>' => '>') %></p>
|
101
|
+
<% elsif line.start_with?("+") %>
|
102
|
+
<p style="<%= "background: darkseagreen;" %>"><%= line.gsub(/[<>]/, '<' => '<', '>' => '>') %></p>
|
103
|
+
<% elsif line.start_with?("-") %>
|
104
|
+
<p style="<%= "background: lightsalmon;" %>"><%= line.gsub(/[<>]/, '<' => '<', '>' => '>') %></p>
|
105
|
+
<% else %>
|
106
|
+
<p style="background: gainsboro;"><%= line.gsub(/[<>]/, '<' => '<', '>' => '>') %></p>
|
107
|
+
<% end %>
|
108
|
+
<% end %>
|
109
|
+
</div>
|
110
|
+
<% end %>
|
111
|
+
<p>Posted by<a href="https://github.com/dgroup/lazylead">lazylead
|
112
|
+
v<%= version %></a>.</p>
|
113
|
+
</body>
|
114
|
+
</html>
|
@@ -142,13 +142,6 @@ module Lazylead
|
|
142
142
|
assert_equal "Hi there!", issue.comment[:body]
|
143
143
|
end
|
144
144
|
|
145
|
-
test "search by limit in 1 issue" do
|
146
|
-
assert_equal 1,
|
147
|
-
NoAuthJira.new("https://jira.spring.io")
|
148
|
-
.issues("key in (DATAJDBC-480, DATAJDBC-500)", max_results: "1")
|
149
|
-
.size
|
150
|
-
end
|
151
|
-
|
152
145
|
test "description is correct" do
|
153
146
|
assert_words %w[DATACMNS-1639\ moved\ entity\ instantiators],
|
154
147
|
NoAuthJira.new("https://jira.spring.io")
|
@@ -186,5 +179,11 @@ module Lazylead
|
|
186
179
|
.labels,
|
187
180
|
"Spring"
|
188
181
|
end
|
182
|
+
|
183
|
+
test "bulk search in few iterations" do
|
184
|
+
assert NoAuthJira.new("https://jira.spring.io")
|
185
|
+
.issues("key>DATAJDBC-500")
|
186
|
+
.size >= 118
|
187
|
+
end
|
189
188
|
end
|
190
189
|
end
|
@@ -63,12 +63,72 @@ module Lazylead
|
|
63
63
|
)
|
64
64
|
end
|
65
65
|
|
66
|
-
test "log file size less than
|
66
|
+
test "log file size less than 5KB" do
|
67
67
|
refute Logs.new.passed(
|
68
68
|
OpenStruct.new(
|
69
69
|
attachments: [
|
70
70
|
OpenStruct.new(
|
71
|
-
attrs: { "size" =>
|
71
|
+
attrs: { "size" => 5000, "filename" => "catalina.log" }
|
72
|
+
)
|
73
|
+
]
|
74
|
+
)
|
75
|
+
)
|
76
|
+
end
|
77
|
+
|
78
|
+
test "rotated log file is present" do
|
79
|
+
assert Logs.new.passed(
|
80
|
+
OpenStruct.new(
|
81
|
+
attachments: [
|
82
|
+
OpenStruct.new(
|
83
|
+
attrs: { "size" => 10_241, "filename" => "catalina.log111" }
|
84
|
+
)
|
85
|
+
]
|
86
|
+
)
|
87
|
+
)
|
88
|
+
end
|
89
|
+
|
90
|
+
test "log txt file is present" do
|
91
|
+
assert Logs.new.passed(
|
92
|
+
OpenStruct.new(
|
93
|
+
attachments: [
|
94
|
+
OpenStruct.new(
|
95
|
+
attrs: { "size" => 10_241, "filename" => "catalina.txt" }
|
96
|
+
)
|
97
|
+
]
|
98
|
+
)
|
99
|
+
)
|
100
|
+
end
|
101
|
+
|
102
|
+
test "zip log file is present" do
|
103
|
+
assert Logs.new.passed(
|
104
|
+
OpenStruct.new(
|
105
|
+
attachments: [
|
106
|
+
OpenStruct.new(
|
107
|
+
attrs: { "size" => 10_241, "filename" => "catalina.log.zip" }
|
108
|
+
)
|
109
|
+
]
|
110
|
+
)
|
111
|
+
)
|
112
|
+
end
|
113
|
+
|
114
|
+
test "gz log file is present" do
|
115
|
+
assert Logs.new.passed(
|
116
|
+
OpenStruct.new(
|
117
|
+
attachments: [
|
118
|
+
OpenStruct.new(
|
119
|
+
attrs: { "size" => 10_241, "filename" => "catalina.log.gz" }
|
120
|
+
)
|
121
|
+
]
|
122
|
+
)
|
123
|
+
)
|
124
|
+
end
|
125
|
+
|
126
|
+
test "tar gz log file is present" do
|
127
|
+
assert Logs.new.passed(
|
128
|
+
OpenStruct.new(
|
129
|
+
attachments: [
|
130
|
+
OpenStruct.new(
|
131
|
+
attrs: { "size" => 10_241, "filename" => "catalina.log.tar.gz" }
|
72
132
|
)
|
73
133
|
]
|
74
134
|
)
|
@@ -57,6 +57,36 @@ module Lazylead
|
|
57
57
|
)
|
58
58
|
end
|
59
59
|
|
60
|
+
test "java stacktrace is found in uppercase" do
|
61
|
+
assert Stacktrace.new.passed(
|
62
|
+
OpenStruct.new(
|
63
|
+
description: "
|
64
|
+
XXXXXX env: http://xxxx.xxx.com:00000/
|
65
|
+
WL log [^clust1.log]
|
66
|
+
http://xxx.xxx.com/display/xxx/SQLException+No+more+data+to+read+from+socket
|
67
|
+
|
68
|
+
During call we found in clust1.log the following error
|
69
|
+
{NoFoRmAt}
|
70
|
+
at xxx.xxx.xxx.xxx.wrapper.XxxXxxXxxxXxx.xxxxXxxxXxxx(XxxXxxXxxxXxx.java:233)
|
71
|
+
at xxx.xxx.xxx.xxx.wrapper.XxxXxxXxxxXxx.xxxxXxxxXxxx(XxxXxxXxxxXxx.java:343)
|
72
|
+
... 318 more
|
73
|
+
Caused by: javax.transaction.TransactionRolledbackException: EJB Exception: ; nested exception is:
|
74
|
+
javax.ejb.TransactionRolledbackLocalException: EJB Exception:
|
75
|
+
at weblogic.utils.StackTraceDisabled.unknownMethod()
|
76
|
+
Caused by: javax.ejb.TransactionRolledbackLocalException: EJB Exception:
|
77
|
+
... 1 more
|
78
|
+
Caused by: javax.ejb.EJBException: java.sql.SQLRecoverableException: No more data to read from socket
|
79
|
+
... 1 more
|
80
|
+
Caused by: java.sql.SQLRecoverableException: No more data to read from socket
|
81
|
+
... 1 more
|
82
|
+
{NoFoRmAt}
|
83
|
+
|
84
|
+
The investigation is required.
|
85
|
+
More details here: XXXXX-xxxxxx"
|
86
|
+
)
|
87
|
+
)
|
88
|
+
end
|
89
|
+
|
60
90
|
test "stacktrace is found" do
|
61
91
|
assert Stacktrace.new.passed(
|
62
92
|
OpenStruct.new(
|
@@ -95,6 +125,14 @@ module Lazylead
|
|
95
125
|
)
|
96
126
|
end
|
97
127
|
|
128
|
+
test "exception is found" do
|
129
|
+
assert Stacktrace.new.passed(
|
130
|
+
OpenStruct.new(
|
131
|
+
description: "{noformat}sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target; nested exception is javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target{noformat}"
|
132
|
+
)
|
133
|
+
)
|
134
|
+
end
|
135
|
+
|
98
136
|
test "ORA error is found" do
|
99
137
|
assert Stacktrace.new.passed(
|
100
138
|
OpenStruct.new(
|
@@ -109,5 +147,194 @@ module Lazylead
|
|
109
147
|
)
|
110
148
|
)
|
111
149
|
end
|
150
|
+
|
151
|
+
test "ORA error is found in uppercase" do
|
152
|
+
assert Stacktrace.new.passed(
|
153
|
+
OpenStruct.new(
|
154
|
+
description: "
|
155
|
+
{NOFORMAT}
|
156
|
+
@XXXX/xxx/xxx/xxxx_xxx_xxxxx_xxx_xx.sql
|
157
|
+
ORA-02291: 1 integrity constraint (XXX_XXX_XXX.XX_xxx) violated - xx xxx not found for xx_xx=xx xxxxx_xx=XXXXXXX xxxxx=XXXXXXXX xxx_xx=xxx xx_xxx=xxxx.xxx.xxx.xxxxx.xxx.xxx.xxxxx
|
158
|
+
XXXX-xxx-xxxx: xxxxx xxxxx Xxxxx xxxx Xxxx
|
159
|
+
{NOFORMAT}
|
160
|
+
|
161
|
+
XXXX - XXX_XXX.X.XXXX.XXXX.XXXX.XxxxxxXX.X_xxxXXXXXX"
|
162
|
+
)
|
163
|
+
)
|
164
|
+
end
|
165
|
+
|
166
|
+
test "java error is found in code section" do
|
167
|
+
assert Stacktrace.new.passed(
|
168
|
+
OpenStruct.new(
|
169
|
+
description: "
|
170
|
+
asdfasdfasdf
|
171
|
+
{code:java}texta-line1
|
172
|
+
;texta-line2{code}
|
173
|
+
asdjf;asdjfa;sdjf
|
174
|
+
as;djf;asdjf
|
175
|
+
{code}javax.servlet.ServletException: Something went wrong
|
176
|
+
at com.example.myproject.OpenSessionInViewFilter.doFilter(OpenSessionInViewFilter.java:60)
|
177
|
+
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
|
178
|
+
at com.example.myproject.ExceptionHandlerFilter.doFilter(ExceptionHandlerFilter.java:28)
|
179
|
+
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
|
180
|
+
at com.example.myproject.OutputBufferFilter.doFilter(OutputBufferFilter.java:33)
|
181
|
+
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
|
182
|
+
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
|
183
|
+
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
|
184
|
+
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
|
185
|
+
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
|
186
|
+
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
|
187
|
+
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
|
188
|
+
at org.mortbay.jetty.Server.handle(Server.java:326)
|
189
|
+
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
|
190
|
+
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:943)
|
191
|
+
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
|
192
|
+
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
|
193
|
+
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
|
194
|
+
at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
|
195
|
+
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
|
196
|
+
Caused by: com.example.myproject.MyProjectServletException
|
197
|
+
at com.example.myproject.MyServlet.doPost(MyServlet.java:169)
|
198
|
+
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
|
199
|
+
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
|
200
|
+
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
|
201
|
+
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
|
202
|
+
at com.example.myproject.OpenSessionInViewFilter.doFilter(OpenSessionInViewFilter.java:30)
|
203
|
+
... 27 more
|
204
|
+
Caused by: org.hibernate.exception.ConstraintViolationException: could not insert: [com.example.myproject.MyEntity]
|
205
|
+
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:96)
|
206
|
+
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
|
207
|
+
at org.hibernate.id.insert.AbstractSelectingDelegate.performInsert(AbstractSelectingDelegate.java:64)
|
208
|
+
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2329)
|
209
|
+
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2822)
|
210
|
+
at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71)
|
211
|
+
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:268)
|
212
|
+
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:321)
|
213
|
+
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204)
|
214
|
+
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:130)
|
215
|
+
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
|
216
|
+
at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:56)
|
217
|
+
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
|
218
|
+
at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:50)
|
219
|
+
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
|
220
|
+
at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:705)
|
221
|
+
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:693)
|
222
|
+
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:689)
|
223
|
+
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
|
224
|
+
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
|
225
|
+
at java.lang.reflect.Method.invoke(Method.java:597)
|
226
|
+
at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:344)
|
227
|
+
at $Proxy19.save(Unknown Source)
|
228
|
+
at com.example.myproject.MyEntityService.save(MyEntityService.java:59) <-- relevant call (see notes below)
|
229
|
+
at com.example.myproject.MyServlet.doPost(MyServlet.java:164)
|
230
|
+
... 32 more
|
231
|
+
Caused by: java.sql.SQLException: Violation of unique constraint MY_ENTITY_UK_1: duplicate value(s) for column(s) MY_COLUMN in statement [...]
|
232
|
+
at org.hsqldb.jdbc.Util.throwError(Unknown Source)
|
233
|
+
at org.hsqldb.jdbc.jdbcPreparedStatement.executeUpdate(Unknown Source)
|
234
|
+
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105)
|
235
|
+
at org.hibernate.id.insert.AbstractSelectingDelegate.performInsert(AbstractSelectingDelegate.java:57)
|
236
|
+
... 54 more{code}
|
237
|
+
asdfasdfasdf{code:sql}select 1 from dual {code}what?
|
238
|
+
"
|
239
|
+
)
|
240
|
+
)
|
241
|
+
end
|
242
|
+
|
243
|
+
test "java error is found in code section in uppercase" do
|
244
|
+
assert Stacktrace.new.passed(
|
245
|
+
OpenStruct.new(
|
246
|
+
description: "
|
247
|
+
{CODE}javax.servlet.ServletException: Something went wrong
|
248
|
+
at com.example.myproject.OpenSessionInViewFilter.doFilter(OpenSessionInViewFilter.java:60)
|
249
|
+
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
|
250
|
+
at com.example.myproject.ExceptionHandlerFilter.doFilter(ExceptionHandlerFilter.java:28)
|
251
|
+
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
|
252
|
+
at com.example.myproject.OutputBufferFilter.doFilter(OutputBufferFilter.java:33)
|
253
|
+
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
|
254
|
+
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
|
255
|
+
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
|
256
|
+
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
|
257
|
+
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
|
258
|
+
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
|
259
|
+
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
|
260
|
+
at org.mortbay.jetty.Server.handle(Server.java:326)
|
261
|
+
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
|
262
|
+
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:943)
|
263
|
+
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
|
264
|
+
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
|
265
|
+
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
|
266
|
+
at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
|
267
|
+
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
|
268
|
+
Caused by: com.example.myproject.MyProjectServletException
|
269
|
+
at com.example.myproject.MyServlet.doPost(MyServlet.java:169)
|
270
|
+
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
|
271
|
+
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
|
272
|
+
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
|
273
|
+
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
|
274
|
+
at com.example.myproject.OpenSessionInViewFilter.doFilter(OpenSessionInViewFilter.java:30)
|
275
|
+
... 27 more
|
276
|
+
Caused by: org.hibernate.exception.ConstraintViolationException: could not insert: [com.example.myproject.MyEntity]
|
277
|
+
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:96)
|
278
|
+
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
|
279
|
+
at org.hibernate.id.insert.AbstractSelectingDelegate.performInsert(AbstractSelectingDelegate.java:64)
|
280
|
+
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2329)
|
281
|
+
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2822)
|
282
|
+
at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71)
|
283
|
+
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:268)
|
284
|
+
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:321)
|
285
|
+
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204)
|
286
|
+
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:130)
|
287
|
+
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
|
288
|
+
at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:56)
|
289
|
+
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
|
290
|
+
at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:50)
|
291
|
+
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
|
292
|
+
at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:705)
|
293
|
+
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:693)
|
294
|
+
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:689)
|
295
|
+
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
|
296
|
+
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
|
297
|
+
at java.lang.reflect.Method.invoke(Method.java:597)
|
298
|
+
at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:344)
|
299
|
+
at $Proxy19.save(Unknown Source)
|
300
|
+
at com.example.myproject.MyEntityService.save(MyEntityService.java:59) <-- relevant call (see notes below)
|
301
|
+
at com.example.myproject.MyServlet.doPost(MyServlet.java:164)
|
302
|
+
... 32 more
|
303
|
+
Caused by: java.sql.SQLException: Violation of unique constraint MY_ENTITY_UK_1: duplicate value(s) for column(s) MY_COLUMN in statement [...]
|
304
|
+
at org.hsqldb.jdbc.Util.throwError(Unknown Source)
|
305
|
+
at org.hsqldb.jdbc.jdbcPreparedStatement.executeUpdate(Unknown Source)
|
306
|
+
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105)
|
307
|
+
at org.hibernate.id.insert.AbstractSelectingDelegate.performInsert(AbstractSelectingDelegate.java:57)
|
308
|
+
... 54 more{CODE}
|
309
|
+
"
|
310
|
+
)
|
311
|
+
)
|
312
|
+
end
|
313
|
+
|
314
|
+
test "java error is found in colored code section in uppercase" do
|
315
|
+
assert Stacktrace.new.passed(
|
316
|
+
OpenStruct.new(
|
317
|
+
description: "
|
318
|
+
{CODE:red}
|
319
|
+
Caused by: java.sql.SQLException: Violation of unique constraint MY_ENTITY_UK_1: duplicate value(s) for column(s) MY_COLUMN in statement [...]
|
320
|
+
at org.hsqldb.jdbc.Util.throwError(Unknown Source)
|
321
|
+
at org.hsqldb.jdbc.jdbcPreparedStatement.executeUpdate(Unknown Source)
|
322
|
+
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105)
|
323
|
+
at org.hibernate.id.insert.AbstractSelectingDelegate.performInsert(AbstractSelectingDelegate.java:57)
|
324
|
+
... 54 more{CODE}
|
325
|
+
"
|
326
|
+
)
|
327
|
+
)
|
328
|
+
end
|
329
|
+
|
330
|
+
test "pair detected" do
|
331
|
+
assert_equal [[1, 4]],
|
332
|
+
Stacktrace.new.pairs(%w[aa tag bb cc tag dd], "tag")
|
333
|
+
end
|
334
|
+
|
335
|
+
test "proper pair detected" do
|
336
|
+
assert_equal [[1, 4]],
|
337
|
+
Stacktrace.new.pairs(%w[aa tag bb cc tag dd tag], "tag")
|
338
|
+
end
|
112
339
|
end
|
113
340
|
end
|