Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I3: Deployed to cloud, updated README, uploaded demo and screenshot in root #135

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
33caab3
replaced all .* with specific imports
Sep 5, 2024
8baa25a
updated order of imports to be lexicographical
Sep 5, 2024
1510f0f
resolved all style issues for IndividualProjectApplication.java
Sep 6, 2024
da76dea
fixed spacing, added comments
Sep 6, 2024
32a1e3b
fixed lines
Sep 6, 2024
fe20044
fixed import statements, added comments
Sep 6, 2024
7260967
style: fix code formatting and spacing issuesClean code
elifia-muthia Sep 6, 2024
3b1cd69
feat: Added Academic Honesty Pledge (Part 4)
Sep 10, 2024
491f842
docs: Added citations for part 1
Sep 10, 2024
04ea15b
added jacoco plugin to pom.xml
Sep 10, 2024
3c15b8e
remove redundant plugins
Sep 10, 2024
1146ddb
Fixed typo in academic honesty pledge
Sep 10, 2024
ff63291
Added readme part 2 instructions
Sep 10, 2024
a9f9ba4
Finished debugging Course and writing unit tests, passed
Sep 10, 2024
1df7c66
fixed some logic
Sep 10, 2024
cb137f1
added unit tests and debugged for department
Sep 10, 2024
85192ea
extended coverage for course unit test
Sep 10, 2024
93cc6f2
Cleaned up
Sep 10, 2024
6bea860
cleaned up department.java using pmd
Sep 10, 2024
0f07b1b
cleanup
Sep 10, 2024
bd10698
added plugin for pmd
Sep 10, 2024
b4c5ceb
clean based on pmd violations
Sep 10, 2024
0d6d7c9
started making database unit tests, pass
Sep 11, 2024
2209691
added documentation
Sep 11, 2024
7a21e60
made unit tests for MyFileDatabase
Sep 11, 2024
535da5a
added dependencies to pom.xml and fixed comments in database unit tests
Sep 11, 2024
d2682a6
started IndividualProjectApplication unit test with mockito
Sep 12, 2024
dee3c6a
started docs on bugs and citations
Sep 12, 2024
fbd859b
moved custom logger handler class to its own file
Sep 12, 2024
adc26e2
figured out how to test route controller
Sep 12, 2024
0cd5b39
Added to pom.xml
Sep 13, 2024
1083616
finsihed unit tests for route controller
Sep 13, 2024
48074b0
fixed style issues
Sep 13, 2024
2c02a50
feat: Added unit tests and debugged codebase
elifia-muthia Sep 13, 2024
ceffb83
docs: Fixed README.md spacing
elifia-muthia Sep 13, 2024
6222dde
fix: Remove unused import
Sep 13, 2024
0fd5e95
docs: Cleaned up README.md
elifia-muthia Sep 13, 2024
5a67480
docs: Added descriptions to citations
Sep 13, 2024
d9fba3f
docs: Finish listing out all bugs/violations/warnings encountered in …
Sep 13, 2024
87aa356
docs: Fixed comments
Sep 13, 2024
3f3a841
Added /retrieveCourses /enrollStudentInCourse
Sep 19, 2024
c765acd
Added testRetreiveCourses and passes tests
Sep 19, 2024
fb6a833
Added unit test for enrollStudentInCourse
Sep 19, 2024
08159c6
feat: Expanded route controller functionality and added unit tests
elifia-muthia Sep 19, 2024
0698be7
Create maven.yml
elifia-muthia Sep 24, 2024
5c9024b
Fixed path in maven.yml
elifia-muthia Sep 24, 2024
bb1dbfd
Specified directory for maven.yml
elifia-muthia Sep 24, 2024
43d6ee4
removed optional dep from maven.yml
elifia-muthia Sep 24, 2024
63247f3
Added README with instructions to locally test and check
elifia-muthia Sep 26, 2024
98b3776
Updated javadoc for new features implemented for I2
Sep 26, 2024
ee3439c
Implemented some missing logic and new functionality
Sep 27, 2024
9eaf67d
Added endpoints for new implementation
Sep 27, 2024
5135afa
Added more unit tests for new and existing implementations
Sep 27, 2024
d614fe9
Updated new branch coverage picture for README
elifia-muthia Sep 27, 2024
b697876
Updated PMD result image in README.md
elifia-muthia Sep 27, 2024
2512550
Updated checkstyle report in readme
elifia-muthia Sep 27, 2024
3499710
Fixed checkstyle issue and added javadoc
Sep 27, 2024
c2e6fd8
Merge branch 'docs-and-maintenance' of https://github.com/elifia-muth…
Sep 27, 2024
0ec7a60
Uploaded GCloud Instance screenshot to root
elifia-muthia Sep 27, 2024
3f87f2f
Added citations for I3
elifia-muthia Sep 27, 2024
90221c6
Fixed error message for one endpoint
Sep 27, 2024
d0104c6
Merge branch 'docs-and-maintenance' of https://github.com/elifia-muth…
Sep 27, 2024
6515507
Uploaded Video-Demo-Link.txt
elifia-muthia Sep 27, 2024
4756673
Finished README.md
elifia-muthia Sep 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Java CI with Maven

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B package
working-directory: ./IndividualProject
Binary file added Google-Cloud-Instance.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added IndividualProject/data.txt
Binary file not shown.
Binary file added IndividualProject/dummy-data.txt
Binary file not shown.
38 changes: 37 additions & 1 deletion IndividualProject/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,33 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>9.2</version>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-java</artifactId>
<version>6.40.0</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>4.8.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-inline</artifactId>
<version>4.8.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
Expand Down Expand Up @@ -107,6 +133,16 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.15.0</version>
<configuration>
<rulesets>
<ruleset>category/java/bestpractices.xml</ruleset>
</rulesets>
</configuration>
</plugin>
</plugins>
</build>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
package dev.coms4156.project.individualproject;

