<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Gustavo Peiretti &#187; Util</title>
	<atom:link href="http://gustavopeiretti.com/tag/util/feed/" rel="self" type="application/rss+xml" />
	<link>http://gustavopeiretti.com</link>
	<description>Desarrollo de Software</description>
	<lastBuildDate>Fri, 20 Jan 2012 12:21:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Cambiar el User-agent de tu navegador Mozilla Firefox</title>
		<link>http://gustavopeiretti.com/2011/cambiar-user-agent-de-firefox/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=cambiar-user-agent-de-firefox</link>
		<comments>http://gustavopeiretti.com/2011/cambiar-user-agent-de-firefox/#comments</comments>
		<pubDate>Tue, 25 Jan 2011 08:49:02 +0000</pubDate>
		<dc:creator>Gustavo</dc:creator>
				<category><![CDATA[Tecnología]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Lenguajes]]></category>
		<category><![CDATA[Util]]></category>

		<guid isPermaLink="false">http://gustavopeiretti.com/?p=979</guid>
		<description><![CDATA[Podrías querer cambiar el User-agent de tu Mozilla para &#8216;engañar&#8217; a tu aplicación web haciéndole creer que estas accediendo desde un dispositivo móvil y así probar aspectos como el diseño. El User-agent es el encabezado de la petición http que identifica el nombre de la aplicación, la versión, sistema operativo, etc., que esta accediendo. Por &#8230; </p><p><a class="more-link block-button" href="http://gustavopeiretti.com/2011/cambiar-user-agent-de-firefox/">Continuar leyendo &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>Podrías querer cambiar el User-agent de tu Mozilla para &#8216;engañar&#8217; a tu aplicación web haciéndole creer que estas accediendo desde un dispositivo móvil y así probar aspectos como el diseño.</p>
<p>El User-agent es el encabezado de la petición http que identifica el nombre de la aplicación, la versión, sistema operativo, etc., que esta accediendo.</p>
<p>Por ejemplo el User-agent para Mozilla Firefox corriendo sobre Windows  sería algo así:<br />
Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.9.2.2) Gecko/20100316 Firefox/3.6.2</p>
<p>Para el Opera Mini corriendo sobre un BlackBerry:<br />
Opera/9.80 (BlackBerry; Opera Mini/5.1.22303/22.387; U; en) Presto/2.5.25 Version/10.54</p>
<p>Si quieres modificar el User-agent en Mozilla instala este complemento:<br />
<a href="https://addons.mozilla.org/en-US/firefox/addon/user-agent-switcher/" target="_blank">User-agent Switcher</a></p>
<p><img src="http://gustavopeiretti.com/blog/wp-content/uploads/2011/01/user_agent_switcher_3.jpg" alt="" width="397" height="396" /></p>
<p>Esta página contiene una lista de user-agent que te puede servir <a href="http://www.useragentstring.com/" target="_blank">http://www.useragentstring.com/</a></p>
<p>Por ejemplo, vamos a modificar el user-agent para &#8216;hacerle creer&#8217; a Google que esta corriendo en un Opera Mini sobre un movil BlackBerry</p>
<p><img src="http://gustavopeiretti.com/blog/wp-content/uploads/2011/01/google_movil_blackberry.jpg" alt="" width="512" height="198" /></p>
<p>Google Móvil<br />
<img src="http://gustavopeiretti.com/blog/wp-content/uploads/2011/01/google_movil.jpg" alt="" /></p>
<p>Encabezado User-agent de la petición</p>
<p><img src="http://gustavopeiretti.com/blog/wp-content/uploads/2011/01/google_movil_blackberry_2.jpg" alt="" width="512" height="76" /></p>
]]></content:encoded>
			<wfw:commentRss>http://gustavopeiretti.com/2011/cambiar-user-agent-de-firefox/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Eliminar historial de autocompletar almacenado en MS Outlook</title>
		<link>http://gustavopeiretti.com/2010/eliminar-historial-autocompletar-outlook/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=eliminar-historial-autocompletar-outlook</link>
		<comments>http://gustavopeiretti.com/2010/eliminar-historial-autocompletar-outlook/#comments</comments>
		<pubDate>Sat, 12 Jun 2010 15:21:03 +0000</pubDate>
		<dc:creator>Gustavo</dc:creator>
				<category><![CDATA[Tecnología]]></category>
		<category><![CDATA[Util]]></category>

		<guid isPermaLink="false">http://gustavopeiretti.com/?p=900</guid>
		<description><![CDATA[MS Outlook guarda las entradas de autocompletar en un archivo llamado Outlook.NK2 que se encuentra dentro de la carpeta &#8216;appdata&#8217;  (datos de aplicación). Puedes localizar esta carpeta escribiendo %appdata%   en el menú Inicio de Windows dentro de ‘Ejecutar’ (pulsa win+R) Asegúrate de tener cerrado Ms Outlook Escribe  %APPDATA%\Microsoft\Outlook Busca el archivo Outlook.NK2 Haz una copia &#8230; </p><p><a class="more-link block-button" href="http://gustavopeiretti.com/2010/eliminar-historial-autocompletar-outlook/">Continuar leyendo &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>MS Outlook guarda las entradas de autocompletar en  un archivo llamado Outlook.NK2 que se encuentra dentro de la carpeta &#8216;appdata&#8217;  (datos de aplicación).</p>
<p>Puedes localizar esta carpeta escribiendo %appdata%   en el  menú Inicio de Windows dentro de ‘Ejecutar’ (pulsa win+R)</p>
<p>Asegúrate de tener cerrado Ms Outlook</p>
<ul>
<li>Escribe  %APPDATA%\Microsoft\Outlook</li>
<li>Busca el archivo Outlook.NK2</li>
<li>Haz una copia de seguridad del archivo</li>
<li>Elimina el archivo</li>
<li>Abre MS Outlook, y prueba.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://gustavopeiretti.com/2010/eliminar-historial-autocompletar-outlook/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pidgin Registro de Conversaciones en Windows</title>
		<link>http://gustavopeiretti.com/2010/pidgin-registro-conversaciones-windows/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=pidgin-registro-conversaciones-windows</link>
		<comments>http://gustavopeiretti.com/2010/pidgin-registro-conversaciones-windows/#comments</comments>
		<pubDate>Sun, 23 May 2010 03:59:21 +0000</pubDate>
		<dc:creator>Gustavo</dc:creator>
				<category><![CDATA[Tecnología]]></category>
		<category><![CDATA[Pidgin]]></category>
		<category><![CDATA[Util]]></category>

		<guid isPermaLink="false">http://gustavopeiretti.com/?p=895</guid>
		<description><![CDATA[Busca tu carpeta &#8220;de datos de aplicación&#8221;.  Puedes localizar fácilmente esta carpeta escribiendo %appdata%   en el menu Inicio de Windows dentro de &#8216;Ejecutar&#8217; (pulsa win+R) En windows 7 esta carpeta esta en C:\Users\tuNombreUsuario\AppData\Roaming\ busca alí la carpeta .purple\logs\ Para que las conversaciones se guarden en Pidgin debes activarlo. &#8220;Herramientas &#8211; Preferencias&#8221; pestaña &#8220;Registro&#8221; Espero te &#8230; </p><p><a class="more-link block-button" href="http://gustavopeiretti.com/2010/pidgin-registro-conversaciones-windows/">Continuar leyendo &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>Busca tu carpeta &#8220;de datos de aplicación&#8221;.  Puedes localizar fácilmente esta carpeta escribiendo %appdata%   en el menu Inicio de Windows dentro de &#8216;Ejecutar&#8217; (pulsa win+R)</p>
<p>En windows 7 esta carpeta esta en C:\Users\tuNombreUsuario\AppData\Roaming\</p>
<p>busca alí la carpeta <strong>.purple</strong>\logs\</p>
<p>Para que las conversaciones se guarden en Pidgin debes activarlo. &#8220;Herramientas &#8211; Preferencias&#8221; pestaña &#8220;Registro&#8221;</p>
<p>Espero te sirva&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://gustavopeiretti.com/2010/pidgin-registro-conversaciones-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Comparar archivos con Eclipse</title>
		<link>http://gustavopeiretti.com/2009/comparar-archivos-con-eclipse/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=comparar-archivos-con-eclipse</link>
		<comments>http://gustavopeiretti.com/2009/comparar-archivos-con-eclipse/#comments</comments>
		<pubDate>Sat, 12 Sep 2009 14:07:52 +0000</pubDate>
		<dc:creator>Gustavo</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Util]]></category>

		<guid isPermaLink="false">http://gustavopeiretti.com/?p=760</guid>
		<description><![CDATA[¿Cómo comparar dos archivos con Eclipse? Sumamente fácil; pero como casí nunca lo uso, suelo olvidarlo. Aquí lo dejo para recordarlo. Seleccionar los archivos a comparar&#8230; luego boton derecho&#8230; Compare Each Other&#8230;]]></description>
			<content:encoded><![CDATA[<p>¿Cómo comparar dos archivos con Eclipse?<br />
Sumamente fácil; pero como casí nunca lo uso, suelo olvidarlo. Aquí lo dejo para recordarlo.</p>
<p style="text-align: center;">Seleccionar los archivos a comparar&#8230; luego boton derecho&#8230;<br />
<a rel="attachment wp-att-761" href="http://gustavopeiretti.com/2009/comparar-archivos-con-eclipse/compare_file_eclipse1/"><img class="aligncenter size-full wp-image-761" title="Comparar Archivos con Eclipse 1" src="http://gustavopeiretti.com/blog/wp-content/uploads/2009/09/compare_file_eclipse1.png" alt="Comparar Archivos con Eclipse 1" width="249" height="40" /></a><br />
<a rel="attachment wp-att-762" href="http://gustavopeiretti.com/2009/comparar-archivos-con-eclipse/compare_file_eclipse2/"><img class="aligncenter size-full wp-image-762" title="Comparar Archivos con Eclipse 2" src="http://gustavopeiretti.com/blog/wp-content/uploads/2009/09/compare_file_eclipse2.png" alt="Comparar Archivos con Eclipse 2" width="374" height="69" /></a></p>
<p>Compare Each Other&#8230;</p>
<p style="text-align: center;"><a rel="attachment wp-att-763" href="http://gustavopeiretti.com/2009/comparar-archivos-con-eclipse/compare_file_eclipse3/"><img class="aligncenter size-full wp-image-763" title="Comparar Archivos con Eclipse 3" src="http://gustavopeiretti.com/blog/wp-content/uploads/2009/09/compare_file_eclipse3.png" alt="Comparar Archivos con Eclipse 3" width="590" height="355" /></a></p>
<p style="text-align: center;">
]]></content:encoded>
			<wfw:commentRss>http://gustavopeiretti.com/2009/comparar-archivos-con-eclipse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mejora la calidad de tu software con testing</title>
		<link>http://gustavopeiretti.com/2009/mejora-calidad-software-testing/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mejora-calidad-software-testing</link>
		<comments>http://gustavopeiretti.com/2009/mejora-calidad-software-testing/#comments</comments>
		<pubDate>Sun, 02 Aug 2009 02:13:28 +0000</pubDate>
		<dc:creator>Gustavo</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[JUnit]]></category>
		<category><![CDATA[Tecnología]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Util]]></category>

		<guid isPermaLink="false">http://gustavopeiretti.com/?p=638</guid>
		<description><![CDATA[Mejorar la calidad de tu software depende también de que hagas buenos test durante su desarrollo. Es importante tener presente en el ciclo de desarrollo las pruebas y orientarse hacia el testing para evitarse futuros e innecesarios problemas. Los test te ayudarán a encontrar errores, pero ten presente que aunque el test no falle, esto &#8230; </p><p><a class="more-link block-button" href="http://gustavopeiretti.com/2009/mejora-calidad-software-testing/">Continuar leyendo &#187;</a>]]></description>
			<content:encoded><![CDATA[<p><a rel="attachment wp-att-662" href="http://gustavopeiretti.com/2009/mejora-calidad-software-testing/testing_soft/"><img class="alignleft size-full wp-image-662" title="Testing" src="http://gustavopeiretti.com/blog/wp-content/uploads/2009/08/testing_soft.png" alt="Testing" width="128" height="128" /></a>Mejorar la calidad de tu software depende también de que hagas buenos test durante su desarrollo.</p>
<p>Es importante tener presente en el ciclo de desarrollo las pruebas y orientarse hacia el testing para evitarse futuros e innecesarios problemas. Los test te ayudarán a encontrar errores, pero ten presente que aunque el test no falle, esto no significa que el software no contenga errores.<br />
Como dijo ‘Dijkstra’ “…El testing prueba la presencia de errores pero no la ausencia de ellos…&#8221;</p>
<p>Hay que distinguir dos tipos de errores: los llamados errores de software o bugs y los errores de forma.<br />
Los errores de forma son aquellos en los cuales el software no falla en su código pero si en su funcionalidad, es decir no cumple con lo que se espera de ellos como resultado.</p>
<p>Los frameworks de testing como JUnit, TestNG te ayudarán principalmente con los bugs y otro poco con los errores de funcionalidad, pero estos últimos deben ser subsanados con un buen ciclo de entregas y retroalimentación continuo del software.<br />
Además, estos frameworks te serán de gran utilidad en entornos de aplicación ‘pesados’ donde probar el software significa, por ejemplo, levantar un servidor web.</p>
<p>Otro punto positivo, es que si diseñas buenas suites de pruebas, podrás  luego,  ante un cambio por mantenimiento en tu software,  realizar una prueba integral de todos los módulos del mismo verificando que no hayas ‘roto’ alguna otra cosa.<br />
Testear el software es poco divertido (al menos para mí) y apoyarse en un buen framework de testing ayuda a aliviar en parte esa tediosa (pero necesaria) tarea de probar el software. Una vez que tienes hecho el test, lo ejecutas las veces que quieras.</p>
<p>JUnit es un clásico de los test, muy conocido y muy integrado a los principales entornos de desarrollo.<br />
TestNG es otra buena opción para realizar tus pruebas.</p>
<p>Veamos un poco de JUnit con un simple ejemplo:</p>
<h3><a href="http://www.junit.org/">JUnit</a></h3>
<p style="text-align: center;"><img src="file:///C:/DOCUME%7E1/gustavo/CONFIG%7E1/Temp/moz-screenshot-4.png" alt="" /><a rel="attachment wp-att-639" href="http://gustavopeiretti.com/2009/mejora-calidad-software-testing/junit-run/"><img class="size-full wp-image-639 aligncenter" title="junit-run" src="http://gustavopeiretti.com/blog/wp-content/uploads/2009/08/junit-run.png" alt="junit-run" width="525" height="53" /></a></p>
<p style="text-align: left;">Esta es la consola de JUnit<br />
<a rel="attachment wp-att-640" href="http://gustavopeiretti.com/2009/mejora-calidad-software-testing/junit-console/"><img class="size-full wp-image-640 aligncenter" title="junit-console" src="http://gustavopeiretti.com/blog/wp-content/uploads/2009/08/junit-console.png" alt="junit-console" width="571" height="88" /></a></p>
<p>Anotaciones mas usadas:</p>
<p>@BeforeClass:  se ejecuta una sola vez para todos los test. Util para inicializar variables u otros datos que serán compartidos.<br />
@AfterClass: se ejecuta una sola vez al finalizar los test.<br />
@Before: se ejecuta previo al iniciar cada @Test.<br />
@After: se ejecuta luego de cada @Test<br />
@Test: metodo que será ejecutado como test.</p>
<p>Nuestra clase de test JUnit…<br />
&#8212;&#8212;-</p>
<pre style="color:#000000;background:#ffffff;"><span style="color:#800000; font-weight:bold; ">import</span><span style="color:#004a43; "> org</span><span style="color:#808030; ">.</span><span style="color:#004a43; ">junit</span><span style="color:#808030; ">.</span><span style="color:#004a43; ">After</span><span style="color:#800080; ">;</span>
<span style="color:#800000; font-weight:bold; ">import</span><span style="color:#004a43; "> org</span><span style="color:#808030; ">.</span><span style="color:#004a43; ">junit</span><span style="color:#808030; ">.</span><span style="color:#004a43; ">Assert</span><span style="color:#800080; ">;</span>
<span style="color:#800000; font-weight:bold; ">import</span><span style="color:#004a43; "> org</span><span style="color:#808030; ">.</span><span style="color:#004a43; ">junit</span><span style="color:#808030; ">.</span><span style="color:#004a43; ">Before</span><span style="color:#800080; ">;</span>
<span style="color:#800000; font-weight:bold; ">import</span><span style="color:#004a43; "> org</span><span style="color:#808030; ">.</span><span style="color:#004a43; ">junit</span><span style="color:#808030; ">.</span><span style="color:#004a43; ">Ignore</span><span style="color:#800080; ">;</span>
<span style="color:#800000; font-weight:bold; ">import</span><span style="color:#004a43; "> org</span><span style="color:#808030; ">.</span><span style="color:#004a43; ">junit</span><span style="color:#808030; ">.</span><span style="color:#004a43; ">Test</span><span style="color:#800080; ">;</span>

<span style="color:#800000; font-weight:bold; ">public</span> <span style="color:#800000; font-weight:bold; ">class</span> SimpleTestJUnit <span style="color:#800080; ">{</span>

    Calculator calc<span style="color:#800080; ">;</span>

    <span style="color:#808030; ">@</span>Before
    <span style="color:#800000; font-weight:bold; ">public</span> <span style="color:#bb7977; ">void</span> setUp<span style="color:#808030; ">(</span><span style="color:#808030; ">)</span> <span style="color:#800080; ">{</span>
        <span style="color:#696969; ">// Before indica que debe ejecutrarse antes de iniciar el test...</span>
        <span style="color:#bb7977; font-weight:bold; ">System</span><span style="color:#808030; ">.</span>out<span style="color:#808030; ">.</span>println<span style="color:#808030; ">(</span><span style="color:#0000e6; ">"Ejecutando SimpleTest.setUp ..."</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span>
        calc <span style="color:#808030; ">=</span> <span style="color:#800000; font-weight:bold; ">new</span> Calculator<span style="color:#808030; ">(</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span>
    <span style="color:#800080; ">}</span>

    <span style="color:#808030; ">@</span>After
    <span style="color:#800000; font-weight:bold; ">public</span> <span style="color:#bb7977; ">void</span> after<span style="color:#808030; ">(</span><span style="color:#808030; ">)</span> <span style="color:#800080; ">{</span>
        <span style="color:#696969; ">// After indica que debe ejecutrarse despues del test...</span>
        <span style="color:#bb7977; font-weight:bold; ">System</span><span style="color:#808030; ">.</span>out<span style="color:#808030; ">.</span>println<span style="color:#808030; ">(</span><span style="color:#0000e6; ">"Ejecutando SimpleTest.after..."</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span>
    <span style="color:#800080; ">}</span>

    <span style="color:#808030; ">@</span>Test
    <span style="color:#800000; font-weight:bold; ">public</span> <span style="color:#bb7977; ">void</span> testDivision<span style="color:#808030; ">(</span><span style="color:#808030; ">)</span> <span style="color:#800080; ">{</span>
        <span style="color:#bb7977; font-weight:bold; ">System</span><span style="color:#808030; ">.</span>out<span style="color:#808030; ">.</span>println<span style="color:#808030; ">(</span><span style="color:#0000e6; ">"Ejecutando SimpleTest.testDivision..."</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span>
        <span style="color:#bb7977; font-weight:bold; ">System</span><span style="color:#808030; ">.</span>out<span style="color:#808030; ">.</span>println<span style="color:#808030; ">(</span>calc<span style="color:#808030; ">.</span>getDivision<span style="color:#808030; ">(</span><span style="color:#008c00; ">10</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">3</span><span style="color:#808030; ">)</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span>
    <span style="color:#800080; ">}</span>

    <span style="color:#808030; ">@</span>Test
    <span style="color:#800000; font-weight:bold; ">public</span> <span style="color:#bb7977; ">void</span> testDivisionByZero<span style="color:#808030; ">(</span><span style="color:#808030; ">)</span> <span style="color:#800080; ">{</span>
        <span style="color:#696969; ">// este test se ejecutara con error</span>
        <span style="color:#bb7977; font-weight:bold; ">System</span><span style="color:#808030; ">.</span>out<span style="color:#808030; ">.</span>println<span style="color:#808030; ">(</span><span style="color:#0000e6; ">"Ejecutando SimpleTest.testDivisionByZero..."</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span>
        <span style="color:#bb7977; font-weight:bold; ">System</span><span style="color:#808030; ">.</span>out<span style="color:#808030; ">.</span>println<span style="color:#808030; ">(</span>calc<span style="color:#808030; ">.</span>getDivision<span style="color:#808030; ">(</span><span style="color:#008c00; ">10</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">0</span><span style="color:#808030; ">)</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span>
    <span style="color:#800080; ">}</span>

    <span style="color:#808030; ">@</span>Test<span style="color:#808030; ">(</span>expected <span style="color:#808030; ">=</span> <span style="color:#bb7977; font-weight:bold; ">ArithmeticException</span><span style="color:#808030; ">.</span>class<span style="color:#808030; ">)</span>
    <span style="color:#800000; font-weight:bold; ">public</span> <span style="color:#bb7977; ">void</span> testDivisionByZeroWithExpectedException<span style="color:#808030; ">(</span><span style="color:#808030; ">)</span> <span style="color:#800080; ">{</span>
        <span style="color:#696969; ">// Este test no dara error. Esperamos la exception ArithmeticException</span>
        <span style="color:#bb7977; font-weight:bold; ">System</span><span style="color:#808030; ">.</span>out<span style="color:#808030; ">.</span>println<span style="color:#808030; ">(</span><span style="color:#0000e6; ">"Ejecutando SimpleTest.testDivisionByZeroWithExpectedException..."</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span>
        <span style="color:#bb7977; font-weight:bold; ">System</span><span style="color:#808030; ">.</span>out<span style="color:#808030; ">.</span>println<span style="color:#808030; ">(</span>calc<span style="color:#808030; ">.</span>getDivision<span style="color:#808030; ">(</span><span style="color:#008c00; ">10</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">0</span><span style="color:#808030; ">)</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span>
    <span style="color:#800080; ">}</span>

    <span style="color:#808030; ">@</span>Test
    <span style="color:#800000; font-weight:bold; ">public</span> <span style="color:#bb7977; ">void</span> testPrimeNumber<span style="color:#808030; ">(</span><span style="color:#808030; ">)</span> <span style="color:#800080; ">{</span>
        <span style="color:#bb7977; font-weight:bold; ">System</span><span style="color:#808030; ">.</span>out<span style="color:#808030; ">.</span>println<span style="color:#808030; ">(</span><span style="color:#0000e6; ">"Ejecutando SimpleTest.testPrimeNumber..."</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span>
        <span style="color:#bb7977; ">int</span> i <span style="color:#808030; ">=</span> <span style="color:#008c00; ">10</span><span style="color:#800080; ">;</span>
        <span style="color:#bb7977; ">int</span> j <span style="color:#808030; ">=</span> <span style="color:#008c00; ">5</span><span style="color:#800080; ">;</span>
        <span style="color:#bb7977; font-weight:bold; ">System</span><span style="color:#808030; ">.</span>out<span style="color:#808030; ">.</span>println<span style="color:#808030; ">(</span><span style="color:#0000e6; ">"Es numero primo: "</span> <span style="color:#808030; ">+</span> calc<span style="color:#808030; ">.</span>isPrimeNumber<span style="color:#808030; ">(</span>i<span style="color:#808030; ">,</span> j<span style="color:#808030; ">)</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span>
        Assert<span style="color:#808030; ">.</span>assertTrue<span style="color:#808030; ">(</span>calc<span style="color:#808030; ">.</span>getRest<span style="color:#808030; ">(</span>i<span style="color:#808030; ">,</span> j<span style="color:#808030; ">)</span> <span style="color:#808030; ">=</span><span style="color:#808030; ">=</span> <span style="color:#008c00; ">0</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span>
    <span style="color:#800080; ">}</span>

    <span style="color:#808030; ">@</span>Ignore
    <span style="color:#808030; ">@</span>Test
    <span style="color:#800000; font-weight:bold; ">public</span> <span style="color:#bb7977; ">void</span> testIgnore<span style="color:#808030; ">(</span><span style="color:#808030; ">)</span> <span style="color:#800080; ">{</span>
        <span style="color:#696969; ">// NO se ejecutara debido a que tiene la anotacion @Ignore...</span>
        <span style="color:#bb7977; font-weight:bold; ">System</span><span style="color:#808030; ">.</span>out<span style="color:#808030; ">.</span>println<span style="color:#808030; ">(</span><span style="color:#0000e6; ">"SimpleTest.testIgnore..."</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span>
    <span style="color:#800080; ">}</span>

<span style="color:#800080; ">}</span></pre>
<p>&#8212;&#8212;&#8212;&#8211;<br />
Nuestra clase Calculator que usamos para este ejemplo es&#8230;<br />
&#8211;</p>
<pre style="color:#000000;background:#ffffff;"><span style="color:#800000; font-weight:bold; ">public</span> <span style="color:#800000; font-weight:bold; ">class</span> Calculator <span style="color:#800080; ">{</span>

    <span style="color:#800000; font-weight:bold; ">public</span> <span style="color:#bb7977; ">double</span> getDivision<span style="color:#808030; ">(</span><span style="color:#bb7977; ">int</span> v1<span style="color:#808030; ">,</span> <span style="color:#bb7977; ">int</span> v2<span style="color:#808030; ">)</span><span style="color:#800080; ">{</span>
        <span style="color:#bb7977; ">int</span> i <span style="color:#808030; ">=</span> v1 <span style="color:#808030; ">/</span> v2 <span style="color:#800080; ">;</span>
        <span style="color:#800000; font-weight:bold; ">return</span> i<span style="color:#800080; ">;</span>
    <span style="color:#800080; ">}</span>

    <span style="color:#800000; font-weight:bold; ">public</span> <span style="color:#bb7977; ">double</span> getRest<span style="color:#808030; ">(</span><span style="color:#bb7977; ">int</span> v1<span style="color:#808030; ">,</span> <span style="color:#bb7977; ">int</span> v2<span style="color:#808030; ">)</span><span style="color:#800080; ">{</span>
        <span style="color:#bb7977; ">double</span> i <span style="color:#808030; ">=</span> v1 <span style="color:#808030; ">%</span> v2<span style="color:#800080; ">;</span>
        <span style="color:#800000; font-weight:bold; ">return</span> i<span style="color:#800080; ">;</span>
    <span style="color:#800080; ">}</span>

    <span style="color:#800000; font-weight:bold; ">public</span> <span style="color:#bb7977; ">boolean</span> isPrimeNumber<span style="color:#808030; ">(</span><span style="color:#bb7977; ">int</span> v1<span style="color:#808030; ">,</span> <span style="color:#bb7977; ">int</span> v2<span style="color:#808030; ">)</span><span style="color:#800080; ">{</span>
        <span style="color:#800000; font-weight:bold; ">return</span> getRest<span style="color:#808030; ">(</span>v1<span style="color:#808030; ">,</span> v2<span style="color:#808030; ">)</span> <span style="color:#808030; ">=</span><span style="color:#808030; ">=</span> <span style="color:#008c00; ">0</span><span style="color:#800080; ">;</span>
    <span style="color:#800080; ">}</span>

<span style="color:#800080; ">}</span></pre>
<p>&#8211;<br />
Ahora armaremos un suite para ejecutar varios test’s juntos…<br />
Defines una clase con las dos anotaciones que se muestran, en una de ellas ‘SuiteClasses’ indicarás los test a ejecutar.</p>
<pre style="color:#000000;background:#ffffff;"><span style="color:#800000; font-weight:bold; ">import</span><span style="color:#004a43; "> org</span><span style="color:#808030; ">.</span><span style="color:#004a43; ">junit</span><span style="color:#808030; ">.</span><span style="color:#004a43; ">runner</span><span style="color:#808030; ">.</span><span style="color:#004a43; ">RunWith</span><span style="color:#800080; ">;</span>
<span style="color:#800000; font-weight:bold; ">import</span><span style="color:#004a43; "> org</span><span style="color:#808030; ">.</span><span style="color:#004a43; ">junit</span><span style="color:#808030; ">.</span><span style="color:#004a43; ">runners</span><span style="color:#808030; ">.</span><span style="color:#004a43; ">Suite</span><span style="color:#800080; ">;</span>
<span style="color:#800000; font-weight:bold; ">import</span><span style="color:#004a43; "> org</span><span style="color:#808030; ">.</span><span style="color:#004a43; ">junit</span><span style="color:#808030; ">.</span><span style="color:#004a43; ">runners</span><span style="color:#808030; ">.</span><span style="color:#004a43; ">Suite</span><span style="color:#808030; ">.</span><span style="color:#004a43; ">SuiteClasses</span><span style="color:#800080; ">;</span>

@RunWith(Suite.class)
@SuiteClasses( <span style="color:#800080; ">{</span> SimpleTestJUnit<span style="color:#808030; ">.</span>class<span style="color:#808030; ">,</span> SimpleTestJUnit2<span style="color:#808030; ">.</span>class<span style="color:#800080; ">}</span>)
<span style="color:#800000; font-weight:bold; ">public</span> <span style="color:#800000; font-weight:bold; ">class</span> AllTests <span style="color:#800080; ">{</span>

    <span style="color:#800000; font-weight:bold; ">public</span> <span style="color:#800000; font-weight:bold; ">static</span> <span style="color:#bb7977; ">void</span> main<span style="color:#808030; ">(</span><span style="color:#bb7977; font-weight:bold; ">String</span><span style="color:#808030; ">[</span><span style="color:#808030; ">]</span> args<span style="color:#808030; ">)</span> <span style="color:#800080; ">{</span>
        <span style="color:#696969; ">// esta clase ejecutara los test's definidos en @SuiteClasses</span>
    <span style="color:#800080; ">}</span>

<span style="color:#800080; ">}</span></pre>
<p>&#8212;&#8212;</p>
<h3><a href="http://testng.org/doc/documentation-main.html">TestNG</a></h3>
<p>Si conoces JUnit te resultará mas que fácil usarlo y si no, verás que es muy parecido a JUnit<br />
Este framework se integra a Eclipse con su plug-in</p>
<p style="text-align: center;"><a rel="attachment wp-att-641" href="http://gustavopeiretti.com/2009/mejora-calidad-software-testing/testng-run/"><img class="size-full wp-image-641 aligncenter" title="testng-run" src="http://gustavopeiretti.com/blog/wp-content/uploads/2009/08/testng-run.png" alt="testng-run" width="528" height="95" /></a></p>
<p>Esta es la consola de TestNG (muy similar a la de JUnit)</p>
<p style="text-align: center;"><a rel="attachment wp-att-642" href="http://gustavopeiretti.com/2009/mejora-calidad-software-testing/testng-console/"><img class="size-full wp-image-642 aligncenter" title="testng-console" src="http://gustavopeiretti.com/blog/wp-content/uploads/2009/08/testng-console.png" alt="testng-console" width="571" height="150" /></a></p>
<p><a onmousedown="if(document.getElementById('divTestNG').style.display == 'none'){ document.getElementById('divTestNG').style.display = 'block'; }else{ document.getElementById('divTestNG').style.display = 'none'; }" href="javascript:;"><br />
Haz click aqui para ver un test simple con TestNG …<br />
</a></p>
<div id="divTestNG" style="display:none">&#8212;</p>
<pre style="color:#000000;background:#ffffff;"><span style="color:#800000; font-weight:bold; ">import</span><span style="color:#004a43; "> org</span><span style="color:#808030; ">.</span><span style="color:#004a43; ">testng</span><span style="color:#808030; ">.</span><span style="color:#004a43; ">annotations</span><span style="color:#808030; ">.</span><span style="color:#004a43; ">AfterTest</span><span style="color:#800080; ">;</span>
<span style="color:#800000; font-weight:bold; ">import</span><span style="color:#004a43; "> org</span><span style="color:#808030; ">.</span><span style="color:#004a43; ">testng</span><span style="color:#808030; ">.</span><span style="color:#004a43; ">annotations</span><span style="color:#808030; ">.</span><span style="color:#004a43; ">BeforeTest</span><span style="color:#800080; ">;</span>
<span style="color:#800000; font-weight:bold; ">import</span><span style="color:#004a43; "> org</span><span style="color:#808030; ">.</span><span style="color:#004a43; ">testng</span><span style="color:#808030; ">.</span><span style="color:#004a43; ">annotations</span><span style="color:#808030; ">.</span><span style="color:#004a43; ">Test</span><span style="color:#800080; ">;</span>

<span style="color:#800000; font-weight:bold; ">public</span> <span style="color:#800000; font-weight:bold; ">class</span> SimpleTestNG <span style="color:#800080; ">{</span>

    <span style="color:#808030; ">@</span>BeforeTest<span style="color:#808030; ">(</span>dependsOnMethods <span style="color:#808030; ">=</span> <span style="color:#0000e6; ">"setup"</span><span style="color:#808030; ">)</span>
    <span style="color:#800000; font-weight:bold; ">public</span> <span style="color:#bb7977; ">void</span> before<span style="color:#808030; ">(</span><span style="color:#808030; ">)</span> <span style="color:#800080; ">{</span>
        <span style="color:#696969; ">// BeforeTest indica que debe ejecutarrse antes de iniciar los test. </span>
        <span style="color:#696969; ">// Antes se ejecutara 'setup' debido a que esta indicado con 'dependsOnMethods'</span>
        <span style="color:#bb7977; font-weight:bold; ">System</span><span style="color:#808030; ">.</span>out<span style="color:#808030; ">.</span>println<span style="color:#808030; ">(</span><span style="color:#0000e6; ">"Ejecutando SimpleTest.before (antes debio ejecutarse setup)..."</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span>
    <span style="color:#800080; ">}</span>

    <span style="color:#808030; ">@</span>BeforeTest
    <span style="color:#800000; font-weight:bold; ">public</span> <span style="color:#bb7977; ">void</span> setup<span style="color:#808030; ">(</span><span style="color:#808030; ">)</span><span style="color:#800080; ">{</span>
        <span style="color:#bb7977; font-weight:bold; ">System</span><span style="color:#808030; ">.</span>out<span style="color:#808030; ">.</span>println<span style="color:#808030; ">(</span><span style="color:#0000e6; ">"Ejecutando SimpleTest.setup..."</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span>
    <span style="color:#800080; ">}</span>

    <span style="color:#808030; ">@</span>AfterTest
    <span style="color:#800000; font-weight:bold; ">public</span> <span style="color:#bb7977; ">void</span> after<span style="color:#808030; ">(</span><span style="color:#808030; ">)</span> <span style="color:#800080; ">{</span>
        <span style="color:#696969; ">// AfterTest indica que debe ejecutrarse despues. </span>
        <span style="color:#bb7977; font-weight:bold; ">System</span><span style="color:#808030; ">.</span>out<span style="color:#808030; ">.</span>println<span style="color:#808030; ">(</span><span style="color:#0000e6; ">"Ejecutando SimpleTest.after..."</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span>
    <span style="color:#800080; ">}</span>    

    <span style="color:#808030; ">@</span>Test
    <span style="color:#800000; font-weight:bold; ">public</span> <span style="color:#bb7977; ">void</span> test<span style="color:#808030; ">(</span><span style="color:#808030; ">)</span> <span style="color:#800080; ">{</span>
        <span style="color:#696969; ">// este es el test a ejecutarse...</span>
        <span style="color:#696969; ">//... tu logica y llamadas a las clases que hace a la logica de negocio...</span>
        <span style="color:#bb7977; font-weight:bold; ">System</span><span style="color:#808030; ">.</span>out<span style="color:#808030; ">.</span>println<span style="color:#808030; ">(</span><span style="color:#0000e6; ">"Ejecutando SimpleTest.test..."</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span>
    <span style="color:#800080; ">}</span>

    <span style="color:#808030; ">@</span>Test<span style="color:#808030; ">(</span>expectedExceptions<span style="color:#808030; ">=</span><span style="color:#800080; ">{</span><span style="color:#bb7977; font-weight:bold; ">RuntimeException</span><span style="color:#808030; ">.</span>class<span style="color:#800080; ">}</span><span style="color:#808030; ">)</span>
    <span style="color:#800000; font-weight:bold; ">public</span> <span style="color:#bb7977; ">void</span> test2<span style="color:#808030; ">(</span><span style="color:#808030; ">)</span> <span style="color:#800080; ">{</span>
        <span style="color:#bb7977; font-weight:bold; ">System</span><span style="color:#808030; ">.</span>out<span style="color:#808030; ">.</span>println<span style="color:#808030; ">(</span><span style="color:#0000e6; ">"Ejecutando SimpleTest.test2..."</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span>
        <span style="color:#696969; ">//Se espera que este test tire una expcetion 'RuntimeException'</span>
        <span style="color:#696969; ">//Si no ocurre la exception el test sera fallido</span>
        <span style="color:#696969; ">//throw new RuntimeException("Error esperado"); // si se comenta fallara el test </span>
    <span style="color:#800080; ">}</span>

    <span style="color:#808030; ">@</span>Test<span style="color:#808030; ">(</span>enabled <span style="color:#808030; ">=</span> <span style="color:#800000; font-weight:bold; ">false</span><span style="color:#808030; ">)</span>
    <span style="color:#800000; font-weight:bold; ">public</span> <span style="color:#bb7977; ">void</span> test3<span style="color:#808030; ">(</span><span style="color:#808030; ">)</span> <span style="color:#800080; ">{</span>
        <span style="color:#696969; ">// NO se ejecutara debido a que 'enabled = false'</span>
        <span style="color:#bb7977; font-weight:bold; ">System</span><span style="color:#808030; ">.</span>out<span style="color:#808030; ">.</span>println<span style="color:#808030; ">(</span><span style="color:#0000e6; ">"Ejecutando SimpleTest.test3..."</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span>
    <span style="color:#800080; ">}</span>

<span style="color:#800080; ">}</span></pre>
<p>&#8212;</p></div>
<p>En TestNG podemos crear también una suite de test’s.<br />
Este xml ejecutará dos test SimpleTestNG, y SimpleTestNG2.<br />
Solo debes ejecutarlo con el menú de TestNG</p>
<pre style="color:#000000;background:#ffffff;"><span style="color:#004a43; ">&lt;!</span><span style="color:#004a43; ">DOCTYPE</span> <span style="color:#004a43; ">suite</span> <span style="color:#800000; font-weight:bold; ">SYSTEM</span> <span style="color:#0000e6; ">"http://testng.org/testng-1.0.dtd"</span> <span style="color:#004a43; ">&gt;</span>

<span style="color:#a65700; ">&lt;</span><span style="color:#5f5035; ">suite</span> <span style="color:#274796; ">name</span><span style="color:#808030; ">=</span><span style="color:#0000e6; ">"</span><span style="color:#0000e6; ">SuiteSimpleTests</span><span style="color:#0000e6; ">"</span>    <span style="color:#274796; ">verbose</span><span style="color:#808030; ">=</span><span style="color:#0000e6; ">"</span><span style="color:#0000e6; ">1</span><span style="color:#0000e6; ">"</span> <span style="color:#a65700; ">&gt;</span>
  <span style="color:#a65700; ">&lt;</span><span style="color:#5f5035; ">test</span> <span style="color:#274796; ">name</span><span style="color:#808030; ">=</span><span style="color:#0000e6; ">"</span><span style="color:#0000e6; ">GroupTest1</span><span style="color:#0000e6; ">"</span>   <span style="color:#a65700; ">&gt;</span>
    <span style="color:#a65700; ">&lt;</span><span style="color:#5f5035; ">classes</span><span style="color:#a65700; ">&gt;</span>
      <span style="color:#a65700; ">&lt;</span><span style="color:#5f5035; ">class</span> <span style="color:#274796; ">name</span><span style="color:#808030; ">=</span><span style="color:#0000e6; ">"</span><span style="color:#0000e6; ">test.SimpleTestNG</span><span style="color:#0000e6; ">"</span><span style="color:#a65700; ">/&gt;</span>
      <span style="color:#a65700; ">&lt;</span><span style="color:#5f5035; ">class</span> <span style="color:#274796; ">name</span><span style="color:#808030; ">=</span><span style="color:#0000e6; ">"</span><span style="color:#0000e6; ">test.SimpleTestNG2</span><span style="color:#0000e6; ">"</span><span style="color:#a65700; ">/&gt;</span>
    <span style="color:#a65700; ">&lt;/</span><span style="color:#5f5035; ">classes</span><span style="color:#a65700; ">&gt;</span>
  <span style="color:#a65700; ">&lt;/</span><span style="color:#5f5035; ">test</span><span style="color:#a65700; ">&gt;</span>
<span style="color:#a65700; ">&lt;/</span><span style="color:#5f5035; ">suite</span><span style="color:#a65700; ">&gt;</span></pre>
<p>Como vez, los frameworks son bastante simples de utilizar, es solo cuestión de que te hagas el hábito de trabajar pensando y orientandote al testing. Pronto verás los beneficios que te trae para la calidad de tu software.<br />
Espero te haya servido.</p>
<p>Enlaces: <a href="http://www.junit.org/">JUnit</a> <a href="http://testng.org/doc/documentation-main.html">TestNG</a></p>
]]></content:encoded>
			<wfw:commentRss>http://gustavopeiretti.com/2009/mejora-calidad-software-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recuperar correo borrado en Thunderbird</title>
		<link>http://gustavopeiretti.com/2009/recuperar-correo-borrado-en-thunderbird/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=recuperar-correo-borrado-en-thunderbird</link>
		<comments>http://gustavopeiretti.com/2009/recuperar-correo-borrado-en-thunderbird/#comments</comments>
		<pubDate>Sun, 14 Jun 2009 01:50:07 +0000</pubDate>
		<dc:creator>Gustavo</dc:creator>
				<category><![CDATA[Tecnología]]></category>
		<category><![CDATA[Thunderbird]]></category>
		<category><![CDATA[Util]]></category>

		<guid isPermaLink="false">http://gustavopeiretti.com.ar/?p=440</guid>
		<description><![CDATA[Como recuperar un mail o correo borrado &#8216;definitivamente&#8217; en Mozilla Thunderbird. Si borraste un mail importante también de la papelera, y necesitas recuperarlo, todavía tienes una oportunidad de hacerlo; siempre y cuando no hayas compactado las carpetas. Cierra completamente tu cliente de correo (Control + Q) Busca la carpeta dónde Thunderbird guarda los archivos de &#8230; </p><p><a class="more-link block-button" href="http://gustavopeiretti.com/2009/recuperar-correo-borrado-en-thunderbird/">Continuar leyendo &#187;</a>]]></description>
			<content:encoded><![CDATA[<p><a rel="attachment wp-att-457" href="http://gustavopeiretti.com/2009/recuperar-correo-borrado-en-thunderbird/mail_delete/"><img class="alignleft size-full wp-image-457" title="Recuperar Mail" src="http://gustavopeiretti.com.ar/blog/wp-content/uploads/2009/06/mail_delete.png" alt="Recuperar Mail" width="70" height="70" /></a>Como recuperar un mail o correo borrado &#8216;definitivamente&#8217; en Mozilla Thunderbird.<br />
Si borraste un mail importante también de la papelera, y necesitas recuperarlo, todavía tienes una oportunidad de hacerlo; siempre y cuando no hayas compactado las carpetas.</p>
<ol>
<li>Cierra completamente tu cliente de correo (Control + Q)</li>
<li>Busca la carpeta dónde Thunderbird guarda los archivos de correo. La puedes encontrar en las propiedades de la cuenta. Botón derecho sobre la cuenta, Propiedades / Configuración de la Cuenta / Configuración del Servidor;  buscas “Directorio Local”.</li>
<li>Haz backup de los archivos con los que vas a trabajar.</li>
<li>Eliminas el archivo Trash.msf  (este archivo es un cache y lo creará nuevamente Thunder al iniciar).</li>
<li>Editas el archivo Trash (sin extensión) con algún editor de texto como <a href="http://notepad-plus.sourceforge.net/es/site.htm" target="_blank">Notepad++</a>,  por ejemplo. (Ojo si el archivo es demasiado pesado, será difícil que lo puedas abrir).</li>
<li>Buscas tu mail borrado, usando el asunto o alguna parte del texto del  que conozcas.</li>
<li>Editas la cabecera y cambias el valor X-Mozilla-Status: 0009 al valor 0000.</li>
<li>Abres Thunderbird y con un poco de suerte tendrás tu mensaje recuperado.</li>
</ol>
<p>No olvides siempre hacer antes una copia de respaldo de tus archivos en otro lugar,  por si algo va mal.<br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/YjTtx-uBYDk&amp;hl=es&amp;fs=1&amp;rel=0" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/YjTtx-uBYDk&amp;hl=es&amp;fs=1&amp;rel=0" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://gustavopeiretti.com/2009/recuperar-correo-borrado-en-thunderbird/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

