Scalability testing with JMeter

There is a point in every enterprise web application project when the scalability of the application under development is wanted to be measured. There are several reasons for why scalability tests are done. To begin with, there is a need to see how the application will perform on production like environment. Then, the peak performance or breaking point of the application is wanted to be found out. Finally, scalability tests can be utilized to find performance bottlenecks, bugs and memory leaks.

We in Vaadin take scalability seriously. That is why we built a full stack application called QuickTickets a couple of years ago. QuickTickets has been our platform for scalability studies. If scalability is of any kind of interest to you, you should check out the Vaadin Scalability Study blog post which is still valid today. 

Apache JMeter has most often been the de facto tool for scalability studies. Apache JMeter is an open source desktop application designed for Web Application performance testing. JMeter does not render the UI in a browser like Vaadin TestBech and Selenium do, but instead it has the ability to simulate and gauge a server load of hundreds and thousands of concurrent web users. This functionality is achieved by recording the client to server requests of the Web Application which is then played back by several numbers of concurrent threads.

jmeter screenshot

QuickTickets is based on Vaadin 6; so are there any changes in Vaadin 7 that the scalability tester should be aware of? Yes, there is, at least one. In Vaadin 6 you could set component ids used in the client-server communication using the setDebugId() method. By default, a Vaadin application sets a sequential id for each component of the application. This id sequence is likely the same between different runs of the application, but this is not guaranteed. By setting the component id by hand, it helps you to keep your test valid even when your Vaadin UI is changing during the application development.

In Vaadin 7 the setDebugId functionality has been removed, since it might cause problems if the ids set by the user are not unique. In order to make your scalability testing as smooth as possible, I've prepared a tutorial that oulines the measures you need to take to test your Vaadin application. Please, take a look at the step-by-step tutorial of testing Vaadin 7 applications with JMeter. It covers JMeter testing of both Vaadin 6 and Vaadin 7 applications. And as always, if you have any comments or questions, post them here and I'll get back to you.

Read more in the wiki

Johannes Tuikkala Johannes Tuikkala works as a Vaadin Expert who has been working in different customer projects for 6 years. He likes to do photography and winter swimming on his free time. You can reach him by email: johannes@vaadin.com.

Webdriver and object oriented testing in TestBench 4

Vaadin TestBench is a browser automation tool, suited for creating UI level tests for Vaadin applications. It is based on Selenium 2, which means that all features of Selenium 2/WebDriver are also available in TestBench. But what exactly does Selenium 2 / WebDriver do? And how does Vaadin TestBench work?

Like many of you might know, Selenium has been around for quite some time. Started in 2004, the first version was solely JavaScript based. It was a small JavaScript application running in the browser, commanding the application to be tested.

WebDriver takes a different approach to solve the same problem. Rather than being a JavaScript application running within the browser, it uses whichever mechanism is most appropriate to control the browser and to bypass the restrictions placed on the browser by the JavaScript security model. This allows Vaadin TestBench to use a cleaner, object-based API, rather than follow the original dictionary-based API. This is also what Vaadin TestBench uses:

 // Create an instance of Firefox
setDriver(new FirefoxDriver());

// Now go to the Vaadin home page
getDriver().get("https://vaadin.com/home");

// Find the search input and run a search
WebElement siteSearch = driver.findElement(By.id("query"));
siteSearch.sendKeys("vaadin charts");
siteSearch.submit();

In TestBench 4 Selenium’s object-oriented API has been taken even further. The Vaadin element query API helps Vaadin developers find Vaadin components and access their properties in the browser. These component properties include caption, description, child components, cells in tables – as well as Vaadin specific actions like closing notifications. The Element APIs in the com.vaadin.testbench.element package extend the org.openqa.selenium.WebElement which makes them fully compatible with Selenium.

With Vaadin TestBench the components are queried like this:

 List<ButtonElement> buttons = $(ButtonElement.class).all();