import java.io.*;

import java.io.Serial;
import java.io.Serializable;

/**
* The Course class represents a course in a department.
* This class contains attributes and methods related to managing
* a course, including course code, location, and other relevant details.
* It implements Serializable to allow the course objects to be saved and
* retrieved from storage.
*/
public class Course implements Serializable {

/**
Expand All @@ -20,44 +28,50 @@ public Course(String instructorName, String courseLocation, String timeSlot, int
this.enrolledStudentCount = 500;
}

/**
/**
* Enrolls a student in the course if there is space available.
*
* @return true if the student is successfully enrolled, false otherwise.
*/
public boolean enrollStudent() {
enrolledStudentCount++;
if (enrolledStudentCount < enrollmentCapacity) {
enrolledStudentCount++;
return true;
}
return false;
}

/**
/**
* Drops a student from the course if a student is enrolled.
*
* @return true if the student is successfully dropped, false otherwise.
*/
public boolean dropStudent() {
enrolledStudentCount--;
if (enrolledStudentCount > 0) {
enrolledStudentCount--;
return true;
}
return false;
}


public String getCourseLocation() {
return this.instructorName;
return this.courseLocation;
}


public String getInstructorName() {
return this.courseLocation;
return this.instructorName;
}


public String getCourseTimeSlot() {
return this.courseTimeSlot;
}


@Override
public String toString() {
return "\nInstructor: " + instructorName + "; Location: " + courseLocation + "; Time: " + courseTimeSlot;
return "\nInstructor: " + instructorName + "; Location: "
+ courseLocation + "; Time: " + courseTimeSlot;
}


Expand All @@ -75,14 +89,27 @@ public void reassignTime(String newTime) {
this.courseTimeSlot = newTime;
}


public void setEnrolledStudentCount(int count) {
this.enrolledStudentCount = count;
/**
* Sets the enrolled student count for the course.
*
*
* @param count an {@code int} representing the new enrolled student count for
* the course. The value must be greater than or equal to 0.
*
* @return {@code true} if the enrolled student count was successfully updated,
* {@code false} if the provided count was negative and the update
* was not performed.
*/
public boolean setEnrolledStudentCount(int count) {
if (count >= 0) {
this.enrolledStudentCount = count;
return true;
}
return false;
}


public boolean isCourseFull() {
return enrollmentCapacity > enrolledStudentCount;
return enrolledStudentCount >= enrollmentCapacity;
}

@Serial
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package dev.coms4156.project.individualproject;

import java.io.*;
import java.util.*;

import java.io.Serial;
import java.io.Serializable;
import java.util.Map;

/**
* Represents a department within an educational institution.
Expand All @@ -19,21 +19,41 @@ public class Department implements Serializable {
* @param departmentChair The name of the department chair.
* @param numberOfMajors The number of majors in the department.
*/
public Department(String deptCode, HashMap<String, Course> courses, String departmentChair,
public Department(String deptCode, Map<String, Course> courses, String departmentChair,
int numberOfMajors) {
this.courses = courses;
this.departmentChair = departmentChair;
this.numberOfMajors = numberOfMajors;
this.deptCode = deptCode;
}

/**
* Sets the number of majors in the department.
*
*
* @param numberOfMajors an {@code int} representing the number of majors
* to set for the department. The value must be
* greater than or equal to 0.
*
* @return {@code true} if the number of majors was successfully updated,
* {@code false} if the provided number was negative and the
* update was not performed.
*/
public boolean setNumberOfMajors(int numberOfMajors) {
if (numberOfMajors >= 0) {
this.numberOfMajors = numberOfMajors;
return true;
}
return false;
}

/**
* Gets the number of majors in the department.
*
* @return The number of majors.
*/
public int getNumberOfMajors() {
return -this.numberOfMajors;
return this.numberOfMajors;
}

/**
Expand All @@ -42,15 +62,15 @@ public int getNumberOfMajors() {
* @return The name of the department chair.
*/
public String getDepartmentChair() {
return "this.departmentChair";
return this.departmentChair;
}

/**
* Gets the courses offered by the department.
*
* @return A HashMap containing courses offered by the department.
*/
public HashMap<String, Course> getCourseSelection() {
public Map<String, Course> getCourseSelection() {
return this.courses;
}

Expand All @@ -64,8 +84,12 @@ public void addPersonToMajor() {
/**
* Decreases the number of majors in the department by one if it's greater than zero.
*/
public void dropPersonFromMajor() {
numberOfMajors--;
public boolean dropPersonFromMajor() {
if (numberOfMajors > 0) {
numberOfMajors--;
return true;
}
return false;
}

/**
Expand Down Expand Up @@ -98,20 +122,21 @@ public void createCourse(String courseId, String instructorName, String courseLo
*
* @return A string representing the department.
*/
@Override
public String toString() {
StringBuilder result = new StringBuilder();
for (Map.Entry<String, Course> entry : courses.entrySet()) {
String key = entry.getKey();
Course value = entry.getValue();
result.append(deptCode).append(" ").append(key).append(": ").append(value.toString())
.append("\n");
result.append(deptCode).append(" ").append(key)
.append(": ").append(value.toString()).append("\n");
}
return "result.toString()";
return result.toString();
}

@Serial
private static final long serialVersionUID = 234567L;
private HashMap<String, Course> courses;
private Map<String, Course> courses;
private String departmentChair;
private String deptCode;
private int numberOfMajors;
Expand Down
Loading
Loading