<?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: Testing Plug-ins with Fragments</title>
	<atom:link href="http://www.modumind.com/2007/06/20/unit-testing-plug-ins-with-fragments/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.modumind.com/2007/06/20/unit-testing-plug-ins-with-fragments/</link>
	<description>Eclipse RCP and OSGi training - online or onsite</description>
	<lastBuildDate>Tue, 09 Mar 2010 15:55:05 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Patrick</title>
		<link>http://www.modumind.com/2007/06/20/unit-testing-plug-ins-with-fragments/comment-page-1/#comment-5865</link>
		<dc:creator>Patrick</dc:creator>
		<pubDate>Fri, 12 Feb 2010 19:34:52 +0000</pubDate>
		<guid isPermaLink="false">http://rcpquickstart.wordpress.com/2007/06/20/unit-testing-plug-ins-with-fragments/#comment-5865</guid>
		<description>Hi Mircea,

I&#039;ve looked into this further and it seems like a limitation of the java compiler in PDE, not of OSGi itself. At runtime, your fragments should be able to load classes from each other. 

This obviously doesn&#039;t help much, though, unless you decide to write your unit tests using reflection :-)

As for the &quot;friends&quot; mechanism, you should know that this restriction is applied only in PDE. At runtime, your packages are exported in an unqualified way because OSGi does not honor the &quot;x-friends&quot; directive.

