You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor!: reorganize project into separate modules for independent testing
- Convert single-module project to multi-module Maven structure
- Create exception-handling module for practical exception handling exercises
- Create custom-exceptions module for custom exception creation tasks
- Move existing tests and source files to appropriate modules
- Update README with module-specific instructions and testing commands
- Update parent pom.xml to use pom packaging with module declarations
BREAKING CHANGE: Project structure changed from single module to multi-module, requiring updated build and test commands
-**custom-exceptions**: Custom exception creation and file processing exercises
14
15
15
-
### Question 1
16
+
### Running Tests
16
17
17
-
Is the following code legal?
18
+
To run all tests across both modules:
18
19
19
-
```java
20
-
try {
20
+
```shell
21
+
./mvnw clean test
22
+
```
21
23
22
-
} finally {
24
+
To test a specific module:
23
25
24
-
}
26
+
```shell
27
+
./mvnw clean test -pl exception-handling
28
+
./mvnw clean test -pl custom-exceptions
25
29
```
26
30
27
-
### Question 2
31
+
## :pushpin: Exception Handling
32
+
33
+
Create a class called `ExceptionExercises` in the `exception-handling/src/main/java/com/cbfacademy` directory with the following methods that demonstrate proper exception handling techniques. Each method should handle specific exceptions gracefully and return appropriate values.
34
+
35
+
Using the [Java Exception Handling documentation][4] as a guide, implement the methods described below. In each method, replace `throw new RuntimeException("Not implemented")` with your code.
36
+
37
+
### Safe Division
38
+
39
+
Create a method that performs division while handling potential arithmetic exceptions:
28
40
29
-
What exception types can be caught by the following handler?
0 commit comments