Here the ButtonElement class is a specialized WebElement, which contains API for interacting with Vaadin Button components. There are Element class counterparts for all the core Vaadin components in Vaadin TestBench and add-ons can introduce their own when needed.

You can use several different ways to locate and interact with the UI component elements.

The most robust way is to use component identifiers. To use these, you first need to set unique identifiers for your components in the application code. A save button in a form could, e.g. use btnSave.setId(“form-save”). In the test code you can then click the actual element by calling:

 $(ButtonElement.class).id("form-save").click();

When IDs are not available, you can use the caption to find a Vaadin component in your application. Often enough the caption is a unique enough identifier for your component, as you rarely have too many components of the same type with the same caption.

 $(ButtonElement.class).caption("Save").first().click();

ElementQueries also allow you to define a search hierarchy, which means that you can easily search components within components.

 $(PanelElement.class).caption("Form").$(ButtonElement.class)
                .caption("Save").first().click();

Of course you can do most of the same things with XPath using Selenium’s rather complex but powerful syntax. Vaadin TestBench 4 is fully compatible with your existing test cases and will stay that way.

This was a glimpse into the upcoming Vaadin TestBench 4. Check out the examples in GitHub, but if you want to use Vaadin Testbench now, Vaadin TestBench 3 is fully forward compatible (also license-wise) and a safe way to start automating your browser testing today.

Jonatan KronqvistJonatan Kronqvist is a Senior Vaadin Expert leading a team of awesome developers building the next versions of Vaadin, TestBench and other tools that streamline the development process and help our customers build the best UIs in the world.

Using Vaadin CDI with JAAS authentication

Servlet 3.0 is awesome, so is CDI. They work well and are a joy to set up. Even adding the Vaadin Navigator to the mix isn’t an issue, since you can use the CDIViewProvider to maintain the injection chains. Everything works nicely with annotations, and you don’t need to mess around with nasty XML. But what if you want to use JAAS? Recently, I stumbled upon a small dilemma in a customer project where the customer wanted to use JAAS in combination with CDI. How in the world was I going to combine the two?

To get us all to the same page before we start; here is a very short introduction to JAAS. JAAS, or the Java Authentication and Authorization Service, has been around for a while. It is an API for Java to manage user authentication and request authorization, with a multitude of connectors to other technologies and pre-made helpers. In this post I’m going to show you how to integrate the authentication part into your Vaadin application, using the Vaadin CDI plugin and JBoss 7.1. The blog post is a summary of my Wiki article. It contains complete source code and a more thorough explanation on the different parts.

So, how do we really make this work?

There are a couple of ways we can configure the Servlet to have both JAAS and CDI capability; both involve the actual mappings of the Servlet. If you map your Servlet in your web.xml, you can use CDI by using the CDIUIProvider utility class. It scans the classpath for @CDIUI annotations and deploys the classes automatically. If you’re not using web.xml, you can define the same thing in your servlet by injecting the provider and adding it to the session. In my example, I just use the pre-made servlet definition included in the CDI addon. It is preconfigured to use the CDIUIProvider, so I just create the necessary UIs and annotate them, and I’m good to go, like this:

 @CDIUI("secure")
public class SecureUI extends UI

That’s how you get CDI to work, what about JAAS? Well, we can restrict the user in two ways; web.xml-based security constraints, or restricting the access to mapped Navigator Views using the @RolesAllowed annotation. Since we aren’t using the Navigator, we need to use the web.xml file approach. If you already have the file, then you just add the security constraints. If not, you need to create a web.xml file under your WEB-INF folder. You don’t need to add any servlet definitions; you only need to work with URL mappings. With JAAS, you define which URLs are off-limits to normal users. If you have a Servlet deployed there or not is actually moot; JAAS only controls access to that URL, it doesn’t care what’s there. You also define where the login-page exists with another URL.

