venerdì 21 settembre 2012

Compilare PMD 5.0.x

Con la 5.0.x del 1/5/2012 la compilazione non si fa più con Ant, ma con MAVEN.
Adesso la guida da seguire è:
http://pmd.sourceforge.net/snapshot/compiling.html

Maven l'avevo già installato.
Il file POM.xml si scarica insieme ai sorgenti, quindi si può passare direttamente a compilare, ma.. anche in questo caso FoxyProxy Video Utility crea problemi.
Una volta scaricato il sorgente da https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/5.0.x
in una cartella locale ( ad es. C:\Users\Duccio\workspace\pmd-5.0.x), da cmd ci si sposta nella cartella in questione e si esegue:


mvn package

Anche in questo caso, come per Selenium, ottengo l'errore:



#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000180001b62, pid=5652, t
id=5936
#
# JRE version: 7.0_01-b08
# Java VM: Java HotSpot(TM) 64-Bit Server VM (21.1-b02 mixed mode windows-amd64
compressed oops)
# Problematic frame:
# C  [FPServiceProvider64.dll+0x1b62]
#
# Failed to write core dump. Minidumps are not enabled by default on client vers
ions of Windows
#
# An error report file with more information is saved as:
# C:\Users\Duccio\workspace\pmd-5.0.x\hs_err_pid5652.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
C:\Users\Duccio\workspace\pmd-5.0.x>

Disinstallando  FoxyProxy Video Utility e lanciando nuovamente 
mvn clean package
 parte la compilazione
http://sahi.co.in/sahi-pro/compare-sahi-os-and-sahi-pro/

Sahi is a mature, business-ready tool for automation of web application testing. Sahi is available as an Open Source free product and as Sahi Pro, the commercial version. For testing teams in product companies and captive IT units which need rapid reliable web automation, Sahi would be the best choice among web automation tools.

The Sahi Advantage

Sahi is especially suited for cross-browser/multi-browser testing of complex web 2.0 applications with lots of AJAX and dynamic content. Sahi works well in Agile development environments, enabling rapid automation and maintenance and easily integrating with build systems. Sahi saves time and effort with faster development, less maintenance and fast distributed playback. Sahi runs on any modern browser which supports javascript.

lunedì 17 settembre 2012

Command Line Subversion

http://code.google.com/p/westmont-risk/wiki/SvnTutorial

Installing Subversion

Subversion is a client-server system. The Subversion repository is maintained on the project web server. Subversion clients run on users' machines and connect to the Subversion server via the Internet. You must have a Subversion client on your local machine to access the Subversion server for projects hosted on this site. Clients are available for nearly all platforms. You can download a client for your operating system from the Subversion project download page .
While some people like using the Subversion command-line client, svn during development, TortoiseSVN is a good choice for users who prefer graphical interfaces. This guide covers instructions for command-line Subversion only.

Export da svn con automation




How can i use svn export command to get a single file from the repository.
I try this
svn export e:\repositories\process\test.txt c:\
but I get this:
svn: e:\repositories\process is not a working copy
share|improve this question

feedback

2 Answers

up vote12down voteaccepted
Guessing from your directory name, you are trying to access the repository on the local filesystem. You still need to use URL syntax to access it:
svn export file:///e:/repositories/process/test.txt c:\test.txt
share|improve this answer
feedback
You don't have to do this locally either. You can do it through a remote repository, for example:
svn export http://<repo>/process/test.txt /path/to/code/
There is a pretty good scenario based tutorial here for these kind of situations:http://www.duchnik.com/tutorials/vc/svn-command-reference
share|improve this answer

Eclipse Wizards

http://stackoverflow.com/questions/3710508/modify-eclipse-new-file-wizard


I would like to modify an already existing wizard in eclipse. My plan is to copy the existing wizard plugin to a new plugin an make the changes there. But how do I enable this modified wizard in eclipse?
I know how to create a local P2 update site but how do I make sure that the original wizard is replaced with the updated version?
share|improve this question

60% accept rate




