Skip to content

Commit eedb2ac

Browse files
committed
feat: add exercise boilerplate
1 parent aebc10e commit eedb2ac

9 files changed

Lines changed: 708 additions & 27 deletions

File tree

.gitignore

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
target/
2+
!.mvn/wrapper/maven-wrapper.jar
3+
!**/src/main/**/target/
4+
!**/src/test/**/target/
5+
6+
### IntelliJ IDEA ###
7+
.idea/
8+
*.iws
9+
*.iml
10+
*.ipr
11+
12+
### Eclipse ###
13+
.apt_generated
14+
.classpath
15+
.factorypath
16+
.project
17+
.settings
18+
.springBeans
19+
.sts4-cache
20+
21+
### NetBeans ###
22+
/nbproject/private/
23+
/nbbuild/
24+
/dist/
25+
/nbdist/
26+
/.nb-gradle/
27+
build/
28+
!**/src/main/**/build/
29+
!**/src/test/**/build/
30+
31+
### VS Code ###
32+
.vscode/
33+
34+
### Mac OS ###
35+
.DS_Store

.mvn/wrapper/maven-wrapper.jar

61.1 KB
Binary file not shown.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.1/apache-maven-3.9.1-bin.zip
18+
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar

README.md

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,31 @@
1-
# Java Exercise Template
2-
This template repository is used to create autograded Java exercise repositories for CBF Academy bootcamps. It includes a GitHub Classroom autograding workflow that scores student submissions on functionality and code quality by executing unit tests and submitting the code changes for review by an automated agent.
3-
4-
## Usage
5-
6-
1. Create a new repository for the exercise, with the following settings:
7-
- Template: Select this repository
8-
- Name: Use the `java-exercises-[exercise name]` naming convention, e.g. `java-exercises-spring-boot`
9-
- Visibility: Public (needed for Classroom)
10-
2. After initialising, navigate to the repo settings and set as a template, so it can be used for assignments
11-
3. Commit README, Maven assets, starter code and unit tests to the main branch
12-
4. Create a solutions branch and commit any reference solutions code to it
13-
5. Modify the `MAX_TESTS` environment variable to reflect the total number of tests available
14-
6. Push all changes
15-
16-
## Testing
17-
18-
1. Create a new Classroom assignment using the exercise repo as the starter template, with the following settings
19-
- Repository visibility: Private
20-
- Grant students admin access to their repository: Disabled
21-
- Copy the default branch only: Enabled
22-
- Supported editor: Don't use an online IDE
23-
- Protected file paths: `.github/**/*`, `**/test/**/*`
24-
- Enable feedback pull requests: Enabled
25-
2. Accept the assignment from a test account.
26-
3. Commit and push
27-
4. Review the Actions output and Feedback PR comment to ensure everything operates as expected
1+
# Client-Server Architecture
2+
3+
[![Java Language](https://img.shields.io/badge/PLATFORM-OpenJDK-3A75B0.svg?style=for-the-badge)][1]
4+
[![JUnit5 Testing Framework](https://img.shields.io/badge/testing%20framework-JUnit5-26A162.svg?style=for-the-badge)][2]
5+
[![Maven Dependency Manager](https://img.shields.io/badge/dependency%20manager-Maven-AA215A.svg?style=for-the-badge)][3]
6+
7+
The goal of these programming exercises is to practise:
8+
- communication with a remote server
9+
- using the `java.net.*` package capabilities
10+
11+
For this assignment, we've provided the starter project above.
12+
13+
## :earth_africa: Using URLs
14+
15+
Modify [App.java](src/main/java/com/cbfacademy/App.java) to connect to the main CBF website at https://codingblackfemales.com, then read its content line by line and print each line to the screen.
16+
17+
You will need to use `HttpURLConnection`, `BufferedReader` and `InputStreamReader` classes.
18+
19+
Whenever possible, use the try-with-resources construct we saw earlier in the course, and ensure to release all resources.
20+
21+
## :phone: Client & Server
22+
23+
Create a simple program with two classes:
24+
- a `ExerciseServer` class which uses a `ServerSocket` to listen for connections on `localhost:4040`, then prints message it receives on the screen.
25+
- a `ExerciseClient` class which requests a connection to server, sends a simple text message to the server.
26+
27+
Ensure to release all resources at the end of your program.
28+
29+
[1]: https://docs.oracle.com/javase/21/docs/api/index.html
30+
[2]: https://junit.org/junit5/
31+
[3]: https://maven.apache.org/

0 commit comments

Comments
 (0)