Thanks, Lincoln!<br><br><div class="gmail_quote">On Thu, Mar 8, 2012 at 6:12 PM, Lincoln Baxter, III <span dir="ltr">&lt;<a href="mailto:lincolnbaxter@gmail.com">lincolnbaxter@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Specifically, this code in your test case does the trick:<br><br><br>   @Test<br>   public void testGitPluginNoProject() throws Exception<br>   {<br>       getShell().setCurrentResource(createTempFolder());<br>       ...<br>

   }<br><br>As long as you are extending from AbstractShellTest, these functions will be available.<div class="HOEnZb"><div class="h5"><br><br><div class="gmail_quote">On Thu, Mar 8, 2012 at 10:30 AM, Lincoln Baxter, III <span dir="ltr">&lt;<a href="mailto:lincolnbaxter@gmail.com" target="_blank">lincolnbaxter@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hey guys,<br><br>I saw this come up during the meeting, and wanted to share the answer. It should be straightforward to simulate working &quot;outside&quot; of a project in a test case. Just create a temp folder (using the Java file API) then either CD to that folder, or get a resource handle to it by @Injecting the ResourceFactory, then set that resource as the current resource using:<br>


<br clear="all"><blockquote style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">shell.setCurrentResource(directory);<br></blockquote><div><br>This is the best way I can think of to achieve this. If it&#39;s not working, then there&#39;s a bug somewhere, probably a nasty one :)<span><font color="#888888"><br>


<br>~Lincoln <br></font></span></div><span><font color="#888888"><br clear="all">-- <br>Lincoln Baxter, III<br><a href="http://ocpsoft.com" target="_blank">http://ocpsoft.com</a><br><a href="http://scrumshark.com" target="_blank">http://scrumshark.com</a><br>

&quot;Keep it Simple&quot;<br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br>Lincoln Baxter, III<br><a href="http://ocpsoft.com" target="_blank">http://ocpsoft.com</a><br><a href="http://scrumshark.com" target="_blank">http://scrumshark.com</a><br>
&quot;Keep it Simple&quot;<br>

</div></div><br>_______________________________________________<br>
forge-dev mailing list<br>
<a href="mailto:forge-dev@lists.jboss.org">forge-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/forge-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-dev</a><br>
<br></blockquote></div><br>