In my example I, have a secure area of my application mapped to /secure, an unsecure area mapped to the root (/), and a login page on /login. I tell JAAS that /secure is a secure zone: users must log in to access it. If a user isn’t logged in, they get redirected to a login page. In our case it is /login. The user logs in, and the server grants access to /secure. Fragment below:

 <login-config>
    <auth-method>FORM</auth-method>
    <realm-name>ApplicationRealm</realm-name>
    <form-login-config>
        <form-login-page>/login</form-login-page>
        <form-error-page>/login</form-error-page>
    </form-login-config>
</login-config>

How you actually log in the user is completely up to you. In my example I use a Vaadin UI with a relational database to store user info, and have JBoss fetch the user data with SQL. You could also set up Active Directory, LDAP, a simple file-based system. You could use existing JSP (or even plain HTML) for the actual login UI. There are lots of tutorials for the different solutions, so I won’t cover them here. Check the wiki article for detailed information about the database method, including all source code and JBoss configs.

Now that you have JAAS enabled, what benefits do you get? Well, a lot actually. With JAAS, you get access to a properly defined authentication and authorization framework, that is built into all application servers. You can easily separate your security concerns into a separate, maintainable module. With CDI and EJBs, you can use standard-based security protocols for bean access. If you are using the Vaadin Navigator, you can even define access control restrictions on your Views with the @RolesAllowed annotation found in JAAS. Most importantly, using JAAS lets you concentrate on your application instead of the security for it.

That’s it, your app will now use JAAS authentication and CDI. The configuration provided in the wiki article isn’t complete, and there are small pieces I didn’t really cover, but it will work for basic cases. From here, you can add authorization for your particular application. Anything I missed? Anyone used JAAS with CDI, and want to share your thoughts? Feel free to add comments below.

The full Wiki article

Thomas MattssonThomas Mattsson works at Vaadin as a Vaadin Expert and Project Manager. He has been designing and implementing Vaadin application architectures for over 5 years. When he isn’t designing, he runs around Europe doing Vaadin trainings and consulting gigs. You might also catch him on the Vaadin Forum.

7-series

A bit over a year ago we released Vaadin 7 renewing the framework inside out. Then came push support with 7.1. Now what?

Let’s take a look into the future. First off, we do not see C# coming up (who is this Nutella guy anyway?). With Java 8 and lambdas already well supported, we have a solid foundation that welds Java and HTML5 platforms together in the most elegant way in the industry. So let’s start building new exciting features on that hybrid platform.

Vaadin 7 series will iteratively add features to the platform while maintaining backwards compatibility with 7.0. We guarantee to support the 7-series for the foreseeable future, but at the latest until 2018, both commercially and open source.

Vaadin 7.2 - Responsive tune-up

Next up in the pipeline will be a minor release that continues building the infrastructure. Features include:

  • Responsive layouts for components (currently available as add-on)
  • Improved push channel with support for long polling, Tomcat 8, Wildfly 8, Glassfish 4, Jetty 9.1
  • Font icons that look great on high DPI displays and are lightweight
  • Native support for Internet Explorer 11 and Windows Phone 8.1. (Including pointer events)
  • Lots of performance optimizations and API improvements

The beta version of this 7.2 will be available later this month. The final version should follow in May 2014.

Vaadin 7.3 - Let there be light

The next big feature is called Valo. It means light in Finnish. Just like light, Valo will define what you see, how it feels and tune your mood. This is the next theme for Vaadin. It will be beautiful.

How should it look like? Metro? iOS7? Adobe CS? IntelliJ? How much negative space? Which fonts? Dark or light? Rounded or sharp? Flat or shadowy? You tell us. Even better, you tell Valo.

The SASS compiler built in Vaadin 7 enabled us to make it modular. You can choose the pieces you like, vary their styles, color the overall theme as you choose, define how flat or rounded it is, etc. In short, you can parametrize Valo to look like almost anything you want.


Some of the defaults for Valo

The first Alpha version should be available later this month. Beta should be available in May or June 2014 and the final release should follow in June.

Vaadin 7.4 - Son of the Table

Table has been the key component in Vaadin since day 1. While it has served Vaadin extremely well, we must raise the bar. Welcome Grid.

