java design pattern Decorator Pattern

Decorator mode Reference documents: http://c.biancheng.net/view/1366.html   In real life, it is often necessary to add new functions or beautify the appearance of existing products, such as house decoration, photo frame and so on. In the process of software development, sometimes you want to use s ...

Posted by satyac46 on Sun, 28 Jun 2020 20:19:16 -0700

Junit unit test and reflection

1.Junit unit test Test classification: 1. Black box test: do not need to write code, do not see the process of program execution, input some parameters, and see the expected results. 2. White box test: you need to write code, you can see the process of program execution, enter some parameters, and see ...

Posted by rolwong on Sat, 27 Jun 2020 00:05:30 -0700

PowerMockito.mockStatic(class) simulate static method call

Article catalog PowerMockito.mockStatic(class) simulate static method call Why write unit tests Introduce dependency Simulation tool class calls static methods Notes PowerMockito.mockStatic(class) simulate static method call Why write unit tests give us the confidence to refactor. A bunch o ...

Posted by _theworks on Mon, 22 Jun 2020 22:22:57 -0700

Java client in Redis (Jedis / Lettuce)

This article learns to use a Java client (Jedis / Lettuce) to operate Redis. 1 Open remote connection Redis does not support remote connections by default and needs to be turned on and modified manuallyRedis.confThere are three major changes: vi /usr/local/redis-5.0.8/redis.conf # bind 127.0.0.1 protected-mode no requirepass 123456 Then resta ...

Posted by poppy28 on Sun, 14 Jun 2020 18:13:51 -0700

Full text retrieval technology_ Lucene index file

The creation of index file, an important part of the full text, can be realized through Lucene. Create index basic process Select a folder as the directory for index output. Create index output stream object Read the data source, encapsulate the document object, and define the attributes of the docum ...

Posted by borris_uk on Sat, 13 Jun 2020 20:56:25 -0700

[Java] uses reflection to execute the methods specified by Spring container Bean, and supports automatic calling of multiple parameters

catalog Usage scenarios objective Implementation mode Premise: thinking Core class test method Source sharing Usage scenarios Input the scheduled task into the database (the advantage of this is the visualization of the scheduled task, and the execution time of each task can be modified dynamically), and execute the corresponding method ...

Posted by Chris Val Kef on Sat, 13 Jun 2020 03:06:01 -0700

Use of surefire plug-in

Article catalog Write in front Combined with TestNG configuration Combined with Junit configuration Matching mvn command use Write in front The surefire plug-in is used in the test phase of maven's life cycle for testing. It provides some mvn operations that are convenient for us to perform th ...

Posted by slj90 on Fri, 12 Jun 2020 02:24:24 -0700

Basic AOP usage of spring

AOP: [dynamic agent] It refers to the programming method that dynamically cuts a piece of code into a specified method position to run during the program running 1. Import aop module: Spring AOP: (spring aspects) 2. Create a business logic class (MathCalculator): print the log when the business logic ...

Posted by ataylor20 on Mon, 08 Jun 2020 19:00:16 -0700

Spring09_ Dynamic agent

For the source code of this tutorial, please visit: tutorial_demo 1, What is dynamic agent 1.1 concept The purpose of dynamic proxy is similar to decoration mode, which is to enhance an object. All cases that use decorator mode can be replaced with dynamic proxies. Features: bytecode is created on demand and loaded on demand; Function: enhanc ...

Posted by Davy on Mon, 01 Jun 2020 06:53:12 -0700

Spring Boot Tutorial - Test

1. Introduction to Application Testing Usually after we have written the code, the test of the code will be given to a dedicated tester to test. If a test runs to your job and says to you that your code seems to have a Bug, you will be unhappy. That's what I am doing anyway(viii).So to show you that your code is a bit of a good quality, we'll t ...

Posted by vinny69 on Sat, 30 May 2020 10:06:20 -0700