This isn't an easy question, as Eclipse does not support changing existing wizards (and on global, Eclipse is built for adding features instead of replacing them).
Some ideas you could consider: you can define a new wizard, that can reuse existing pages, and simply add a new wizard, that does your trick, while the original one would stay.
How to install it: if you have a new wizard in a new plug-in, simply use the export wizard (Right click/Export), and there select the Deployable plug-ins and fragments wizard from the Plug-in development category. On the next page select the install into host feature, and the plug-in will be installed.
If you insist on replacing the plug-in (that is not the nice way), you could copy the entire existing plug-in, increase its version number and make your changes, then install this plug-in from an update site (or using the Eclipse wizard). Caveats: if the original plug-in is updated, yours have to be as well, and if both plug-ins have the same version, quite nice conflicts can be seen, that are quite hard to handle.
share|improve this answer
Thanks for the input! Currently I just create a new plugin which adds a new New File Wizard. But it could be nice to modify the "parent" wizard (which shows all the possible New File wizards) to only show selected number of wizards specified in the code - but I guess this gives the same problem. Alternatively I am considering this: wiki.eclipse.org/Steps_to_use_Fragments_to_patch_a_plug-in – u123 Sep 15 '10 at 15:58
Fragments only work, if the original plug-in was developed in a way to support fragments (see the second part where the host's manifest should be modified in the wiki). If you can modify the manifest, you have other ways to make differences in the code. E.g. add an option to the existing wizard to add new pages into it (e.g. using extension point, etc.) – Zoltán Ujhelyi Sep 17 '10 at 7:49


Which plugin is this?

Please forgive such a simple question, I've been away from RCP for about a year:
What shortcut/hot-key combination can I use in Eclipse to discover the plugin that contributed/owns the current view?
I remember it bringing up the plugin.xml of the plugin currently under the mouse.
I should be very grateful for your clues ..
The Plug-in Spy is mapped to Shift+Alt+F1 (Shift+Option+F1 on Mac) by default. It shows information for whatever is currently selected.
share|improve this answer


_________________________________________________________________________________

How do I update this plugin?

L'elenco dei plugin installati e relative versioni dovrebbero essere elencati in artifacts.xml della cartella di installazione di Eclipse.
Il plugin per il wizard del new java project dovrebbe essere:

    <artifact classifier='osgi.bundle' id='org.eclipse.jdt.ui' version='3.8.0.v20120524-1551'>
      <properties size='1'>
        <property name='download.size' value='10329219'/>
      </properties>
    </artifact>
che nella cartella plugin dovrebbe portare a org.eclipse.jdt.ui_3.8.0.v20120524-1551.jar


http://eclipse.dzone.com/news/effective-eclipse-custom-templ


http://bquot.com/wk

Integrare PMD nelle build di Eclipse

Ho installato il plugin di PMD su Eclipse, ma per eseguire l'anaalisi devo lanciare esplicitamente PMD.
Vorrei invece che pmd eseguisse l'analisi contestualmente alla build, senza che glielo chieda esplicitamente.

Ho pensato ad uno script ANT, ma anche in questo modo dovrei fare una configurazione ad ogni nuovo progetto.
Allora ho trovato un metodo più semplice: i builders.
Se non ho capito male occorre eseguire i seguenti passi:

1. Aggiungere due sezione al file .project:


<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>prova2</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>net.sourceforge.pmd.eclipse.plugin.pmdBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>net.sourceforge.pmd.eclipse.plugin.pmdNature</nature>
</natures>
</projectDescription>


2. Aggiungere un file .pmd nella root del progetto:

<?xml version="1.0" encoding="UTF-8"?>
<pmd>
    <useProjectRuleSet>true</useProjectRuleSet>
    <ruleSetFile>.ruleset</ruleSetFile>
    <includeDerivedFiles>false</includeDerivedFiles>
    <violationsAsErrors>true</violationsAsErrors>
</pmd>

3. Aggiungere il file .ruleset nella root del progetto contenenti le regole da applicare:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<ruleset xmlns="http://pmd.sf.net/ruleset/1.0.0" name="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd" xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd">
   <description/>
   <rule ref="rulesets/controversial.xml/NullAssignment"/>
   <rule ref="rulesets/controversial.xml/UnnecessaryConstructor"/>
   <rule ref="rulesets/finalizers.xml/AvoidCallingFinalize"/>
   <rule ref="rulesets/finalizers.xml/EmptyFinalizer"/>
   <rule ref="rulesets/finalizers.xml/FinalizeDoesNotCallSuperFinalize"/>
   <rule ref="rulesets/finalizers.xml/FinalizeOnlyCallsSuperFinalize"/>
   <rule ref="rulesets/finalizers.xml/FinalizeOverloaded"/>
</ruleset>



In questo modo l'analisi viene eseguita insieme alla build e i risultati sono visibili direttamente sull'IDE di Eclipse.

A volte ci sono dei problemi di sincronizzazione, ma nel complesso mi sembra funzionare.

Resta da capire come far sì che tutti i progetti Eclipse ereditino queste impostazioni.

vedi anche:
http://sourceforge.net/projects/pmd-eclipse/forums/forum/457016/topic/5326905
http://www.smartics.eu/config-smartics-pmd/
_________________________________________________________________
Template:
http://stackoverflow.com/questions/2092200/project-templates-eclipse-java