--- Patrick</description>
		<content:encoded><![CDATA[<p>Hi Mircea,</p>
<p>I&#8217;ve looked into this further and it seems like a limitation of the java compiler in PDE, not of OSGi itself. At runtime, your fragments should be able to load classes from each other. </p>
<p>This obviously doesn&#8217;t help much, though, unless you decide to write your unit tests using reflection :-)</p>
<p>As for the &#8220;friends&#8221; mechanism, you should know that this restriction is applied only in PDE. At runtime, your packages are exported in an unqualified way because OSGi does not honor the &#8220;x-friends&#8221; directive.</p>
<p>&#8212; Patrick</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mircea</title>
		<link>http://www.modumind.com/2007/06/20/unit-testing-plug-ins-with-fragments/comment-page-1/#comment-5855</link>
		<dc:creator>Mircea</dc:creator>
		<pubDate>Fri, 12 Feb 2010 08:17:16 +0000</pubDate>
		<guid isPermaLink="false">http://rcpquickstart.wordpress.com/2007/06/20/unit-testing-plug-ins-with-fragments/#comment-5855</guid>
		<description>Hello Patrick!

  Thanks a lot for your answer. I&#039;m still looking for a solution though... I&#039;m not good with exposing all the classes I want to test due to some strict safety requirements I have to fulfil...
  One solution would be to drop the fragment I have to test and make a plug in out of it. And have to original host plug in expose its components to the fragment as a friend plug in... But I&#039;m still hopping...

Mircea</description>
		<content:encoded><![CDATA[<p>Hello Patrick!</p>
<p>  Thanks a lot for your answer. I&#8217;m still looking for a solution though&#8230; I&#8217;m not good with exposing all the classes I want to test due to some strict safety requirements I have to fulfil&#8230;<br />
  One solution would be to drop the fragment I have to test and make a plug in out of it. And have to original host plug in expose its components to the fragment as a friend plug in&#8230; But I&#8217;m still hopping&#8230;</p>
<p>Mircea</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrick</title>
		<link>http://www.modumind.com/2007/06/20/unit-testing-plug-ins-with-fragments/comment-page-1/#comment-5839</link>
		<dc:creator>Patrick</dc:creator>
		<pubDate>Thu, 11 Feb 2010 22:18:43 +0000</pubDate>
		<guid isPermaLink="false">http://rcpquickstart.wordpress.com/2007/06/20/unit-testing-plug-ins-with-fragments/#comment-5839</guid>
		<description>Hi Mircea,

I just worked up some sample projects, and it appears that even after setting Eclipse-ExtensibleAPI: true in the bundle manifest, there is no visibility between fragments of the same bundle. There may be a way to do this, though, and you might want to ask in the Eclipse newsgroups.

A workaround would be to put just the fragment test cases in a regular bundle. Then the Eclipse-ExtensibleAPI setting will allow the fragment classes to be tested. Of course you&#039;ll need to export the package in the fragment and you&#039;ll only be able to test public classes/methods. Kind of backwards, I know, but it should work.

If you figure out a way to do this, let me know.

--- Patrick</description>
		<content:encoded><![CDATA[<p>Hi Mircea,</p>
<p>I just worked up some sample projects, and it appears that even after setting Eclipse-ExtensibleAPI: true in the bundle manifest, there is no visibility between fragments of the same bundle. There may be a way to do this, though, and you might want to ask in the Eclipse newsgroups.</p>
<p>A workaround would be to put just the fragment test cases in a regular bundle. Then the Eclipse-ExtensibleAPI setting will allow the fragment classes to be tested. Of course you&#8217;ll need to export the package in the fragment and you&#8217;ll only be able to test public classes/methods. Kind of backwards, I know, but it should work.</p>
<p>If you figure out a way to do this, let me know.</p>
<p>&#8212; Patrick</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mircea</title>
		<link>http://www.modumind.com/2007/06/20/unit-testing-plug-ins-with-fragments/comment-page-1/#comment-5836</link>
		<dc:creator>Mircea</dc:creator>
		<pubDate>Thu, 11 Feb 2010 13:29:54 +0000</pubDate>
		<guid isPermaLink="false">http://rcpquickstart.wordpress.com/2007/06/20/unit-testing-plug-ins-with-fragments/#comment-5836</guid>
		<description>I need to create a test fragment for a fragment as two of the components in my application are a plugin and its fragment. And I have to have unit tests for the fragment... 
Any idea?</description>
		<content:encoded><![CDATA[<p>I need to create a test fragment for a fragment as two of the components in my application are a plugin and its fragment. And I have to have unit tests for the fragment&#8230;<br />
Any idea?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrick</title>
		<link>http://www.modumind.com/2007/06/20/unit-testing-plug-ins-with-fragments/comment-page-1/#comment-4758</link>
		<dc:creator>Patrick</dc:creator>
		<pubDate>Tue, 12 Jan 2010 17:19:15 +0000</pubDate>
		<guid isPermaLink="false">http://rcpquickstart.wordpress.com/2007/06/20/unit-testing-plug-ins-with-fragments/#comment-4758</guid>
		<description>Hi Anu,

Unfortunately I&#039;ve never been able to get test fragments working with PDE Build. There is an open Bugzilla entry on this, and maybe you could add a post saying that you&#039;d be interested in a solution.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=181508

The more people that ask, the better.

Regards,

--- Patrick</description>
		<content:encoded><![CDATA[<p>Hi Anu,</p>
<p>Unfortunately I&#8217;ve never been able to get test fragments working with PDE Build. There is an open Bugzilla entry on this, and maybe you could add a post saying that you&#8217;d be interested in a solution.</p>
<p><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=181508" rel="nofollow">https://bugs.eclipse.org/bugs/show_bug.cgi?id=181508</a></p>
<p>The more people that ask, the better.</p>
<p>Regards,</p>
<p>&#8212; Patrick</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anu</title>
		<link>http://www.modumind.com/2007/06/20/unit-testing-plug-ins-with-fragments/comment-page-1/#comment-4752</link>
		<dc:creator>Anu</dc:creator>
		<pubDate>Tue, 12 Jan 2010 10:02:25 +0000</pubDate>
		<guid isPermaLink="false">http://rcpquickstart.wordpress.com/2007/06/20/unit-testing-plug-ins-with-fragments/#comment-4752</guid>
		<description>Hi
Thanks for the great post! It was very helpful.
However I&#039;m trying to build my application using PDE build and it is not picking up test fragments. It is unable to find the dependencies which exists in the host plug-in of the fragment. Any advice on how should I tackle this issue?</description>
		<content:encoded><![CDATA[<p>Hi<br />
Thanks for the great post! It was very helpful.<br />
However I&#8217;m trying to build my application using PDE build and it is not picking up test fragments. It is unable to find the dependencies which exists in the host plug-in of the fragment. Any advice on how should I tackle this issue?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: com.dmissoh.org &#187; Blog Archive &#187; Nuts and bolts of the UI development: GUI Test of SWT and Eclipse Applications</title>
		<link>http://www.modumind.com/2007/06/20/unit-testing-plug-ins-with-fragments/comment-page-1/#comment-356</link>
		<dc:creator>com.dmissoh.org &#187; Blog Archive &#187; Nuts and bolts of the UI development: GUI Test of SWT and Eclipse Applications</dc:creator>
		<pubDate>Sun, 15 Feb 2009 17:08:47 +0000</pubDate>
		<guid isPermaLink="false">http://rcpquickstart.wordpress.com/2007/06/20/unit-testing-plug-ins-with-fragments/#comment-356</guid>
		<description>[...] plug-ins or fragments can be run without using test suites. In one of his previous articles (Testing Plug-ins with Fragments) he explains how fragments can be used to separate the test code from the business [...]</description>
		<content:encoded><![CDATA[<p>[...] plug-ins or fragments can be run without using test suites. In one of his previous articles (Testing Plug-ins with Fragments) he explains how fragments can be used to separate the test code from the business [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Class for name with context classloader &#171; Codescale Blog</title>
		<link>http://www.modumind.com/2007/06/20/unit-testing-plug-ins-with-fragments/comment-page-1/#comment-355</link>
		<dc:creator>Class for name with context classloader &#171; Codescale Blog</dc:creator>
		<pubDate>Tue, 06 Jan 2009 14:16:01 +0000</pubDate>
		<guid isPermaLink="false">http://rcpquickstart.wordpress.com/2007/06/20/unit-testing-plug-ins-with-fragments/#comment-355</guid>
		<description>[...] know that the osgi classloading it a bit different as usual. In Equinox there are also Buddies and Fragments which effect the [...]</description>
		<content:encoded><![CDATA[<p>[...] know that the osgi classloading it a bit different as usual. In Equinox there are also Buddies and Fragments which effect the [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrick</title>
		<link>http://www.modumind.com/2007/06/20/unit-testing-plug-ins-with-fragments/comment-page-1/#comment-348</link>
		<dc:creator>Patrick</dc:creator>
		<pubDate>Thu, 03 Jul 2008 16:05:46 +0000</pubDate>
		<guid isPermaLink="false">http://rcpquickstart.wordpress.com/2007/06/20/unit-testing-plug-ins-with-fragments/#comment-348</guid>
		<description>Hi Nihal,

Your approach makes sense. The only alternative I see is to create some common test plug-in that could contain reusable test classes. This would eliminate the visibility leakage issue you have, but as you say it&#039;s not really a big deal.

Thanks for posting this tip. I think it will help others trying to do fragment-based testing.

--- Patrick</description>
		<content:encoded><![CDATA[<p>Hi Nihal,</p>
<p>Your approach makes sense. The only alternative I see is to create some common test plug-in that could contain reusable test classes. This would eliminate the visibility leakage issue you have, but as you say it&#8217;s not really a big deal.</p>
<p>Thanks for posting this tip. I think it will help others trying to do fragment-based testing.</p>
<p>&#8212; Patrick</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nihal</title>
		<link>http://www.modumind.com/2007/06/20/unit-testing-plug-ins-with-fragments/comment-page-1/#comment-354</link>
		<dc:creator>Nihal</dc:creator>
		<pubDate>Thu, 03 Jul 2008 15:16:13 +0000</pubDate>
		<guid isPermaLink="false">http://rcpquickstart.wordpress.com/2007/06/20/unit-testing-plug-ins-with-fragments/#comment-354</guid>
		<description>Hey Patrick,

We&#039;ve been using the fragment option for almost a year now.  As you may recall you helped us to get our RCP app up and running.  Anywho, in using fragments as containers for tests, I&#039;ve found that it&#039;s useful to have &quot;Eclipse-ExtensibleAPI: true&quot; in the manifest for the host plugin.  By default this value is false.  This allows fragments to contribute API to the host plugin and is useful if you want to provide utility classes and methods for testing that other test fragments can use.

For example:

ModelPlugin:
-SomeModel class

ModelTestPlugin:
-ModelTests class -- extends TestCase and provides helper methods to create SomeModel objects
-SomeModelTest -- extends ModelTests;  just for completeness :]

PresentationPlugin:
-SomePresenter class

PresentationTestPlugin:
-SomePresenterTest class -- extends ModelTests*

* Without specifying the &quot;Eclipse-ExtensibleAPI: true&quot; in the manifest for ModelPlugin, I would not be able to extend ModelTests in PresentationTestPlugin (would get compilation errors).  Of course the disadvantage to this is that now PresentationPlugin is going to have visiblity to ModelTests, but that&#039;s something I&#039;m willing to live with.  Perhaps there&#039;s still a better way yet?

Cheers,
Nihal

Reference:
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/bundle_manifest.html</description>
		<content:encoded><![CDATA[<p>Hey Patrick,</p>
<p>We&#8217;ve been using the fragment option for almost a year now.  As you may recall you helped us to get our RCP app up and running.  Anywho, in using fragments as containers for tests, I&#8217;ve found that it&#8217;s useful to have &#8220;Eclipse-ExtensibleAPI: true&#8221; in the manifest for the host plugin.  By default this value is false.  This allows fragments to contribute API to the host plugin and is useful if you want to provide utility classes and methods for testing that other test fragments can use.</p>
<p>For example:</p>
<p>ModelPlugin:<br />
-SomeModel class</p>
<p>ModelTestPlugin:<br />
-ModelTests class &#8212; extends TestCase and provides helper methods to create SomeModel objects<br />
-SomeModelTest &#8212; extends ModelTests;  just for completeness :]</p>
<p>PresentationPlugin:<br />
-SomePresenter class</p>
<p>PresentationTestPlugin:<br />
-SomePresenterTest class &#8212; extends ModelTests*</p>
<p>* Without specifying the &#8220;Eclipse-ExtensibleAPI: true&#8221; in the manifest for ModelPlugin, I would not be able to extend ModelTests in PresentationTestPlugin (would get compilation errors).  Of course the disadvantage to this is that now PresentationPlugin is going to have visiblity to ModelTests, but that&#8217;s something I&#8217;m willing to live with.  Perhaps there&#8217;s still a better way yet?</p>
<p>Cheers,<br />
Nihal</p>
<p>Reference:<br />
<a href="http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/bundle_manifest.html" rel="nofollow">http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/bundle_manifest.html</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
