Tuesday, August 23, 2011

Missing Author field in Eclipse Team view

Okay so a few days ago I was installing some plugins for my SpringSource Tool Suite IDE and somehow corrupted the Team view such that it no longer displayed the Author field. After some Googling I was not able to find a solution so started digging into the plugins. Well the solution is pretty simple:

locate the dialog_settings.xml file in the {workspace}/.metadata/.plugins/org.eclipse.team.cvs.ui directory

open with favorite xml/text editor and look for this section, my issue had COL_AUTHOR had a value of 0, I changed to 135 and restarted Eclipse. All is well.

<section name="org.eclipse.team.internal.ccvs.ui.CVSHistoryTableProvider" >
<item value="188" key="COL_DATE"/>
<item value="277" key="COL_COMMENT"/>
<item value="136" key="COL_TAGS"/>
<item value="128" key="SORT_COL_DIRECTION"/>
<item value="COL_TAGS" key="SORT_COL_NAME"/>
<item value="160" key="COL_REVISIONID"/>
<item value="135" key="COL_AUTHOR"/>
</section>




Hope this was helpful.

Saturday, February 26, 2011

Eclipse Compare Files

Ever wonder how to compare two similar files in Eclipse? Well it's actually pretty simple once we look for it.

In the navigator view select both files using ctrl+click in the context menu (right click) choose Compare With>> Each Other.

That's it you get the standard diff window with side by side compare and edit capability. Oh and if one file is already open, no worries edits are all sychronized.


Hope this is helpful, gotta love Eclipse.

Tuesday, January 18, 2011

jMeter Beanshell example

Okay so today I wanted to extract a value from an html form select dropdown to use later in my test samples. The select dropdown has several options and each test iteration can yield a different one. So I needed to extract the value that is already selected when the page returns. I ran across several blogs and forum entries and one hinted that with some Java experience you can you the Beanshell post-processor. Never using Beanshell before I read up and yielded this simple script to do what I needed:


import java.util.regex.Pattern;
import java.util.regex.Matcher;
String stringData = new String(data);
Pattern p = Pattern.compile("<select name=\"creditCardAccount.creditCardType\">(.*?)</select>", Pattern.DOTALL);
Matcher m = p.matcher(stringData);
if (m.find())
{
String options = m.group(1);
p = Pattern.compile("<option.*value=\"(.*?)\".*selected=\"selected\">");
m = p.matcher(options);
if (m.find()){
vars.put("CCTYPE",m.group(1));
}else{
vars.put("CCTYPE","NOT FOUND");
log.debug("options pattern = " + p.toString());
}
}else{
vars.put("CCTYPE_SELECT","bsh pattern match failed");
}