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...

How to setup java enviroment on server

Just to generalize all that I studied from administration field, I decided to write all steps needed to setup your java environment on the web. What will we need? Server/local machine.Say, you need to deploy your app on the web and you need a server. I will be using digitalocean for that purpose. Of course, you will need ssh access. Java Development Kit. I will be using jdk 1.7 Maven build tool. For building apps. We can setup as much tools, as we want(Ant, Gradle), I choosed maven because I use it in my daily development. Setting up ssh key If you already have ssh key , then you are free to skip this part. Go to your terminal and type ssh-keygen -t rsa You will be asked to enter ssh key location - I choosed ~/.ssh/id_rsa_example After that, executed: cat ~/.ssh/id_rsa_example.pub You will get public key, that you need to store in your digitalocean instance in SSH page Name this ssh and copy output from previous cat procedure. PS - Adding your ssh to digitalocean menu means, that when you will create server instance and choose that ssh key in wizard - it will automatically appear in server instance...