Tag

Junit

0 views collected around this technical thread.

macrozheng
macrozheng
May 23, 2025 · Fundamentals

Why ‘+’ Can Outperform StringBuilder in Java: Real Benchmarks Explained

This article investigates the performance differences between Java’s ‘+’ operator, StringBuilder, and StringJoiner for string concatenation, presenting JUnit benchmark results for single and looped concatenations, analyzing compiled bytecode, and concluding when each method is optimal for readability and speed.

JavaJunitString Concatenation
0 likes · 7 min read
Why ‘+’ Can Outperform StringBuilder in Java: Real Benchmarks Explained
Java Captain
Java Captain
May 9, 2025 · Databases

Using H2 Database in Embedded, Server, and Mixed Modes with Java

This article demonstrates how to use the H2 database with Java 1.8, covering embedded (file and memory) modes, server modes (Web, TCP, PG), mixed mode configurations, required dependencies, and provides complete JUnit test code examples for creating, accessing, and managing tables.

DatabaseH2JDBC
0 likes · 17 min read
Using H2 Database in Embedded, Server, and Mixed Modes with Java
JD Tech
JD Tech
Nov 28, 2024 · Fundamentals

Comprehensive Guide to Unit Testing Strategies and Tools for Java Projects

This article presents a detailed, step‑by‑step guide on improving unit test coverage in large Java codebases, covering strategies such as mocking, divide‑and‑conquer, tool‑assisted test generation, reflection‑based coverage, Maven configuration, and practical tips for handling static methods, final classes, and test data replay.

Code CoverageJavaJunit
0 likes · 27 min read
Comprehensive Guide to Unit Testing Strategies and Tools for Java Projects
Java Tech Enthusiast
Java Tech Enthusiast
Aug 22, 2024 · Fundamentals

Using PowerMock for Unit Testing in Java: Basics and Advanced Techniques

The article demonstrates how PowerMock can be used to unit‑test a Java FileParser class—showing basic mocks for files and streams, advanced techniques for final and static classes, and achieving full coverage—while warning that its heavy class‑loader overhead can dramatically slow large test suites and increase memory consumption.

JavaJunitPowerMock
0 likes · 10 min read
Using PowerMock for Unit Testing in Java: Basics and Advanced Techniques
Architecture Digest
Architecture Digest
Jul 22, 2024 · Fundamentals

Performance Comparison of String Concatenation Using '+' vs StringBuilder in Java

This article examines Java string concatenation performance by comparing the '+' operator and StringBuilder in both simple and loop scenarios, presenting JUnit test results, bytecode analysis, and practical recommendations for choosing the most efficient approach.

JavaJunitString Concatenation
0 likes · 6 min read
Performance Comparison of String Concatenation Using '+' vs StringBuilder in Java
Java Architect Essentials
Java Architect Essentials
Jun 16, 2024 · Backend Development

Performance Comparison of String Concatenation Using '+' Operator vs StringBuilder in Java

This article examines the performance differences between using the '+' operator and StringBuilder for string concatenation in Java, presenting JUnit benchmark tests for simple concatenations and looped concatenations, analyzing compiled bytecode, and concluding that '+' is suitable for simple cases while StringBuilder excels in loops.

JavaJunitString Concatenation
0 likes · 7 min read
Performance Comparison of String Concatenation Using '+' Operator vs StringBuilder in Java
JD Tech Talk
JD Tech Talk
Jun 7, 2024 · Artificial Intelligence

AI‑Powered JUnit Rule for Automatic Error Reporting to GPT

This tutorial shows Java engineers how to build a JUnit Rule that captures test failures, extracts the exception stack and source file, and automatically sends the information to OpenAI's GPT for analysis and code‑fix suggestions, complete with reusable data‑model classes and utility methods.

AIGPTJava
0 likes · 13 min read
AI‑Powered JUnit Rule for Automatic Error Reporting to GPT
JD Retail Technology
JD Retail Technology
May 13, 2024 · Backend Development

A Minimalist Guide to Setting Up Unit Tests in Spring Boot

This article presents a concise, beginner-friendly approach to building a Spring Boot unit testing environment using only essential Maven dependencies and test classes, covering both integration-style and pure unit test techniques, complete with annotated examples and practical testing tips.

Integration TestJavaJunit
0 likes · 9 min read
A Minimalist Guide to Setting Up Unit Tests in Spring Boot
Top Architect
Top Architect
Feb 4, 2024 · Backend Development

Performance Comparison of String Concatenation Using '+' Operator vs StringBuilder in Java

This article examines Java string concatenation methods, presenting JUnit benchmarks that compare the '+' operator and StringBuilder in both single and loop scenarios, revealing that while simple concatenations perform similarly, loop concatenations are dramatically faster with StringBuilder, leading to practical recommendations.

JavaJunitString Concatenation
0 likes · 8 min read
Performance Comparison of String Concatenation Using '+' Operator vs StringBuilder in Java
Java Architect Essentials
Java Architect Essentials
Nov 30, 2023 · Fundamentals

Performance Comparison of Java String Concatenation: '+' Operator vs StringBuilder

This article examines Java string concatenation performance, comparing the '+' operator and StringBuilder in both simple and loop scenarios, presenting JUnit benchmark results, bytecode analysis, and concluding that '+' is sufficient for single concatenations while StringBuilder excels in loops.

