My new Java Multithreading course is online!!! Click on the link below:
Java Multithreading: the complete course
When running parameterized tests, the same tests are run multiple times with different inputs. In other words, it's possible to run more tests with less code.
Here's an example for a hypothetical class to be tested, that revert strings:
@RunWith(Parameterized.class) public class StringReverterTest { private StringReverter reverter; private String inputValue; private String expectedValue; public StringReverterTest (String inputValue, String expectedValue) { this.inputValue = inputValue; this.expectedValue = expectedValue; } @Parameters
Here’s the procedure:
1) Create the .ssh directory:
From your user directory, run:
mkdir .ssh
2) Generate the ssh key:
ssh-keygen -t rsa -b 2048 -f ~/.ssh/id_rsa -C "Your comment here"
3) Change the permissions of the generated files:
chmod 700 ~/.ssh && chmod 600 ~/.ssh/*
4) Copy the public key from ~/.ssh/id_rsa.pub to the server.
If you are using Bitbucket, click on “Manage account”, then “Ssh key”; if you are using Github, click on “Settings”, then “Ssh and Gpg keys”.
Paste your key and save.
When we execute "git merge" there are different ways in which Git merges our branches, depending on the options and on the commit history.
Here are the three types of merge in Git:
1) Fast Forward.
This is the simplest type of merge and it doesn't require any additional merge commit. The pointer of one of the two branch is simply moved to point to the same commit to which is pointing the other branch. This is only possible if the commit history is linear and doesn't divert.
AA--AB \--AC
Here's a list of the common ones:
docker info
docker container run myImageName
docker container rm containerName
Note that the container has to be stopped, unless you use the -f option.
docker container start containerName
These are programming principles that, when applied, increase cohesion, loose coupling and encapsulation.
The principles are:
Here's a list of the most common ones:
Add a user:
adduser john
Set the password for a user:
passwd john
Show the current directory:
pwd
Create the home directory for a user:
mkhomedir_helper john
Clear the screen:
clear
List a directory, including hidden files:
ls -a
List a directory, with detailed info:
ls -l
Create an empty file:
touch myfile.txt
Create a directory:
mkdir mydir
Copy a file
cp myfile.txt mydir
Auto configuration is the automatic configuration of a Spring application using Spring Boot, which load default values and modules that are in the class path, according to preset conditions and rules. There is a lot of boilerplate code and configuration in a Spring application, and that's the power of Spring Boot.
Three annotations are applied for that purpose:
Spring Boot reduces boiler plate configuration in Spring and provides automatic configuration, whenever possible.
It also creates stand-alone applications that you just run as uber-jar, and embeds application servers.
Let's see how easy it is to create a "hello world" REST application.
Here's the Maven configuraton in the pom.xml:
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Http requests provide credentials via the "authorization" header.
Authorization: Bearer
When authentication is required, but no credentials are provided, the server responds with an HTTP 401 status and a WWW-Authenticate header:
WWW-Authenticate: Basic realm="User Visible Realm"
There are different authentications methods, called authentication schemes. Here are the most common ones:
Copyright © 2013 Welcome to the website of Davis Fiore. All Rights Reserved.