This is a migrated thread and some comments may be shown as answers.

Getting Character reference "&# at nonPublic mock exceptions

7 Answers 42 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Peter Stefan
Top achievements
Rank 1
Peter Stefan asked on 23 Jun 2014, 09:20 AM
Hello,

when a test with a nonPublic mock fails, following gets written to the stacktrace of the .trx file:

01.<Message>Test method test threw exception:
02.System.ArgumentException: Method 'test' not found on type test</Message>
03.          <StackTrace>    at Telerik.JustMock.Expectations.NonPublicExpectation.™(Type ‹, Type ‘, String , Object[] €)
04.   at Telerik.JustMock.Expectations.NonPublicExpectation..›()
05.   at “•.’•.Š•[–](Func`1 ‹•)
06.   at Telerik.JustMock.Expectations.NonPublicExpectation.Arrange[TReturn](Object target, String memberName, Object[] args)
07.   at Common.Test.MockData`1.NonPublicMockData.Arrange[TReturn](String memberName, String exprName, Object[] args) in c:\jenkins\workspace\Tests\Mock\MockData.cs:line 167
08....
09....
10.truncated here
11.</StackTrace>


the &#x characters let the build fail, because they cannot be transformed.

see:
01.Processing tests results in file(s) Test\TestResults\testResults.trx
02. Test\TestResults\testResults.trx
03.ERROR: Publisher hudson.plugins.mstest.MSTestPublisher aborted due to exception
04.java.io.IOException: remote file operation failed: c:\jenkins\workspace\Build - Tests at hudson.remoting.Channel@69bf0fd8:build3
05.    at hudson.FilePath.act(FilePath.java:916)
06.    at hudson.FilePath.act(FilePath.java:893)
07.    at hudson.plugins.mstest.MSTestPublisher.perform(MSTestPublisher.java:73)
08.    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
09.    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:745)
10.    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:709)
11.    at hudson.model.Build$BuildExecution.post2(Build.java:182)
12.    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:658)
13.    at hudson.model.Run.execute(Run.java:1735)
14.    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
15.    at hudson.model.ResourceController.execute(ResourceController.java:88)
16.    at hudson.model.Executor.run(Executor.java:231)
17.Caused by: hudson.util.IOException2: Could not transform the MSTest report. Please report this issue to the plugin author
18.    at hudson.plugins.mstest.MSTestTransformer.invoke(MSTestTransformer.java:66)
19.    at hudson.plugins.mstest.MSTestTransformer.invoke(MSTestTransformer.java:28)
20.    at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2474)
21.    at hudson.remoting.UserRequest.perform(UserRequest.java:118)
22.    at hudson.remoting.UserRequest.perform(UserRequest.java:48)
23.    at hudson.remoting.Request$2.run(Request.java:328)
24.    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
25.    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
26.    at java.util.concurrent.FutureTask.run(Unknown Source)
27.    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
28.    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
29.    at hudson.remoting.Engine$1$1.run(Engine.java:63)
30.    at java.lang.Thread.run(Unknown Source)
31.Caused by: javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: Character reference "&#
32.    at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source)
33.    at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source)
34.    at hudson.plugins.mstest.MSTestReportConverter.transform(MSTestReportConverter.java:63)
35.    at hudson.plugins.mstest.MSTestTransformer.invoke(MSTestTransformer.java:64)
36.    ... 12 more
37.Caused by: javax.xml.transform.TransformerException: com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: Character reference "&#
38.    at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(Unknown Source)
39.    ... 16 more
40.Caused by: com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: Character reference "&#
41.    at com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(Unknown Source)
42.    at com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(Unknown Source)
43.    ... 17 more

already created an issue for the plugin author (https://issues.jenkins-ci.org/browse/JENKINS-23531)


Is there a way to prevent this errors or to change the encoding of justmocks exception messages?

kind regards
peter

7 Answers, 1 is accepted

Sort by
0
Peter Stefan
Top achievements
Rank 1
answered on 23 Jun 2014, 09:28 AM
the original message got lost, here is a screenshot:

0
Peter Stefan
Top achievements
Rank 1
answered on 23 Jun 2014, 11:41 AM
visual studio test result screenshot:
0
Peter Stefan
Top achievements
Rank 1
answered on 23 Jun 2014, 11:43 AM
sorry, forgot to attach the screenshot
0
Stefan
Telerik team
answered on 23 Jun 2014, 12:06 PM
Hi Peter,

It appears that the obfuscation of Telerik.JustMock.dll is causing the problem. We'll remove the obfuscation in one of next releases. As a temporary workaround I suggest that you build the Telerik.JustMock.dll from source. You can find the source code here.

Regards,
Stefan
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Peter Stefan
Top achievements
Rank 1
answered on 23 Jun 2014, 01:24 PM
Hello,

thank you very much for your answer, 
which build target should i use, and which dll should i use after building?

tried it with releaseFree and there are not ddl's in the Telerik.JustMock folder - should i take a dll of Telerik.JustMock.Demolib?

0
Peter Stefan
Top achievements
Rank 1
answered on 23 Jun 2014, 01:43 PM
found it in a binaries folder, outside the solution

but now i get
 ​Error 11 'Telerik.JustMock.Mock' does not contain a definition for 'SetupStatic' C:\Projekte\Test\TestSetup.cs 11 9 Common.Core.Mock

when trying to build my project
0
Kaloyan
Telerik team
answered on 26 Jun 2014, 11:36 AM
Hi Peter,

Please, try with the Release configuration instead of the ReleaseFree.

I hope this helps.

Regards,
Kaloyan
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
General Discussions
Asked by
Peter Stefan
Top achievements
Rank 1
Answers by
Peter Stefan
Top achievements
Rank 1
Stefan
Telerik team
Kaloyan
Telerik team
Share this question
or