The repository contains projects examples for the SE course.
beat
contains an MVC example and JavaFX examples
Other folders are listed in lessons.
The purpose of this lecture is to understand the basics of software testing in
practice. I provide a simple example of using JUnit outside of a Maven project
(credits to JUnit
quickstart). If you
explore the chat
project, you can see an example of testing the simple model
of a chat system (with groups). I use Mockito for
mocking object in case we have dependencies among them.
The source folders for this lesson are:
junit-quickstart
(see README inside);chat
project.
The source folder is socket
. See the README inside.
The source folder is rmi
. See the README inside.
The source folders are rmitter-view
and fx-example
.
We will proceed by introducing the Java Swing library by implementing the GUI for RMItter (our favorite Twitter implementation).
The code for the Swing implementation is
here. The project specifies
deib.ingsoft18.rmitter
as dependency, so remember to:
$ cd rmi/rmitter
$ mvn install
Before compiling rmitter-view
.
The graphical interface is far from being complete: it only displays every notification and allows a user to post. The interface does not allow to login, however, it allows to "connect" to someones account by providing its username and secret token. The secret token can be obtained by launching a RMItter client in its text-only version (as we did in the previous lesson).
As second example, we will introduce the JavaFX framework by implementing the
fx-example
project. The interface simply consists in one frame in which the
user can switch between two different screens and can modify the state of the
application (represented by some integers). The screens offer the possibility to
take a snapshot of the current state. When a snapshot is taken, it is
"persisted" in a new frame.
NOTE that the rmitter-view
contains other implementations for RMItter's
GUI:
FXGui
: uses the programmatic APIs of JavaFX;FXGuiCSS
: shows how to remove style from implementation and put it into a separate file;FXMLGui
: uses FXML to re-implement the same interface.