Skip to main content

Publishing xml

I always had the problem in my posts to include xml snippets. A problem other people must have experienced too. I came across the blogger site: http://formatmysourcecode.blogspot.com/. It allows to copy your xml, paste and convert it. An example is below, it should show xml ...


<?xml version="1.0" encoding="UTF-8"?>
<templates>
        <template autoinsert="true" context="gettercomment_context"
                deleted="false" description="Comment for getter method" enabled="true"
                id="org.eclipse.jdt.ui.text.codetemplates.gettercomment"
                name="gettercomment">
                /** * @return the ${bare_field_name} */
        </template>
        <template autoinsert="true" context="delegatecomment_context"
                deleted="false" description="Comment for delegate methods"
                enabled="true"
                id="org.eclipse.jdt.ui.text.codetemplates.delegatecomment"
                name="delegatecomment">
                /** * ${tags} * ${see_to_target} */
        </template>

This is the xml with embedded stylesheet. Without stylesheet and with tab size2, it looks like:
<?xml version="1.0" encoding="UTF-8"?>
<templates>
        <template autoinsert="true" context="gettercomment_context"
                deleted="false" description="Comment for getter method" enabled="true"
                id="org.eclipse.jdt.ui.text.codetemplates.gettercomment"
                name="gettercomment">
                /** * @return the ${bare_field_name} */
        </template>
        <template autoinsert="true" context="delegatecomment_context"
                deleted="false" description="Comment for delegate methods"
                enabled="true"
                id="org.eclipse.jdt.ui.text.codetemplates.delegatecomment"
                name="delegatecomment">
                /** * ${tags} * ${see_to_target} */
        </template>

Comments

Popular posts from this blog

SSL handshake failed: Secure connection truncated

Got this problem on Ubuntu 9.10 and 10.10. svn co --username=xx https:/yy zz “SSL handshake failed: Secure connection truncated” According to this link bug-ubuntu The solution is: sudo apt-get install libneon27 cd /usr/lib/ sudo rm libneon-gnutls.so.27 sudo ln -s /usr/lib/libneon.so.27 libneon-gnutls.so.27

Junit4 running parallel junit classes

To run junit testcases parallel, you can create your own class to run junit with: Add this tag to your class declaration. @RunWith(Parallelized.class) Implementation of this class looks like: package mypackage; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import org.junit.runners.Parameterized; import org.junit.runners.model.RunnerScheduler; public class Parallelized extends Parameterized {         private static class ThreadPoolScheduler implements RunnerScheduler     {         private ExecutorService executor;                 public ThreadPoolScheduler()         {             String threads = System.getProperty("junit.parallel.threads", "16");    ...

Interactive selenium testing

The problem Location of elements When I started using selenium, I noticed that it is not easy to do it right. First you start with IDE, but you notice, that the IDE does not really record a lot. In a next step I added firebug, and started analyzing how the elements where to be located: either by tag, id, class etc. Junit testcase With this information I could then create my junit testcase: @Test public void testMapView() throws Exception { //assert that we cannot see submenu of MapCreator elem = driver.findElement(By.className(SeleniumConstants.MAP_SUB_MENU)); String style = elem.getAttribute("style"); assertTrue("Element must have style display off.",style.matches("display: none.*")); logger.debug("Located element " + SeleniumConstants.MAP_SUB_MENU); //find menu and click on mapview elem = driver.findElement(By.id(SeleniumConstants.MAP_CONTROL)); actions.moveToElement(elem).click().perform(); //assert su...