This repository has been archived by the owner on Jul 23, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjunitparser_test.go
424 lines (409 loc) · 37.4 KB
/
junitparser_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
package parse
import (
log "github.com/Sirupsen/logrus"
"github.com/stretchr/testify/assert"
"testing"
)
func TestJavaJunitTestSuite(t *testing.T) {
log.Info("TestJavaJunitTestSuite")
suite, err := toJunitTestSuite([]byte(getMockJunit()))
assert.NoError(t, err)
assert.Equal(t, 5, len(suite.TestCases))
assert.Equal(t, 5, len(suite.TestCases))
assert.Equal(t, "5", suite.Total, "suite.Total")
assert.Equal(t, "1", suite.Failures, "suite.Failures")
assert.Equal(t, "0", suite.Errors, "suite.Errors")
assert.Equal(t, "0", suite.Skipped, "suite.Skipped")
}
func TestMochaXunitTestSuite(t *testing.T) {
log.Info("TestMochaXunitTestSuite")
suite, err := toJunitTestSuite([]byte(getMockMochaXunit()))
assert.NoError(t, err)
assert.Equal(t, 5, len(suite.TestCases))
assert.Equal(t, "5", suite.Total, "suite.Total")
assert.Equal(t, "1", suite.Failures, "suite.Failures")
assert.Equal(t, "1", suite.Errors, "suite.Errors")
assert.Equal(t, "0", suite.Skipped, "suite.Skipped")
}
func TestMochaXunitTestSuiteWithSkippedTest(t *testing.T) {
log.Info("TestMochaXunitTestSuiteWithSkippedTest")
suite, err := toJunitTestSuite([]byte(getMockMochaXunitWithSkippedTest()))
assert.NoError(t, err)
assert.Equal(t, 5, len(suite.TestCases))
assert.Equal(t, "5", suite.Total, "suite.Total")
assert.Equal(t, "4", suite.Failures, "suite.Failures")
assert.Equal(t, "4", suite.Errors, "suite.Errors")
assert.Equal(t, "1", suite.Skipped, "suite.Skipped")
}
func TestMochaXunitTestSuiteWithErrorTest(t *testing.T) {
log.Info("TestMochaXunitTestSuiteWithErrorTest")
suite, err := toJunitTestSuite([]byte(getMockMochaXunitWithErrorTest()))
assert.NoError(t, err)
assert.Equal(t, 1, len(suite.TestCases))
assert.Equal(t, "1", suite.Total, "suite.Total")
assert.Equal(t, "0", suite.Failures, "suite.Failures")
assert.Equal(t, "1", suite.Errors, "suite.Errors")
assert.Equal(t, "", suite.Skipped, "suite.Skipped") //test property not exist
}
func TestToTestSuite_InvalidXML(t *testing.T) {
log.Info("TestToTestSuite_InvalidXML")
_, err := toJunitTestSuite([]byte("abc"))
assert.Error(t, err)
}
func getMockJunit() string {
// TEST-com.hp.mqm.testbox.service.TestResultServiceImplGherkinITCase.xml
return `<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="com.hp.mqm.testbox.service.TestResultServiceImplGherkinITCase" time="39.202" tests="5" errors="0" skipped="0" failures="1">
<properties>
<property name="java.vendor" value="Oracle Corporation"/>
<property name="TRACK" value="quick"/>
<property name="sun.java.launcher" value="SUN_STANDARD"/>
<property name="sun.management.compiler" value="HotSpot 64-Bit Tiered Compilers"/>
<property name="os.name" value="Linux"/>
<property name="sun.boot.class.path" value="/DATA/ads_slave/tools/hudson.model.JDK/OpenJDK-8u65/jre/lib/resources.jar:/DATA/ads_slave/tools/hudson.model.JDK/OpenJDK-8u65/jre/lib/rt.jar:/DATA/ads_slave/tools/hudson.model.JDK/OpenJDK-8u65/jre/lib/sunrsasign.jar:/DATA/ads_slave/tools/hudson.model.JDK/OpenJDK-8u65/jre/lib/jsse.jar:/DATA/ads_slave/tools/hudson.model.JDK/OpenJDK-8u65/jre/lib/jce.jar:/DATA/ads_slave/tools/hudson.model.JDK/OpenJDK-8u65/jre/lib/charsets.jar:/DATA/ads_slave/tools/hudson.model.JDK/OpenJDK-8u65/jre/lib/jfr.jar:/DATA/ads_slave/tools/hudson.model.JDK/OpenJDK-8u65/jre/classes"/>
<property name="BUILD_NODE" value="mydtbld0138.hpeswlab.net"/>
<property name="db.schema.name" value="mqm1472813603860"/>
<property name="CUSTOM_JAVA" value="/DATA/ads_slave/tools/hudson.model.JDK/OpenJDK-8u65"/>
<property name="java.vm.specification.vendor" value="Oracle Corporation"/>
<property name="java.runtime.version" value="1.8.0_65-b17"/>
<property name="archive_build_number" value="1477"/>
<property name="SCM_BRANCH" value="master"/>
<property name="user.name" value="ads_slave"/>
<property name="mercury.td.sa_config_dir" value="target/generate-schema-out"/>
<property name="guice.disable.misplaced.annotation.check" value="true"/>
<property name="maven.repo.local" value="/DATA/ads_slave/workspace/MQM-System-Test-quick-master/.repository"/>
<property name="user.language" value="en"/>
<property name="sun.boot.library.path" value="/DATA/ads_slave/tools/hudson.model.JDK/OpenJDK-8u65/jre/lib/amd64"/>
<property name="classworlds.conf" value="/DATA/ads_slave/tools/hudson.tasks.Maven_MavenInstallation/maven-3.0.5/bin/m2.conf"/>
<property name="java.version" value="1.8.0_65"/>
<property name="user.timezone" value="Asia/Jerusalem"/>
<property name="sun.arch.data.model" value="64"/>
<property name="jetty.port" value="${JETTY_PORT}"/>
<property name="java.endorsed.dirs" value="/DATA/ads_slave/tools/hudson.model.JDK/OpenJDK-8u65/jre/lib/endorsed"/>
<property name="sun.cpu.isalist" value=""/>
<property name="sun.jnu.encoding" value="UTF-8"/>
<property name="file.encoding.pkg" value="sun.io"/>
<property name="MQM_VERSION" value="12.53.11"/>
<property name="file.separator" value="/"/>
<property name="java.specification.name" value="Java Platform API Specification"/>
<property name="com.hp.mqm.infra.log.log4j.xml.location" value="/DATA/ads_slave/workspace/MQM-System-Test-quick-master/mqm/Server/mqm-integration-tests/target/classes/log4j.xml"/>
<property name="java.class.version" value="52.0"/>
<property name="user.country" value="US"/>
<property name="securerandom.source" value="file:/dev/./urandom"/>
<property name="ARCHIVE_JOB_NAME" value="MQM-job-Archive-quick-master"/>
<property name="alm.home" value="/DATA/ads_slave/workspace/MQM-System-Test-quick-master/tmp/dev-home"/>
<property name="java.home" value="/DATA/ads_slave/tools/hudson.model.JDK/OpenJDK-8u65/jre"/>
<property name="jetty.stop.port" value="${JETTY_STOP_PORT}"/>
<property name="java.vm.info" value="mixed mode"/>
<property name="os.version" value="3.10.0-327.el7.x86_64"/>
<property name="db.properties.file.path" value="/DATA/ads_slave/workspace/MQM-System-Test-quick-master/db/DBSchemasBuilder.ORACLE.properties"/>
<property name="path.separator" value=":"/>
<property name="java.vm.version" value="25.65-b01"/>
<property name="UNIT_TEST" value="true"/>
<property name="java.awt.printerjob" value="sun.print.PSPrinterJob"/>
<property name="sun.io.unicode.encoding" value="UnicodeLittle"/>
<property name="awt.toolkit" value="sun.awt.X11.XToolkit"/>
<property name="workspace" value="/DATA/ads_slave/workspace/MQM-System-Test-quick-master"/>
<property name="PACKAGE_VERSION" value="12.53.11-SNAPSHOT"/>
<property name="user.home" value="/DATA/ads_slave/workspace/MQM-System-Test-quick-master/usr"/>
<property name="VALIDATE_JS" value="true"/>
<property name="java.specification.vendor" value="Oracle Corporation"/>
<property name="java.library.path" value="/opt/HPCSS/HPSignClient/lunasa/lib:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib"/>
<property name="java.vendor.url" value="http://java.oracle.com/"/>
<property name="ROOT_BUILD_NUMBER" value="13672"/>
<property name="java.vm.vendor" value="Oracle Corporation"/>
<property name="maven.home" value="/DATA/ads_slave/tools/hudson.tasks.Maven_MavenInstallation/maven-3.0.5"/>
<property name="java.runtime.name" value="OpenJDK Runtime Environment"/>
<property name="sun.java.command" value="org.codehaus.plexus.classworlds.launcher.Launcher -f mqm/Server/mqm-integration-tests/pom.xml -s /tmp/settings8238122921082597807.xml -DVALIDATE_JS=true -DSCM_BRANCH=master -DINDI_PACKAGE_VERSION=12.53.11-SNAPSHOT -DGIT_COMMIT=5d69fb87bc0581aea90966aedbd564ec733e2c83 -DROOT_BUILD_NUMBER=13672 -DARCHIVE_JOB_NAME=MQM-job-Archive-quick-master -DTRACK=quick -DMQM_VERSION=12.53.11 -DCUSTOM_JAVA=/DATA/ads_slave/tools/hudson.model.JDK/OpenJDK-8u65 -Darchive_build_number=1477 -DDOC_VERSION=12.53.11-SNAPSHOT -DBUILD_NODE=mydtbld0138.hpeswlab.net -DSONAR=true -DPACKAGE_VERSION=12.53.11-SNAPSHOT -DUNIT_TEST=true -DINTEGRATION_TEST=true -DCUSTOM_WORKSPACE=/DATA/ads_slave/workspace/MQM-Root-quick-master -DRepositoryFolder=/DATA/ads_slave/workspace/MQM-System-Test-quick-master/tmp -Dalm.home=/DATA/ads_slave/workspace/MQM-System-Test-quick-master/tmp/dev-home -Dworkspace=/DATA/ads_slave/workspace/MQM-System-Test-quick-master -Ddb.properties.file.path=/DATA/ads_slave/workspace/MQM-System-Test-quick-master/db/DBSchemasBuilder.ORACLE.properties -Drestapi.baseurl=http://localhost:${JETTY_PORT}/qcbin -Duser.home=/DATA/ads_slave/workspace/MQM-System-Test-quick-master/usr -Dmercury.td.sa_config_dir=target/generate-schema-out -Duser.dir=/DATA/ads_slave/workspace/MQM-System-Test-quick-master/tmp/dev-home -Ddb.schema.name=mqm1472813603860 -Djetty.stop.port=${JETTY_STOP_PORT} -Dcom.hp.mqm.infra.log.log4j.xml.location=/DATA/ads_slave/workspace/MQM-System-Test-quick-master/mqm/Server/mqm-integration-tests/target/classes/log4j.xml -Djetty.port=${JETTY_PORT} -Djava.io.tmpdir=/DATA/ads_slave/workspace/MQM-System-Test-quick-master/tmp -Ddb.solo.home=/DATA/ads_slave/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/DBSolo5 -Dmaven.repo.local=/DATA/ads_slave/workspace/MQM-System-Test-quick-master/.repository --batch-mode -nsu --errors --activate-profiles createSASchema,egg-test,itest-coverage,it-quick clean integration-test"/>
<property name="java.class.path" value="/DATA/ads_slave/tools/hudson.tasks.Maven_MavenInstallation/maven-3.0.5/boot/plexus-classworlds-2.4.jar"/>
<property name="RepositoryFolder" value="/DATA/ads_slave/workspace/MQM-System-Test-quick-master/tmp"/>
<property name="java.vm.specification.name" value="Java Virtual Machine Specification"/>
<property name="CUSTOM_WORKSPACE" value="/DATA/ads_slave/workspace/MQM-Root-quick-master"/>
<property name="java.vm.specification.version" value="1.8"/>
<property name="sun.cpu.endian" value="little"/>
<property name="sun.os.patch.level" value="unknown"/>
<property name="java.io.tmpdir" value="/DATA/ads_slave/workspace/MQM-System-Test-quick-master/tmp"/>
<property name="java.vendor.url.bug" value="http://bugreport.sun.com/bugreport/"/>
<property name="restapi.baseurl" value="http://localhost:${JETTY_PORT}/qcbin"/>
<property name="java.awt.graphicsenv" value="sun.awt.X11GraphicsEnvironment"/>
<property name="os.arch" value="amd64"/>
<property name="INTEGRATION_TEST" value="true"/>
<property name="java.ext.dirs" value="/DATA/ads_slave/tools/hudson.model.JDK/OpenJDK-8u65/jre/lib/ext:/usr/java/packages/lib/ext"/>
<property name="INDI_PACKAGE_VERSION" value="12.53.11-SNAPSHOT"/>
<property name="user.dir" value="/DATA/ads_slave/workspace/MQM-System-Test-quick-master/tmp/dev-home"/>
<property name="line.separator" value=" "/>
<property name="java.vm.name" value="OpenJDK 64-Bit Server VM"/>
<property name="GIT_COMMIT" value="5d69fb87bc0581aea90966aedbd564ec733e2c83"/>
<property name="file.encoding" value="UTF-8"/>
<property name="DOC_VERSION" value="12.53.11-SNAPSHOT"/>
<property name="java.specification.version" value="1.8"/>
<property name="SONAR" value="true"/>
<property name="db.solo.home" value="/DATA/ads_slave/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/DBSolo5"/>
</properties>
<testcase name="testPersistTestResult_Gherkin_withoutTag_newTests" classname="com.hp.mqm.testbox.service.TestResultServiceImplGherkinITCase" time="9.584"/>
<testcase name="testPersistTestResult_Gherkin_withTag_testExists" classname="com.hp.mqm.testbox.service.TestResultServiceImplGherkinITCase" time="12.198">
<failure message="Expects to have one run for test expected:<1> but was:<2>" type="java.lang.AssertionError"><![CDATA[java.lang.AssertionError: Expects to have one run for test expected:<1> but was:<2>
at org.junit.Assert.fail(Assert.java:88)
at org.junit.Assert.failNotEquals(Assert.java:743)
at org.junit.Assert.assertEquals(Assert.java:118)
at org.junit.Assert.assertEquals(Assert.java:555)
at com.hp.mqm.testbox.service.TestResultServiceImplGherkinITCase.assertAllGherkinTestEntities(TestResultServiceImplGherkinITCase.java:495)
at com.hp.mqm.testbox.service.TestResultServiceImplGherkinITCase.testPersistTestResult_Gherkin_withTag_testExists(TestResultServiceImplGherkinITCase.java:339)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
at org.springframework.test.context.junit4.statements.RunPrepareTestInstanceCallbacks.evaluate(RunPrepareTestInstanceCallbacks.java:64)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
at org.springframework.test.context.junit4.statements.SpringFailOnTimeout.evaluate(SpringFailOnTimeout.java:87)
at org.springframework.test.context.junit4.statements.ProfileValueChecker.evaluate(ProfileValueChecker.java:103)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at junitparams.JUnitParamsRunner.runChild(JUnitParamsRunner.java:416)
at junitparams.JUnitParamsRunner.runChild(JUnitParamsRunner.java:385)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.springframework.test.context.junit4.statements.ProfileValueChecker.evaluate(ProfileValueChecker.java:103)
at org.springframework.test.context.junit4.rules.SpringClassRule$TestContextManagerCacheEvictor.evaluate(SpringClassRule.java:248)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runners.Suite.runChild(Suite.java:127)
at org.junit.runners.Suite.runChild(Suite.java:26)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at org.junit.runner.JUnitCore.run(JUnitCore.java:138)
at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.createRequestAndRun(JUnitCoreWrapper.java:108)
at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.executeLazy(JUnitCoreWrapper.java:89)
at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:58)
at org.apache.maven.surefire.junitcore.JUnitCoreProvider.invoke(JUnitCoreProvider.java:144)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
]]></failure>
<system-out><![CDATA[Setting user context to be:_SYSTEM_USER_
Setting user context to be:email4a697e8c-b40f-43fe-8712-4777e75d7cc1
Push duration: 491ms
Push duration: 391ms
Push duration: 268ms
]]></system-out>
</testcase>
<testcase name="testPersistTestResult_Gherkin_withoutTag_testsExist" classname="com.hp.mqm.testbox.service.TestResultServiceImplGherkinITCase" time="8.408"/>
<testcase name="testPersistTestResult_Gherkin_withTag_testNotExists" classname="com.hp.mqm.testbox.service.TestResultServiceImplGherkinITCase" time="4.825"/>
<testcase name="testPersistTestResult_Gherkin_with_outlineScenario" classname="com.hp.mqm.testbox.service.TestResultServiceImplGherkinITCase" time="4.187"/>
</testsuite>`
}
func getMockMochaXunit() string {
return `<testsuite name="Mocha Tests" tests="5" failures="1" errors="1" skipped="0" timestamp="Mon, 25 Jul 2016 12:36:23 GMT" time="0.073">
<testcase classname="Integration tests - voting" name="check database before voting" time="0.022"/>
<testcase classname="Integration tests - voting" name="vote cats and verify" time="0.026"/>
<testcase classname="Integration tests - voting" name="check database after voting" time="0">
<failure>
expected 0 to equal 1
AssertionError: expected 0 to equal 1
at Assertion.assertEqual (node_modules/chai/lib/chai/core/assertions.js:487:12)
at Assertion.ctx.(anonymous function) [as equal] (node_modules/chai/lib/chai/utils/addMethod.js:41:25)
at null.<anonymous> (specs/e2e/voting-e2e-test.js:82:34)
at Query.handleReadyForQuery (node_modules/pg/lib/query.js:114:10)
at null.<anonymous> (node_modules/pg/lib/client.js:172:19)
at Socket.<anonymous> (node_modules/pg/lib/connection.js:121:12)
at readableAddChunk (_stream_readable.js:153:18)
at Socket.Readable.push (_stream_readable.js:111:10)
at TCP.onread (net.js:534:20)
</failure>
</testcase>
<testcase classname="Functional tests - voting" name="open ui and check title" time="0.008"/>
<testcase classname="Functional tests - voting" name="vote cats" time="0.005"/>
</testsuite>`
}
func getMockMochaXunit2() string {
return `<testsuite name="Mocha Tests" tests="5" failures="1" errors="1" skipped="0" timestamp="Mon, 25 Jul 2016 14:44:37 GMT" time="0.149">
<testcase classname="Integration tests - voting" name="check database before voting" time="0.047"/>
<testcase classname="Integration tests - voting" name="vote cats and verify" time="0.045"/>
<testcase classname="Integration tests - voting" name="check database after voting" time="0.013"/>
<testcase classname="Functional tests - voting" name="open ui and check title" time="0">
<failure>expected -1 to be above -1
AssertionError: expected -1 to be above -1
at Assertion.assertAbove (node_modules/chai/lib/chai/core/assertions.js:571:12)
at Assertion.ctx.(anonymous function) [as above] (node_modules/chai/lib/chai/utils/addMethod.js:41:25)
at Request._callback (specs/functional/vote-page-test.js:27:97)
at Request.self.callback (node_modules/request/request.js:187:22)
at Request.<anonymous> (node_modules/request/request.js:1044:10)
at IncomingMessage.<anonymous> (node_modules/request/request.js:965:12)
at endReadableNT (_stream_readable.js:913:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
</failure>
</testcase>
<testcase classname="Functional tests - voting" name="vote cats" time="0.01"/>
</testsuite>`
}
func getMockMochaXunitWithSkippedTest() string {
return `
<testsuite name="Mocha Tests" tests="5" failures="4" errors="4" skipped="1" timestamp="Wed, 27 Jul 2016 09:37:27 GMT" time="4.045">
<testcase classname="Integration tests - voting" name="check database before voting" time="2.002">
<failure>timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.
Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.</failure></testcase>
<testcase classname="Integration tests - voting" name="vote cats and verify" time="0"><failure>Cannot read property 'statusCode' of undefined
TypeError: Cannot read property 'statusCode' of undefined
at Request._callback (specs/e2e/voting-e2e-test.js:50:18)
at self.callback (node_modules/request/request.js:187:22)
at Request.onRequestError (node_modules/request/request.js:813:8)
at Socket.socketErrorListener (_http_client.js:306:9)
at emitErrorNT (net.js:1265:8)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
</failure>
</testcase>
<testcase classname="Integration tests - voting" name="check database after voting" time="2.002"><failure>timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.
Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.</failure></testcase>
<testcase classname="Functional tests - voting" name="open ui and check title" time="0"><failure>Cannot read property 'statusCode' of undefined
TypeError: Cannot read property 'statusCode' of undefined
at Request._callback (specs/functional/vote-page-test.js:24:18)
at self.callback (node_modules/request/request.js:187:22)
at Request.onRequestError (node_modules/request/request.js:813:8)
at Socket.socketErrorListener (_http_client.js:306:9)
at emitErrorNT (net.js:1265:8)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)</failure></testcase>
<testcase classname="Functional tests - voting" name="vote cats" time="0"><skipped/></testcase>
</testsuite>`
}
func getMockMochaXunitWithErrorTest() string {
return `
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated by org.testng.reporters.JUnitReportReporter -->
<testsuite hostname="TSADOK2" name="com.adm.gaia.webhook.TestWebhookGenerator" tests="1" failures="0" timestamp="11 Sep 2016 11:10:31 GMT" time="0.003" errors="1">
<testcase name="testGenerate" time="0.003" classname="com.adm.gaia.webhook.TestWebhookGenerator">
<error type="java.lang.IllegalStateException" message="Failed to load ApplicationContext">
<![CDATA[java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124)
at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:83)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:117)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83)
at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:228)
at org.springframework.test.context.testng.AbstractTestNGSpringContextTests.springTestContextPrepareTestInstance(AbstractTestNGSpringContextTests.java:149)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:86)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:514)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:215)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142)
at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:178)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
at org.testng.TestRunner.privateRun(TestRunner.java:782)
at org.testng.TestRunner.run(TestRunner.java:632)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:366)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:319)
at org.testng.SuiteRunner.run(SuiteRunner.java:268)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1244)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1169)
at org.testng.TestNG.run(TestNG.java:1064)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:132)
at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:193)
at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:94)
at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:147)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'elasticSearchHttpClient': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.adm.gaia.util.GaiaUrlContainer com.adm.gaia.elasticsearch.ElasticSearchHttpClient._urlContainer; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gaiaUrlContainer': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.adm.gaia.GaiaConfiguration com.adm.gaia.util.GaiaUrlContainer._config; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gaiaConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private java.lang.String com.adm.gaia.GaiaConfiguration._gaiaUrl; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'gaiaUrl' in string value "${gaiaUrl}"
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:125)
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)
at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:109)
at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:261)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:98)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:116)
... 33 more
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.adm.gaia.util.GaiaUrlContainer com.adm.gaia.elasticsearch.ElasticSearchHttpClient._urlContainer; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gaiaUrlContainer': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.adm.gaia.GaiaConfiguration com.adm.gaia.util.GaiaUrlContainer._config; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gaiaConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private java.lang.String com.adm.gaia.GaiaConfiguration._gaiaUrl; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'gaiaUrl' in string value "${gaiaUrl}"
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:573)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
... 49 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gaiaUrlContainer': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.adm.gaia.GaiaConfiguration com.adm.gaia.util.GaiaUrlContainer._config; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gaiaConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private java.lang.String com.adm.gaia.GaiaConfiguration._gaiaUrl; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'gaiaUrl' in string value "${gaiaUrl}"
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1192)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1116)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1014)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:545)
... 51 more
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.adm.gaia.GaiaConfiguration com.adm.gaia.util.GaiaUrlContainer._config; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gaiaConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private java.lang.String com.adm.gaia.GaiaConfiguration._gaiaUrl; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'gaiaUrl' in string value "${gaiaUrl}"
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:573)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
... 62 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gaiaConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private java.lang.String com.adm.gaia.GaiaConfiguration._gaiaUrl; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'gaiaUrl' in string value "${gaiaUrl}"
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1192)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1116)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1014)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:545)
... 64 more
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private java.lang.String com.adm.gaia.GaiaConfiguration._gaiaUrl; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'gaiaUrl' in string value "${gaiaUrl}"
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:573)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
... 75 more
Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'gaiaUrl' in string value "${gaiaUrl}"
at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:174)
at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:126)
at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer$PlaceholderResolvingStringValueResolver.resolveStringValue(PropertyPlaceholderConfigurer.java:258)
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveEmbeddedValue(AbstractBeanFactory.java:808)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1027)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1014)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:545)
... 77 more
]]>
</error>
</testcase> <!-- testGenerate -->
</testsuite> <!-- com.adm.gaia.webhook.TestWebhookGenerator -->
`
}