JavaJunitString Concatenation
0 likes · 7 min read
Performance Comparison of Java String Concatenation: '+' Operator vs StringBuilder
Top Architect
Top Architect
Nov 27, 2023 · Backend Development

Performance Comparison of String Concatenation Using '+' vs StringBuilder in Java

This article evaluates the execution time and bytecode differences of simple and looped string concatenation in Java, comparing the '+' operator with explicit StringBuilder usage, and concludes that '+' is fine for single concatenations while StringBuilder dramatically outperforms '+' in iterative scenarios.

JavaJunitString Concatenation
0 likes · 9 min read
Performance Comparison of String Concatenation Using '+' vs StringBuilder in Java
Java Captain
Java Captain
Nov 25, 2023 · Backend Development

Performance Comparison of String Concatenation Using '+' Operator and StringBuilder in Java

An empirical study compares Java string concatenation using the '+' operator versus StringBuilder, showing that for simple concatenations '+' is equally efficient and more concise, while in loops '+' incurs significant overhead, making StringBuilder the preferred choice for iterative concatenation.

JavaJunitString Concatenation
0 likes · 6 min read
Performance Comparison of String Concatenation Using '+' Operator and StringBuilder in Java
IT Services Circle
IT Services Circle
Oct 26, 2023 · Fundamentals

Writing Unit Tests in Java: JUnit Basics, Test Implementation, and Report Generation

This article explains what unit testing is, why it’s essential, and provides a step‑by‑step guide for writing Java unit tests with JUnit, integrating them into Maven projects, and generating detailed coverage reports using IDE features and JaCoCo.

JaCoCoJavaJunit
0 likes · 16 min read
Writing Unit Tests in Java: JUnit Basics, Test Implementation, and Report Generation
DaTaobao Tech
DaTaobao Tech
Sep 14, 2022 · Backend Development

Optimizing Maven Surefire Parallel Execution for Large-Scale Unit Tests

The Taobao User Operations Platform team reduced CI unit‑test time from fifty minutes to ten by configuring Maven Surefire to reuse forks, use a fork count of twice the CPU cores, and run methods in parallel with an appropriate thread count, achieving faster builds while keeping failure rates low.

CIJavaJunit
0 likes · 10 min read
Optimizing Maven Surefire Parallel Execution for Large-Scale Unit Tests
FunTester
FunTester
Aug 30, 2022 · Fundamentals

JUnit Annotations for Selenium Testing: Overview and Usage

This article explains why JUnit is a popular Java testing framework, lists its key features, and provides a comprehensive guide to using JUnit annotations—including @BeforeClass, @Before, @Test, @After, @AfterClass, @Ignore, and advanced annotations—in Selenium WebDriver automation scripts, complete with code examples and execution order details.

AnnotationsJavaJunit
0 likes · 11 min read
JUnit Annotations for Selenium Testing: Overview and Usage
FunTester
FunTester
Jun 21, 2022 · Fundamentals

Comparing TestNG and JUnit: Features, Annotations, and Usage in Java Unit Testing

This article explains unit testing concepts, outlines the differences between TestNG and JUnit—including test suite configuration, annotations, grouping, parameterization, dependency handling, exception and timeout testing—and provides code examples to help developers choose the most suitable Java testing framework.

AnnotationsJavaJunit
0 likes · 11 min read
Comparing TestNG and JUnit: Features, Annotations, and Usage in Java Unit Testing
High Availability Architecture
High Availability Architecture
Jun 15, 2022 · Backend Development

Exploring JUnit Runners: Suite, Theories, Categories, Enclosed, Parameterized and More

This article provides a comprehensive guide to JUnit runners, detailing the purpose and usage of Suite, Theories, Categories, Enclosed, Parameterized, IgnoredClassRunner and other executors, accompanied by code examples and execution results to help developers apply flexible unit testing strategies in Java projects.

JavaJunitRunner
0 likes · 12 min read
Exploring JUnit Runners: Suite, Theories, Categories, Enclosed, Parameterized and More
JD Tech
JD Tech
May 25, 2022 · Backend Development

A Comprehensive Guide to JUnit Runners: Suite, RunWith, BlockJUnit4ClassRunner, Theories, Categories, Parameterized and More

This article explains the purpose and usage of various JUnit runners—including Suite, RunWith, BlockJUnit4ClassRunner, ParentRunner, Theories, Categories, Enclosed, Parameterized, and error‑handling runners—providing code examples and practical insights for flexible unit testing in Java projects.

JavaJunitParameterized Tests
0 likes · 12 min read
A Comprehensive Guide to JUnit Runners: Suite, RunWith, BlockJUnit4ClassRunner, Theories, Categories, Parameterized and More
Top Architect
Top Architect
Jan 12, 2021 · Backend Development

Introduction to Mock Testing with Spring MVC and MockMvc

This article introduces mock testing for Spring MVC controllers, explains why mocks are useful, describes the main MockMvc components, shows required Maven dependencies, and provides complete example test cases for both view‑returning and JSON‑returning endpoints using JUnit and MockMvc.

JavaJunitSpring
0 likes · 8 min read
Introduction to Mock Testing with Spring MVC and MockMvc