Jenkins and Maven SQL Plugin for cleaning Postgresql database

How many times did you experienced issue, when you need to clean your database from unused data ?For example, you have a qa server with thousands of rows, which you don’t need anymore, so it’s time to delete them. To clean up your database, someone call separate scripts for each table, someone create-drops database.I decided to delete all tables. To remove all rows, you can use maven sql plugin, which has powerful possibilities for doing work with sql. First of all, if you have your maven application, I would reccomend to create separate module for sql. If you don’t want to do this, just leave it as it is in your root pom.xml. You will need to add Maven Sql Plugin. Then, you need to map execution to install goal. You will need to create resource folder.This will be the place, where you will store your scripts. Before we start I don’t want anyone to think, that such module is the best place for storing your database schemas creation.For this purposes there is a good framework called liquibase - it saves migration history and can surely know, what should be updated, and what should not. Such module is always good...

The Great Dictator's Speech

I’m sorry, but I don’t want to be an emperor. That’s not my business. I don’t want to rule or conquer anyone. I should like to help everyone - if possible - Jew, Gentile - black man - white. We all want to help one another. Human beings are like that. We want to live by each other’s happiness - not by each other’s misery. We don’t want to hate and despise one another. In this world there is room for everyone. And the good earth is rich and can provide for everyone. The way of life can be free and beautiful, but we have lost the way. Greed has poisoned men’s souls, has barricaded the world with hate, has goose-stepped us into misery and bloodshed. We have developed speed, but we have shut ourselves in. Machinery that gives abundance has left us in want. Our knowledge has made us cynical. Our cleverness, hard and unkind. We think too much and feel too little. More than machinery we need humanity. More than cleverness we need kindness and gentleness. Without these qualities, life will be violent and all will be lost…. !/images/photos/0000/0874/Great_Dictator_Pub_140-6_normal.jpg! The aeroplane and the radio have brought us closer...

Google Guice - Hello world example

It has been more than two years since I first acquainted with Spring Dependency Injection technology. At first, I didn’t understood what it was, but after few weeks I realized what powerful instrument do I have. From that time I started to love this type of object instantiation and I really don’t want to instantiate objects in some other way. But today I want to represent you a new framework for bean instantiation - Google Guice. So, how to try this Google Guice dependency injection framework ? First of all, open your Eclipse/InteliJIDEA IDE and create maven project: write groupId, artifactId and other things. After that, go to your pom.xml file and add additional dependency: Then, you should create interface NotificationService: We will have multiple implementations of above service to show posibillities of Google Guice Email service is one of the implementations of NotificationService One thing that I noticed is that Google Guice has it’s own @Singleton annotation - from JSR330. Google Guice 3.0 added the support for JSR-330 and we can use annotations from com.google.inject or javax.inject package. Next, we will create second implementation of NotificationService - FacebookService: Consumer class Since we are implementing dependency injection in our application,...

Spring XML Namespaces handling

You all know, that spring supports xml namespaces for defining custom bean definition. For example, if you want to set mvn annotation driven benavior, you can write such code in your xml As you noticed, there is no <bean … /> in this piece of code, but there is So, who is responsible for handling this namespaces? Answer is: NamespaceHandler For example, here is AnnotationDrivenBeanDefinitionParser implementation. Every Spring namespace has an associated NamespaceHandler implementation. The namespace schemas are mapped to schema files inside Spring JARs in various spring.schemas files. The XML schema namespaces are also mapped to handler classes in spring.handlers files (several as each Spring JAR might introduce different namespaces). For your convenience here is a list of most common namespaces: Spring core aop - AopNamespaceHandler c - SimpleConstructorNamespaceHandler cache - CacheNamespaceHandler context - ContextNamespaceHandler jdbc - JdbcNamespaceHandler jee - JeeNamespaceHandler jms - JmsNamespaceHandler lang - LangNamespaceHandler mvc - MvcNamespaceHandler oxm - OxmNamespaceHandler p - SimplePropertyNamespaceHandler task - TaskNamespaceHandler tx - TxNamespaceHandler util - UtilNamespaceHandler Spring Security security - SecurityNamespaceHandler oauth - OAuthSecurityNamespaceHandler Spring integration int - IntegrationNamespaceHandler amqp - AmqpNamespaceHandler event - EventNamespaceHandler feed - FeedNamespaceHandler file - FileNamespaceHandler ftp - FtpNamespaceHandler gemfire - GemfireIntegrationNamespaceHandler groovy - GroovyNamespaceHandler...

Getting started with Robot Framework

Robot Framework is a generic test automation framework for acceptance testing and acceptance test-driven development (ATDD). It has easy-to-use tabular test data syntax and it utilizes the keyword-driven testing approach. Its testing capabilities can be extended by test libraries implemented either with Python or Java, and users can create new higher-level keywords from existing ones using the same syntax that is used for creating test cases. Robot Framework is operating system and application independent. The core framework is implemented using Python and runs also on Jython (JVM) and IronPython (.NET). We will be using Robot Framework with Java + Maven build tool. Need to have Java. I use java 1.7 Maven. I use Maven 3.2.2 version Downloaded SeleniumLibrary. Willings to start something new and interesting :) Preparations All you gonna need to start using Robot Framework is his SeleniumLibrary, please, download it. So, just create a simple maven project with jar packaging. Open your project object model file - pom.xml and add Robot Framework plugin - After that, create two folders src/test/robotframework/acceptance src/test/resources/robotframework/libraries Then go to your downloaded library folder, find robotframework-seleniumlibrary-2.9.1.tar.gz, extract this tar archieve, open, go to src folder and copy robotframework-seleniumlibrary-2.9.1/src/SeleniumLibrary to {project folder}/src/test/resources/robotframework/libraries/SeleniumLibrary You should have...