<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: PowerMock + TestNG = True</title>
	<atom:link href="http://blog.jayway.com/2009/12/14/powermock-testng-true/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.jayway.com/2009/12/14/powermock-testng-true/</link>
	<description>Sharing Experience</description>
	<lastBuildDate>Sun, 12 Feb 2012 05:23:29 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Ben Sorek</title>
		<link>http://blog.jayway.com/2009/12/14/powermock-testng-true/comment-page-1/#comment-78106</link>
		<dc:creator>Ben Sorek</dc:creator>
		<pubDate>Wed, 06 Apr 2011 08:55:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jayway.com/?p=3939#comment-78106</guid>
		<description>Is it possible to use powermock/mockito/testng with dataproviders. For some reason we keep getting a class mismatch exception when using tests with dataproviders.</description>
		<content:encoded><![CDATA[<p>Is it possible to use powermock/mockito/testng with dataproviders. For some reason we keep getting a class mismatch exception when using tests with dataproviders.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sumit</title>
		<link>http://blog.jayway.com/2009/12/14/powermock-testng-true/comment-page-1/#comment-71181</link>
		<dc:creator>Sumit</dc:creator>
		<pubDate>Mon, 13 Dec 2010 03:45:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jayway.com/?p=3939#comment-71181</guid>
		<description>I get the same bug 
http://code.google.com/p/powermock/issues/detail?id=293

Any workaround ?</description>
		<content:encoded><![CDATA[<p>I get the same bug<br />
<a href="http://code.google.com/p/powermock/issues/detail?id=293" rel="nofollow">http://code.google.com/p/powermock/issues/detail?id=293</a></p>
<p>Any workaround ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sumit</title>
		<link>http://blog.jayway.com/2009/12/14/powermock-testng-true/comment-page-1/#comment-71106</link>
		<dc:creator>Sumit</dc:creator>
		<pubDate>Sun, 12 Dec 2010 19:15:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jayway.com/?p=3939#comment-71106</guid>
		<description>Hi,

Can you write a test case to mock a static fn. using powermock + easymock +testng.
I am unable to do that and can&#039;t find anything on internet for this combo.
Help plz</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Can you write a test case to mock a static fn. using powermock + easymock +testng.<br />
I am unable to do that and can&#8217;t find anything on internet for this combo.<br />
Help plz</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: @ObjectFactory in PowerMock und TestNG</title>
		<link>http://blog.jayway.com/2009/12/14/powermock-testng-true/comment-page-1/#comment-27523</link>
		<dc:creator>@ObjectFactory in PowerMock und TestNG</dc:creator>
		<pubDate>Sat, 27 Feb 2010 17:27:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jayway.com/?p=3939#comment-27523</guid>
		<description>[...] dem Artikel PowerMock + TestNG = True beschreibt Johan Haleby die neue TestNG-Integration für [...]</description>
		<content:encoded><![CDATA[<p>[...] dem Artikel PowerMock + TestNG = True beschreibt Johan Haleby die neue TestNG-Integration für [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vipin Miglani</title>
		<link>http://blog.jayway.com/2009/12/14/powermock-testng-true/comment-page-1/#comment-24165</link>
		<dc:creator>Vipin Miglani</dc:creator>
		<pubDate>Wed, 03 Feb 2010 19:38:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jayway.com/?p=3939#comment-24165</guid>
		<description>Hi Johan!!

As u mentiones i have posted the above message in googlegroup discussions session with the topic headline &quot;ClassCastException in SaxParserFactory.newInstance() call&quot;

It will be great if u quickly help me to resolve these kind of problems with powermock and xml frameworks.

thanks</description>
		<content:encoded><![CDATA[<p>Hi Johan!!</p>
<p>As u mentiones i have posted the above message in googlegroup discussions session with the topic headline &#8220;ClassCastException in SaxParserFactory.newInstance() call&#8221;</p>
<p>It will be great if u quickly help me to resolve these kind of problems with powermock and xml frameworks.</p>
<p>thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Johan Haleby</title>
		<link>http://blog.jayway.com/2009/12/14/powermock-testng-true/comment-page-1/#comment-24130</link>
		<dc:creator>Johan Haleby</dc:creator>
		<pubDate>Tue, 02 Feb 2010 14:18:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jayway.com/?p=3939#comment-24130</guid>
		<description>Could you please join and use our mailing list and post this message there instead? powermock at googlegroups dot com.</description>
		<content:encoded><![CDATA[<p>Could you please join and use our mailing list and post this message there instead? powermock at googlegroups dot com.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vipin Miglani</title>
		<link>http://blog.jayway.com/2009/12/14/powermock-testng-true/comment-page-1/#comment-24129</link>
		<dc:creator>Vipin Miglani</dc:creator>
		<pubDate>Tue, 02 Feb 2010 13:46:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jayway.com/?p=3939#comment-24129</guid>
		<description>Hi Johan!!
 
I am using TestNG 5.11+Mockito 1.8+PowerMockito 1.3.5

Facing lot of trouble with third party xml, log4j and spring frameworks.
I tried all possible tricks (solutions) available on web. After opting tricks now i am getting ClassCastException while executing new SAXParserFactory.newInstance() code. This code is in some third party jar xmlrpc-Common.jar 3.1.  I Dont have the source code of it and dont want to manipulate this jar anyways.


Looks like two diffrent classloader problem. I mean Abstract class is loaded by MockClassLoader and implementing class instance is in diffrent classLoader

I tried to use @PowerMockIgnore annotation. But that too having bug in PowerMockito1.3.5 versrion(Other versions i didnt try). I get NullPointerException in string class if i use this.

While Debugging this NullPointerException i found two bugs in the PowerMockito1.3.5 Code. Here goes the code snippet having bug

Class::org.powermock.core.classloader.DeferSupportingClassLoader

public void addIgnorePackage(String... packagesToIgnore) {
		if (packagesToIgnore != null &amp;&amp; packagesToIgnore.length &gt; 0) {
			final int previousLength = deferPackages.length;
			deferPackages = new String[previousLength + packagesToIgnore.length];
			System.arraycopy(packagesToIgnore, 0, deferPackages, previousLength, packagesToIgnore.length);
		}


in this method developer is creating a new array list and assigning deferpackeges referece to it.Becoz of the earlier string array get wiped out to which thie reference was reffering. And finally deferpackages reference refer to an array having values null in starting and after some null values it stores the values supplied in PowerMock Ignore  annotation.

Also found one bug in mockclassLoder

return (shouldModifyAll() &#124;&#124; WildcardMatcher.matchesAny(modify, s)) &amp;&amp; !shouldIgnore(deferPackages, s);

this line will always return the false value becoz of shouldModifyAll() call


Can u plz explain the intended behaviours of these code snnipets.

And also Plz Tell me the solution of my earlier ClassCastException problem.
If you quickly reply this, it wud b gud. As rit now i m evaluating PowerMockito to be used or not to e used in our project

Thanks in advance......</description>
		<content:encoded><![CDATA[<p>Hi Johan!!</p>
<p>I am using TestNG 5.11+Mockito 1.8+PowerMockito 1.3.5</p>
<p>Facing lot of trouble with third party xml, log4j and spring frameworks.<br />
I tried all possible tricks (solutions) available on web. After opting tricks now i am getting ClassCastException while executing new SAXParserFactory.newInstance() code. This code is in some third party jar xmlrpc-Common.jar 3.1.  I Dont have the source code of it and dont want to manipulate this jar anyways.</p>
<p>Looks like two diffrent classloader problem. I mean Abstract class is loaded by MockClassLoader and implementing class instance is in diffrent classLoader</p>
<p>I tried to use @PowerMockIgnore annotation. But that too having bug in PowerMockito1.3.5 versrion(Other versions i didnt try). I get NullPointerException in string class if i use this.</p>
<p>While Debugging this NullPointerException i found two bugs in the PowerMockito1.3.5 Code. Here goes the code snippet having bug</p>
<p>Class::org.powermock.core.classloader.DeferSupportingClassLoader</p>
<p>public void addIgnorePackage(String&#8230; packagesToIgnore) {<br />
		if (packagesToIgnore != null &amp;&amp; packagesToIgnore.length &gt; 0) {<br />
			final int previousLength = deferPackages.length;<br />
			deferPackages = new String[previousLength + packagesToIgnore.length];<br />
			System.arraycopy(packagesToIgnore, 0, deferPackages, previousLength, packagesToIgnore.length);<br />
		}</p>
<p>in this method developer is creating a new array list and assigning deferpackeges referece to it.Becoz of the earlier string array get wiped out to which thie reference was reffering. And finally deferpackages reference refer to an array having values null in starting and after some null values it stores the values supplied in PowerMock Ignore  annotation.</p>
<p>Also found one bug in mockclassLoder</p>
<p>return (shouldModifyAll() || WildcardMatcher.matchesAny(modify, s)) &amp;&amp; !shouldIgnore(deferPackages, s);</p>
<p>this line will always return the false value becoz of shouldModifyAll() call</p>
<p>Can u plz explain the intended behaviours of these code snnipets.</p>
<p>And also Plz Tell me the solution of my earlier ClassCastException problem.<br />
If you quickly reply this, it wud b gud. As rit now i m evaluating PowerMockito to be used or not to e used in our project</p>
<p>Thanks in advance&#8230;&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Johan Haleby</title>
		<link>http://blog.jayway.com/2009/12/14/powermock-testng-true/comment-page-1/#comment-18753</link>
		<dc:creator>Johan Haleby</dc:creator>
		<pubDate>Tue, 15 Dec 2009 07:03:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jayway.com/?p=3939#comment-18753</guid>
		<description>Excellent, thanks!</description>
		<content:encoded><![CDATA[<p>Excellent, thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cedric</title>
		<link>http://blog.jayway.com/2009/12/14/powermock-testng-true/comment-page-1/#comment-18728</link>
		<dc:creator>Cedric</dc:creator>
		<pubDate>Tue, 15 Dec 2009 03:17:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jayway.com/?p=3939#comment-18728</guid>
		<description>Very nice, Johan!  I added a link to your article in the TestNG documentation:

http://testng.org/doc/misc.html</description>
		<content:encoded><![CDATA[<p>Very nice, Johan!  I added a link to your article in the TestNG documentation:</p>
<p><a href="http://testng.org/doc/misc.html" rel="nofollow">http://testng.org/doc/misc.html</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

