Join Ketkee Aryamane for an in-depth discussion in this video Write a test class and run the application, part of Java EE: Concurrency and Multithreading.
- [Narrator] The next step is to test this code out.…We've already written the user dao,…we've created the user bean,…and we've created the callable implementation.…Now let's test this out.…So, in a test class, the first thing that you have to do is…get a collection of string values from that file.…So let's come to the IDE, under the Tests folder,…let's create a class.…Let's call this TestExecutors,…and let's grab the main method quickly.…Okay, now we're going to write a separate method…to read that file, and get a list of all those lines, okay?…So, I'm going to say public static getUsersFromFile.…
The parameter to this will be a file name.…And what is this going to return me?…This is going to return me a list of string.…Each line in the file is one string,…and I'll make such a list of strings.…Okay, now the file reading code…is something that we've already coded…in one of our previous demos,…so I'm not going to write that code again.…I'll pull it out from the AppThread.java class.…Let's come down there, and that was the code…
- What is concurrency?
- Processes and threads in Java SE
- Java EE concurrency APIs
- Working with the ManagedExecutorService, ManagedScheduledExecutorService, ManagedThreadFactory, and ContextService APIs
- Defining data access object (DAO) classes
- Adding methods to DAO classes
- Writing REST classes
- Creating custom thread factories
- Creating contextual proxies
- JTA transactions and concurrency
Skill Level Advanced
Java EE: Servlets and JavaServer Pages (JSP)with Ketkee Aryamane6h 14m Intermediate
1. Overview and Setup
2. Processes and Threads
3. Executor API
4. Java EE Concurrency APIs
5. Concurrency and Transactions
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.