Blog

How to test EJB apps with Glassfish embedded container

There are many articles about EJB deploying and testing. But after one of my colleagues spent a week trying to make it work, I decided to write my own. I’ll describe the wrong path first and then correct it.

Continue reading How to test EJB apps with Glassfish embedded container

Advertisements

How to use TestNG in Gradle project

A statement: IntelliJ IDEA likes JUnit. Thing is, it’s gonna try to use JUnit even if you create a test with TestNG selected in settings. When you are ready to run your tests, you are probably about to encounter the following error: Test filtering is not supported for given version of JUnit. Please upgrade JUnit version to at least 4.6. Here is what needs to be done in this case:

  1. (optional) Add TestNG as Gradle dependency. At this moment you probably have it added by pressing ‘Fix’ button in ‘Create test’ dialog window. This is not a required step, I just prefer to have all the dependencies in one place.
  2. Explicitly tell Gradle to use TestNG as a testing framework.

Here’s how the modified build.gradle will look like:

apply plugin: 'java'
repositories {
mavenCentral()
}
dependencies {
testCompile 'org.testng:testng:6.9.4'
}
test {
useTestNG()
}

How to increase battery life of your Android (Pt.2)

droooooiiiids

This is the second part of my Android tweaking guide, first one can be found here. In this article we will talk about more complex solutions and tricks. As mentioned earlier, this is not a step-by-step guide, you are free to use any combination of advices, just be sure to check prerequisites first.

Continue reading How to increase battery life of your Android (Pt.2)

How to increase battery life of your Android (Pt.1)

Android

When we talk about Android battery life and its performance, there are plenty of best practices in the Internet. I decided to make my own guide, maybe someone will find it useful. This is not a step-by-step solution, you can use any of the following advices in whatever combination that seems to fit you (for example, you can try to improve stock ROM without flashing a custom one).

So, you are ready to tweak your green robot. Let’s see what you can do:

Continue reading How to increase battery life of your Android (Pt.1)

My first app translation

Not so long ago I have registered at XDA developers forum and started to participate in some community actions like beta testing and bug reporting. Then I found another nifty Android lockscreen notifications app called Notific, which didn’t have a Russian translation. I contacted the developer, Anand Bibek, and volunteered for it. Now, after some polishing, the translation is done and included in version 2.50 of the app.

If you want to try Notific, a free version with some restrictions can be found at XDA: http://forum.xda-developers.com/android/apps-games/app-notific-lockscreen-notification-t2804624

While you can download and install the free version, I am certainly encouraging you to purchase the full version from Google Play store and support the fellow developer Anand Bibek. Cheers.

P.S.: Image is linked from the Notific Play store page.

How to fix “Unable to start the daemon process” error in IntelliJ IDEA

There is another strange error that encounters from time to time at the start of IntelliJ IDEA. Gradle refuses to sync project with a following text:

error_daemon

I’ve found a good solution for it here, but it is for Eclipse. Some further analysis indicated that problem is actually in the insufficient amount of available RAM. After closing web browser (500 mb RAM to free) and pressing “Try Again” link in IDEA project has synced without any issues.

Lockscreen notifications in Android

Being able to see incoming notifications right on the lockscreen is a really convenient feature. iOS has it out of the box, Android can have it after a little tweaking. I tried to use several application which bring notifications to the lockscreen of my Galaxy S3 and here’s a brief overview of what I’ve discovered.

Continue reading Lockscreen notifications in Android