Translate

понеділок, 29 липня 2013 р.

Run your Unit Tests in Parallel


It was about time when the developer of Unit Tests had the ability to run the tests in Parallel using annotations. In today's blog post, we will look at how you can make your traditional Junit Tests to run in parallel using annotations provided by Easytest. EasyTest is a Testing Framework build on top of JUnit to provide you ease of writing and maintaining your tests. It is focused on writing Data Driven Tests for your application.


Lets start by assuming a Class ItemService  that has a method 2 methods :
1) getItems that takes 2 arguments Double itemId and String itemType. The API class is described below.
2)    updateItem that takes an Item instance and updates it in the Database.

public class ItemService {

   public List getItems (Double itemId , String itemType);

   public void updateItem (Item item);

}

We will leave out the implementation for the sake of keeping the example simple.

Lets see the step by step approach of writing Parallel Unit Tests.



вівторок, 23 липня 2013 р.

Java Concurrent Animated



Java Concurrent Animated

Victor Grazi дуже просто розказав про складний java.util.concurrent. 
Показав як і для чого використовуються  
  • Executors
  • Future
  • synchronized
  • ReentrantLock
  • Condition
  • Semaphore
  • ReadWriteLock
  • CountDownLatch
  • CyclicBarrier
  • Phaser
  • BlinkingPhaser
  • AtomicInteger
  • BlockingQueue
  • TransferQueue
  • CompletionService
  • ConcurrentHashMap
  • Fork/Join
Для презентації використана програма візуалізації, яку можна завантажити на його сайті - дуже зручно тим хто хоче ознайомитись з можливостями конкурентого API в Java чи має складності з розумінням. 


пʼятниця, 19 липня 2013 р.

Release: Appengine 1.8.2


Вийшла нова версія Google App Engine 
З новинок появилась підтримка PHP, а також підтримка Eclipse WTP і модульності, що потенційно спростить розробку аплікацій під екліпсом
Думаю також багатьом буде цікава підтримка git
Більше про новий реліз можна почитати тут
Як зразок аплікації запущеної на апенжіні можна подивитись на систему реєстрації на #JDayLviv

четвер, 18 липня 2013 р.

середа, 17 липня 2013 р.

Java’s Reflection API


If you have ever asked yourself questions like these:
– “How do I invoke a method, having only its name in a String?”
- “How do I list all the attributes in a class dynamically?”
- “How do I write a method that resets the state of any given object to default values?”
Then you have probably already heared of Java’s Reflection API, and in case you haven’t, this is a good opportunity to see what it’s all about, and what it can be used for. This feature is really powerful, but as always, has to be used with some good judgement.


понеділок, 15 липня 2013 р.

VisualVM 1.3.6 Released


VisualVM 1.3.6 has been released, delivering many bugfixes and introducing several improvements:
  • Unavailable sites aren't deleted on startup
  • Metaspace monitoring for JDK 1.8
  • Support for read-only JMX connections
  • Comparing CPU snapshots
  • Retained size by class in HeapWalker
  • Built on NetBeans Platform & profiler 7.3.1
See the Release Notes for the list of all changes. The bits can be downloaded at visualvm.java.net.

Comparison of Java Logging Frameworks and Libraries


Please note that the comparison of the different frameworks is a work in progress. If you believe that we missed an important feature or that we got one of the details wrong, please let us know.

SmartInspectlog4jLogbackObjectGuy Framework
LicenseCommercialApacheLGPLCustom
Source availableYesYesYesYes
VendorGurockApacheQOS-
WebsiteLinkLinkLinkLink
Basic FeaturesSmartInspectlog4jLogbackObjectGuy Framework
Logging simple text messages YesYesYesYes
Log levels to filter messages Debug
Verbose
Message
Warning
Error
Fatal
Debug
Trace
Info
Warn
Error
Fatal
Debug
Trace
Info
Warn
Error
Debug
Info
Status
Warning
Error
Critical
Fatal
Multiple connections or targets YesYesYesYes
Log categories or sessions YesYesYesLimited
Log file rotation by date/time YesYesYesNo
Log file rotation by size YesYesYesNo
Log file rotation max parts YesYesYesNo
Optional configuration files YesYesYesNo
Advanced FeaturesSmartInspectlog4jLogbackObjectGuy Framework
Logging objects and arrays YesYesNoNo
Logging complex structures and binary data YesNoNoNo
Thread-safe logging YesYesYes?
Tracing method invocation YesText-onlyText-onlyText-only
Logging variable values YesText-onlyText-onlyText-only
Watching variable valuesYesNoNoNo
Logging thread and process behavior YesNoNoNo
Advanced protocols and connections Network
Named Pipe1)
Memory
Binary Files
Custom
Network
JMS
Database
Custom
Network
JMS
Database
Custom
Network
Memory
Custom
Advanced protocol options Buffer
Reconnect
Interval
Encryption
BufferBuffer
Reconnect
Interval
No
Asynchronous logging and backlog queues YesAsync-onlyNoNo
Log server application YesNoNoNo
Graphical ViewerSmartInspectlog4jLogbackObjectGuy Framework
Graphical viewer application Yes1)YesNoNo
Advanced filtering capabilities YesNoNoNo
Navigation functionality YesLimitedNoNo
Call stacks, graphs and message details YesNoNoNo
Multiple views or windows YesLimitedNoNo
Live monitoring via network or pipes YesYesNoNo
Viewing and inspecting application data YesNoNoNo
Graphical configuration utility YesNoNoNo
Documentation & SupportSmartInspectlog4jLogbackObjectGuy Framework
Getting started tutorialsYesYesYesYes
Online articles / advanced topicsYesYesYesNo
API ReferenceYesYesYesYes
Community supportYesYesYesNo
Professional / priority supportYesNoYesNo
1) Only available on the Windows platform