Grid should fix everything that you feel is missing or wrong in Table. We looked at all the requests we have got during the years for what Table should do, peeked in some scary memories of how far people have stretched the component and concluded that all of this should be doable. Grid should either have the feature OR be flexible enough to allow easily to add the feature.

Simply put, we want Grid to be the best data grid for web. Par none. This sets the bar really high for performance, scalability, features and customizability. We are confident that we can make it, but it will not happen overnight.

This release will include the core of the grid. Some may call it MVP. We are looking at features like

  • Super fast hw-accelerated Escalator rendering engine
  • Unlimited number of rows
  • Fully functional API for both server-side and client-side use. Yes, we are looking at you GWT-folks.
  • Easy to extend - both in client and in server
  • Editor rows for powerful lightweight cell editors
  • Frozen columns
  • Hierarchical headers
  • Customizable widgets and components in headers
  • Customizable renderers for drawing anything inside cells

Strictly speaking, we do not know when we are ready with this release. Sorry. First we though last Dec, then Feb, June looks like it. One thing we do know is that we'll start shipping alpha builds later this month. And after that every two weeks until we are confident enough to call it beta.

Vaadin 7.5 - Grid strikes back

7.5 = 7.4 + 0.1. It is that simple.

In this case the 0.1 is planned include the rest of the features we want to get in Grid. At the moment we anticipate the list to be:

  • Hierarchy support (should contain all features in TreeTable)
  • Variable row height
  • Using parent scrollbars to simulate long pages
  • Supporting undefined sized data-sources by loading rows when scrolling to end
  • Components and widgets in cells
  • Detail rows

The schedule for 7.5 is clear: it comes after 7.4.

Vaadin 7.x - Steady stream of features

Yes, there will be 7.6 and 7.7 and so on. We are just getting started with Vaadin 7. While we have tons of ideas of what we would like to be in these releases, we have to deliver the already outlined releases first before stating to pinpoint these features to certain releases.

Vaadin 8 - Future Web

Thus far we have been keeping our lips sealed on Vaadin 8. Saying that we will not even start thinking about it any time soon. We failed. Some thinking has been done.

With so many wonderful things like shadow DOM, custom elements, web components and the latest developments in CSS, it is hard not to be excited about the future of the web. Unfortunately the reality is that these features do not work in today’s browsers and there will be some poor fellow using yesterday’s browsers tomorrow. Especially in the enterprise world. And in the end, You, our dear friend, try to build a wonderful user experience for a customer who wants it to work in "all browsers".

With Vaadin 8 we will take a peek into the future of web. We'll take bold steps forward and leave guys with yesterday’s browsers behind. Maybe even leaving the guys with today’s browsers behind. And then add everything wonderful that is possible in tomorrow’s browsers directly in Vaadin.

Scary? What happens to those poor guys mentioned above? What about the customer who wants it all? For them, and for You, our dear friend, we have Vaadin 7 series. That will be supported and developed in parallel, until Your customer is ready to jump to Vaadin 8.

Roadmap

Originally we wanted to ship all of the above in just one release called 7.2. Shipping estimates started sliding faster than the Olympic Sleds when we realized the size of the effort. Finally we decided that shipping early and often is far more valuable than the blasting sound of the dropping on an anvil-sized release.

For an updated Vaadin roadmap, take a look at our public roadmap at vaadin.com/roadmap

Update: For popular demand, here are some links revealing more of Valo

Vaadin switching to C#

UPDATE April 2nd 2014: This was an April fools joke. We thank all that shared the joke with us in social media and all other places and made the laugh for the day. Thanks for the hundreds of positive feedback.

When you thought Vaadin 7.2 and 7.3 were on the way, we've been hard at work on a secret project all along. Today we're proud to announce the release of 12 intensive months of work behind the scenes by our R&D department. We at Vaadin always strive to stay on the edge of the wave and having seen the popularity of C# in the past few years, we decided to pull the switch behind the scenes. Vaadin now fully supports C# as the first-class programming language on the server-side as well as on the client-side.

"The largest effort was converting GWT into supporting C#. You can now stay inside Visual Studio, that you've learned to love, and compile to JavaScript and HTML with Microsoft Web Toolkit Framework (aka MSWTF) faster and more conveniently than ever before." says VP of Vaadin.NET R&D Artur Seagull.

This is a huge thing for all developers around the world, you can work in a superior sharp language while developing full-blown Ajax applications. We've even built in support for the <blink> tag and backported support for IE6 mode into Windows 8 through a Webcomponents widget using JS-Interop. Sharepoint server was a natural choice and is as of today the dedicated platform for deploying Vaadin.NET applications. These have been the major requests in the community for the past few years and we're pleased to finally answer the call.

"According to a Gartner market study even JavaScript hackers have always preferred C# to jQuery and now they can finally move to a platform with a future." says the newly appointed .NET evangelist Matti Pehvanen.

We've managed to build in support for all major browsers starting from IE5. The project is still quite new, only used in a handful of Vaadin internal projects so there might still be some stability problems. We've especially had a hard time building support for marginal browsers such as Google Chrome, but are sure to have full support by the end of 2015Q1.

We're also pleased to announce a separate Vaadin.NET Sass compiler, based on the famous Vaadin Sass compiler.

"We looked at C# for a long time but minimizing the compilation time is such an important factor in the in-time request-by-request theme compilation with Sass, that we had to go deeper. We tried C++ but even that wasn't enough so we ended up rewriting it all in pure C to optimize processor floating point usage. They don't call it CSS for nothing, now even I understand where the C in CSS comes from." says Leif Asgard from the Sass swat-team.


Vaadin Visual Studio Enterprise Edition Suite plugin running on Windows XP

 

What does this mean for you as a Vaadin developer?

Rest assured, you can continue using Vaadin just as before, as soon as you've switched from Java to C#. This is most easily done by getting a license for Visual Studio through Microsoft and doing a little find and replace. We're also planning on releasing a plugin (with fully integrated CRebel support) for Visual Studio early May with a price tag of $5000 per CPU cores per year.

Vaadin.net logo

The new Framework will go under the domain Vaadin.net launched today! You will find all the relevant info there so go check it out! At the same time we also modernized the logo to the next level. We used the upcoming Valo-theme's mixin variables to make it un-comprehensibly flat and reduced the roundness to the max. Once you understand flat design, cubism really is the next step and we're excited to lead the way!

The new server-side project goes by the name of Vaadin.NET and is available as of today in GitHub. If you're only interested in the client-side, it works as a full drop-in replacement for both GWT and jQuery under the project MSWTF in GitHub. You can also order it on CD by sending us a PO to our fax. Check it out and let us know what you think in the comments below. Are you as excited as we are?

Satay NutellaSatay Nutella is C#O. He likes big words like synergy and convergence and disrupting the technosphere with innovative ideas that literally blow your mind. You can't contact him on twitter or anywhere else – he'll contact you if he needs to.

Showing 1 - 5 of 256 results.
Items per Page 5
of 52
  Three years of Vaadin Directory Vaadin Directory has turned 3 years of age already. The Vaadin Framework itself features a lot of widgets and components, but it cannot have all
I recently had the opportunity to work on WAI-ARIA additions to the Vaadin core framework. WAI-ARIA is short for Web Accessibility Initiative - Accessible Rich Internet Applications Suite.
If you are well informed about your own organization and your surroundings, it’s easier to serve customers and make good decisions. This was known already to Sun Tzu and is also one
I am happy to announce that the new Vaadin 7 edition of the book just came out of print. The book is thicker than ever, perfect for bashing others over technical Vaadin details, and the color of
Frameworks are pretty hard to demo - they are just a pile of API that does not look much. It would take quite a while too long to see the beauty of the framework just by looking at the API. In case
Showing 91 - 95 of 100 results.
of 20

See all blog entries
Subscribe to this blog