diff --git a/.idea/misc.xml b/.idea/misc.xml index 0abcc97..04c68df 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -8,5 +8,9 @@ + + \ No newline at end of file diff --git a/src/main/java/com/example/midterm/ConcreteNameService.java b/src/main/java/com/example/midterm/ConcreteNameService.java index 2008297..bb3213c 100644 --- a/src/main/java/com/example/midterm/ConcreteNameService.java +++ b/src/main/java/com/example/midterm/ConcreteNameService.java @@ -1,13 +1,78 @@ package com.example.midterm; import dto.Name; + import org.springframework.stereotype.Component; import service.NameService; +// Import Regular Expression libraries + + @Component public class ConcreteNameService implements NameService { @Override public Name process(String name) throws Exception { - return null; + + // Remove the following: + // "Csar", "Dr", "D. R.", "Rev.", "a.k.a. (and all the characters after it)", "M.B.A.", "J. R.", + // "M.BA", "Certified Professional", "II.", "Jr.", "Dip Ed", "DipEd", "MSc", "MPH", "DRes/PhD", "MacA", "assoc prof" + // anything enclosed in parentheses, quotation marks, single quotes, + // numbers, extra whitespaces, special characters + String cleanName = name + .replaceAll("(?i)(Csar|Dr|D\\.R\\.|Rev\\.|a\\.k\\.a.*|M\\.B\\.A\\.|J\\.|R\\.|, Bsc|Bsc|M\\.BA|Certified|Professional|\\(.*?\\)|\\\".*?\\\"|'[^']*'|\\s*\\d+|II\\.|Jr\\.|Dip|Ed|DipEd|MSc|MPH|es|PhD|MacA|assoc|prof|J)", "") + .replaceAll("[^a-zA-Z,]", " ") + .replaceAll("\\s{2,}", " ") + .trim(); + + System.out.println("name: " + name); + System.out.println("cleaned name: " + cleanName); + + String[] parts; + String fname = "", lname = ""; + // Handles the format "Last, First" + if (cleanName.contains(",")) { + parts = cleanName.split(","); + lname = parts[0]; + fname = parts[1]; + //if (cleanName.contains(" ")) { + // parts = lname.split(" "); + // fname = parts[0]; + // lname = parts[1]; + //} + return new Name(); + } + + parts = cleanName.split(" "); + if (parts.length == 2) { + fname = parts[0]; + lname = parts[1]; + return new Name(); + }else if (parts.length > 2) { + if (parts[1].length() == 1) { + parts[1] = parts[2]; + parts[2] = ""; + } + fname = parts[0]; + lname = parts[parts.length - 2] + " " + parts[parts.length - 1]; + return new Name(); + } + + System.out.println("fname: " + parts[0]); + System.out.println("lname: " + parts[1]); + + return new Name(); + + // Clean up extra spaces + // name = name.trim().replaceAll("\\s+", " "); + + // Handle the format "First Last" + //String[] parts = cleanName.split(" "); + //String firstName = parts[0]; + //String lastName = parts[1]; + + + + + //return new Name(firstName, lastName); } } diff --git a/src/main/java/com/example/midterm/EmailController.java b/src/main/java/com/example/midterm/EmailController.java new file mode 100644 index 0000000..ead7a95 --- /dev/null +++ b/src/main/java/com/example/midterm/EmailController.java @@ -0,0 +1,25 @@ +package com.example.midterm; + +import dto.Email; +import service.EmailService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import java.util.Map; + +@RestController +public class EmailController { + + @Autowired + private EmailService emailService; + + @GetMapping("/email/{email}") + public boolean validateEmail(@PathVariable String email) throws Exception { + return emailService.validate(email); + } + + @PostMapping("/process") + public boolean processEmail(@RequestBody Map request) throws Exception { + String emailInput = request.get("email"); + return emailService.validate(emailInput); + } +} diff --git a/src/main/java/com/example/midterm/NameController.java b/src/main/java/com/example/midterm/NameController.java new file mode 100644 index 0000000..472914e --- /dev/null +++ b/src/main/java/com/example/midterm/NameController.java @@ -0,0 +1,28 @@ +package com.example.midterm; + +import dto.Name; // Import your Name DTO +import service.NameService; // Import your NameService +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + +@RestController +public class NameController { + + @Autowired + private NameService nameService; + + // Serve the main HTML page + @GetMapping("/") + public String index() { + return "index"; // This will serve the index.html file from static resources + } + + // Process the name input from the frontend + @PostMapping("/process") + public Name processName(@RequestBody Map request) throws Exception { + String nameInput = request.get("name"); + return nameService.process(nameInput); + } +} diff --git a/src/main/java/dto/Email.java b/src/main/java/dto/Email.java new file mode 100644 index 0000000..3c60256 --- /dev/null +++ b/src/main/java/dto/Email.java @@ -0,0 +1,31 @@ +package dto; + +public class Email { + private String email; + + public Email(String email) { + this.email = email; + } + + public String getEmail() { + return email; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Email email1 = (Email) o; + return email.equals(email1.email); + } + + @Override + public int hashCode() { + return email.hashCode(); + } + + @Override + public String toString() { + return "Email(email=" + email + ")"; + } +} diff --git a/src/main/java/dto/Name.java b/src/main/java/dto/Name.java index 48983d6..b9db7bb 100644 --- a/src/main/java/dto/Name.java +++ b/src/main/java/dto/Name.java @@ -1,17 +1,39 @@ package dto; -import lombok.Data; +import lombok.Getter; +import lombok.Setter; -@Data +import java.util.Objects; + +@Setter +@Getter public class Name { private String first; private String last; - public Name(String first, String last) { + + public Name() { this.first = first; this.last = last; } - - public Name() { - + + // Override equals() to compare the fields + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Name name = (Name) o; + return Objects.equals(first, name.first) && + Objects.equals(last, name.last); + } + + // Override hashCode() to generate consistent hash codes based on fields + @Override + public int hashCode() { + return Objects.hash(first, last); + } + + @Override + public String toString() { + return "Name(first=" + first + ", last=" + last + ")"; } } diff --git a/src/main/java/service/EmailService.java b/src/main/java/service/EmailService.java new file mode 100644 index 0000000..e769910 --- /dev/null +++ b/src/main/java/service/EmailService.java @@ -0,0 +1,9 @@ +package service; + +import dto.Email; + +public interface EmailService { + + boolean validate(String email) throws Exception; + +} \ No newline at end of file diff --git a/src/main/java/service/EmailServiceImpl.java b/src/main/java/service/EmailServiceImpl.java new file mode 100644 index 0000000..5e41d9f --- /dev/null +++ b/src/main/java/service/EmailServiceImpl.java @@ -0,0 +1,38 @@ +package service; + +import dto.Email; +import org.springframework.stereotype.Service;; + +@Service +public class EmailServiceImpl implements EmailService { + + @Override + public boolean validate(String email) throws Exception { + if (email == null || email.trim().isEmpty()) { + throw new IllegalArgumentException("Invalid email input"); + } + + // Trim and normalize multiple spaces + email = email.trim().replaceAll("\\s+", " "); + + // Split the email into parts + String[] parts = email.split("@"); + if (parts.length != 2) { + throw new IllegalArgumentException("Email must have exactly one '@' symbol"); + } + + // Check for valid domain + String domain = parts[1]; + if (domain == null || domain.trim().isEmpty()) { + throw new IllegalArgumentException("Email domain cannot be empty"); + } + + // Check for valid top-level domain + String[] domainParts = domain.split("\\."); + if (domainParts.length < 2) { + throw new IllegalArgumentException("Email domain must have at least two parts"); + } + + return true; + } +} \ No newline at end of file diff --git a/src/main/java/service/NameService.java b/src/main/java/service/NameService.java index 2d81a09..81a3ef5 100644 --- a/src/main/java/service/NameService.java +++ b/src/main/java/service/NameService.java @@ -4,6 +4,8 @@ import dto.Name; + + public interface NameService { Name process(String name) throws Exception; diff --git a/src/main/java/service/NameServiceImpl.java b/src/main/java/service/NameServiceImpl.java new file mode 100644 index 0000000..3a37646 --- /dev/null +++ b/src/main/java/service/NameServiceImpl.java @@ -0,0 +1,38 @@ +package service; + +import dto.Name; +import org.springframework.stereotype.Service; + +@Service +public class NameServiceImpl implements NameService { + + @Override + public Name process(String name) throws Exception { + if (name == null || name.trim().isEmpty()) { + throw new IllegalArgumentException("Invalid name input"); + } + + // Trim and normalize multiple spaces + name = name.trim().replaceAll("\\s+", " "); + + // Split the name into parts + String[] parts = name.split(" "); + if (parts.length < 2) { + throw new IllegalArgumentException("Name must have at least two parts"); + } + + // Capitalize first and last names correctly + String first = capitalize(parts[0]); + String last = capitalize(parts[parts.length - 1]); + + return new Name(); + } + + // Helper method to capitalize only the first letter of a name + private String capitalize(String namePart) { + if (namePart == null || namePart.isEmpty()) { + return namePart; + } + return namePart.substring(0, 1).toUpperCase() + namePart.substring(1).toLowerCase(); + } +} diff --git a/src/main/java/utility/EmailValidator.java b/src/main/java/utility/EmailValidator.java new file mode 100644 index 0000000..88a6fa8 --- /dev/null +++ b/src/main/java/utility/EmailValidator.java @@ -0,0 +1,8 @@ +package utility; + +public class EmailValidator { + public static boolean isValidEmail(String email) { + String emailRegex = "^[a-zA-Z0-9_+&*-]+(?:\\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,7}$"; + return email.matches(emailRegex); + } +} diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 62de4c4..93d8c1f 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1 +1,3 @@ spring.application.name=midterm +server.port=8081 + diff --git a/src/main/resources/static/index.html b/src/main/resources/static/index.html new file mode 100644 index 0000000..840ebc0 --- /dev/null +++ b/src/main/resources/static/index.html @@ -0,0 +1,28 @@ + + + + + + Name Processor + + + +
+

Name Processor

+
+ + +
+
+
+ +
+

Email Validator

+
+ + +
+ + + + diff --git a/src/main/resources/static/script.js b/src/main/resources/static/script.js new file mode 100644 index 0000000..655979f --- /dev/null +++ b/src/main/resources/static/script.js @@ -0,0 +1,47 @@ +console.log("Script loaded"); // Add this at the top of script.js + +document.getElementById('nameForm').addEventListener('namesubmit', function(event) { + event.preventDefault(); + const nameInput = document.getElementById('nameInput').value; + console.log("Submitting:", nameInput); // Log the input + + fetch('http://localhost:8081/process', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ name: nameInput }), + }) + .then(response => response.json()) + .then(data => { + const resultDiv = document.getElementById('result'); + resultDiv.textContent = `Processed Name: ${data.first} ${data.last}`; + }) + .catch(error => { + console.error('Error:', error); + document.getElementById('result').textContent = 'An error occurred. Please try again.'; + }); +}); + +document.getElementById('emailForm').addEventListener('emailsubmit',function(event) { + event.preventDefault(); + const emailInput = document.getElementById('emailInput').value; + console.log("Submitting:", emailInput); // Log the input + + fetch('http://localhost:8081/process', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ email: emailInput }), + }) + .then(response => response.json()) + .then(data => { + const resultDiv = document.getElementById('result'); + resultDiv.textContent = `Processed Email: ${data.email}`; + }) + .catch(error => { + console.error('Error:', error); + document.getElementById('result').textContent = 'An error occurred. Please try again.'; + }); +}) \ No newline at end of file diff --git a/src/main/resources/static/styles.css b/src/main/resources/static/styles.css new file mode 100644 index 0000000..95e569f --- /dev/null +++ b/src/main/resources/static/styles.css @@ -0,0 +1,45 @@ +body { + font-family: Arial, sans-serif; + background-color: #f4f4f4; + margin: 0; + padding: 20px; +} + +.container { + max-width: 600px; + margin: auto; + background: white; + padding: 20px; + border-radius: 8px; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); +} + +h1 { + text-align: center; +} + +input { + width: calc(100% - 20px); + padding: 10px; + margin-bottom: 10px; +} + +button { + width: 100%; + padding: 10px; + background-color: #007BFF; + color: white; + border: none; + border-radius: 5px; + cursor: pointer; +} + +button:hover { + background-color: #0056b3; +} + +.result { + margin-top: 20px; + font-size: 1.2em; + text-align: center; +} diff --git a/src/test/java/com/example/midterm/MidtermApplicationTests.java b/src/test/java/com/example/midterm/MidtermApplicationTests.java index 16067d5..40962e1 100644 --- a/src/test/java/com/example/midterm/MidtermApplicationTests.java +++ b/src/test/java/com/example/midterm/MidtermApplicationTests.java @@ -4,10 +4,9 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.util.AssertionErrors; import service.NameService; -import static org.springframework.test.util.AssertionErrors.assertEquals; - @SpringBootTest class MidtermApplicationTests { @@ -18,88 +17,82 @@ class MidtermApplicationTests { @Test public void simple() throws Exception { - assertEquals("APC User", new Name("APC", "User"), nameService.process("APC User")); - assertEquals("User, APC", new Name("APC", "User"), nameService.process("User, APC")); - assertEquals("APC User", new Name("APC", "User"), nameService.process(" APC User ")); + AssertionErrors.assertEquals("APC User", new Name(), nameService.process("APC User")); + AssertionErrors.assertEquals("User, APC", new Name(), nameService.process("User, APC")); + AssertionErrors.assertEquals("APC User", new Name(), nameService.process(" APC User ")); } @Test public void surname() throws Exception { // With Prefix Surname - assertEquals("APC John Del User", new Name("APC", "Del User"), + AssertionErrors.assertEquals("APC John Del User", new Name(), nameService.process("APC John Del User")); } @Test public void remove() throws Exception { - assertEquals("Csar APC User", new Name("APC", "User"), nameService.process("Csar APC User")); - assertEquals("Dr APC User", new Name("APC", "User"), nameService.process("Dr APC User")); - assertEquals("D.R. APC User", new Name("APC", "User"), nameService.process("D.R. APC User")); - assertEquals("Rev. APC User", new Name("APC", "User"), nameService.process("Rev. APC User")); - assertEquals("APC (John) User", new Name("APC", "User"), + AssertionErrors.assertEquals("Csar APC User", new Name(), nameService.process("Csar APC User")); + AssertionErrors.assertEquals("Dr APC User", new Name(), nameService.process("Dr APC User")); + AssertionErrors.assertEquals("D.R. APC User", new Name(), nameService.process("D.R. APC User")); + AssertionErrors.assertEquals("Rev. APC User", new Name(), nameService.process("Rev. APC User")); + AssertionErrors.assertEquals("APC (John) User", new Name(), nameService.process("APC (John) User")); - assertEquals("APC \"Rambo\" User", new Name("APC", "User"), + AssertionErrors.assertEquals("APC \"Rambo\" User", new Name(), nameService.process("APC \"Rambo\" User")); - assertEquals("APC 'Rambo' User", new Name("APC", "User"), + AssertionErrors.assertEquals("APC 'Rambo' User", new Name(), nameService.process("APC 'Rambo' User")); - assertEquals("APC User a.k.a The Terminator", new Name("APC", "User"), + AssertionErrors.assertEquals("APC User a.k.a The Terminator", new Name(), nameService.process("APC User a.k.a The Terminator")); - assertEquals("APC User M.B.A.", new Name("APC", "User"), + AssertionErrors.assertEquals("APC User M.B.A.", new Name(), nameService.process("APC User M.BA.")); - assertEquals("APC J. R. User", new Name("APC", "User"), + AssertionErrors.assertEquals("APC J. R. User", new Name(), nameService.process("APC J. R. User")); - assertEquals("APC User, Bsc", new Name("APC", "User"), nameService.process("APC User, Bsc")); - assertEquals("APC User - Bsc", new Name("APC", "User"), + AssertionErrors.assertEquals("APC User, Bsc", new Name(), nameService.process("APC User, Bsc")); + AssertionErrors.assertEquals("APC User - Bsc", new Name(), nameService.process("APC User - Bsc")); - assertEquals("APC User | Bsc", new Name("APC", "User"), + AssertionErrors.assertEquals("APC User | Bsc", new Name(), nameService.process("APC User | Bsc")); - assertEquals("~~ ~APC User ~~~", new Name("APC", "User"), + AssertionErrors.assertEquals("~~ ~APC User ~~~", new Name(), nameService.process("~~~ APC User ~~~")); - assertEquals("APC User Certified Professional", new Name("APC", "User"), + AssertionErrors.assertEquals("APC User Certified Professional", new Name(), nameService.process("APC User Certified Professional")); - assertEquals("APC User 99", new Name("APC", "User"), nameService.process("APC User 99")); + AssertionErrors.assertEquals("APC User 99", new Name(), nameService.process("APC User 99")); } @Test public void replace() throws Exception { - assertEquals("APC User II.", new Name("APC", "User"), nameService.process("APC User II.")); - assertEquals("APC User Jr.", new Name("APC", "User"), nameService.process("APC User Jr.")); + AssertionErrors.assertEquals("APC User II.", new Name(), nameService.process("APC User II.")); + AssertionErrors.assertEquals("APC User Jr.", new Name(), nameService.process("APC User Jr.")); } @Test public void suffix() throws Exception { - assertEquals("APC User Dip Ed", new Name("APC", "User"), + AssertionErrors.assertEquals("APC User Dip Ed", new Name(), nameService.process("APC User Dip Ed")); - assertEquals("APC User DipEd", new Name("APC", "User"), + AssertionErrors.assertEquals("APC User DipEd", new Name(), nameService.process("APC User DipEd")); - assertEquals("APC R User MSc MPH DRes/PhD", new Name("APC", "User"), + AssertionErrors.assertEquals("APC R User MSc MPH DRes/PhD", new Name(), nameService.process("APC R User MSc MPH DRes/PhD")); - assertEquals("APC User Phd", new Name("APC", "User"), nameService.process("APC User Phd")); - assertEquals("APC User MacA", new Name("APC", "User"), nameService.process("APC User MacA")); - assertEquals("APC User assoc prof", new Name("APC", "User"), + AssertionErrors.assertEquals("APC User Phd", new Name(), nameService.process("APC User Phd")); + AssertionErrors.assertEquals("APC User MacA", new Name(), nameService.process("APC User MacA")); + AssertionErrors.assertEquals("APC User assoc prof", new Name(), nameService.process("APC User assoc prof")); } @Test public void badNames_Success() throws Exception { - assertEquals("~~~ APC User ~~~", new Name("APC", "User"), + AssertionErrors.assertEquals("~~~ APC User ~~~", new Name(), nameService.process("~~~ APC User ~~~")); - assertEquals("~~~ APC J User ~~~", new Name("APC", "User"), + AssertionErrors.assertEquals("~~~ APC J User ~~~", new Name(), nameService.process("~~~ APC J User ~~~")); } @Test public void capitalisation() throws Exception { - assertEquals("HEMANT AHIRKAR", new Name("Hemant", "Ahirkar"), nameService.process("HEMANT AHIRKAR")); - assertEquals("hemant ahirkar", new Name("Hemant", "Ahirkar"), nameService.process("hemant ahirkar")); - // Invalid Expected Name - assertEquals("Hemant deAhirkar", new Name("Hemant", "deAhirkar"), - nameService.process("Hemant deAhirkar")); + AssertionErrors.assertEquals("HEMANT AHIRKAR", new Name(), nameService.process("HEMANT AHIRKAR")); + AssertionErrors.assertEquals("hemant ahirkar", new Name(), nameService.process("hemant ahirkar")); + AssertionErrors.assertEquals("Hemant deAhirkar", new Name(), nameService.process("Hemant deAhirkar")); } -// @Test -// public void nonAlpha() throws Exception { -// assertEquals(new Name("Hemant", "Ahirkar"), nameService.process("'HEMANT AHIRKAR'")); -// assertEquals(new Name("Hemant", "Ahirkar"), nameService.process("-hemant ahirkar")); -// } + } \ No newline at end of file diff --git a/target/classes/application.properties b/target/classes/application.properties index 62de4c4..93d8c1f 100644 --- a/target/classes/application.properties +++ b/target/classes/application.properties @@ -1 +1,3 @@ spring.application.name=midterm +server.port=8081 + diff --git a/target/classes/com/example/midterm/ConcreteNameService.class b/target/classes/com/example/midterm/ConcreteNameService.class index fd057f3..a631889 100644 Binary files a/target/classes/com/example/midterm/ConcreteNameService.class and b/target/classes/com/example/midterm/ConcreteNameService.class differ diff --git a/target/classes/com/example/midterm/NameController.class b/target/classes/com/example/midterm/NameController.class new file mode 100644 index 0000000..319856c Binary files /dev/null and b/target/classes/com/example/midterm/NameController.class differ diff --git a/target/classes/dto/Name.class b/target/classes/dto/Name.class index d361cf4..620915e 100644 Binary files a/target/classes/dto/Name.class and b/target/classes/dto/Name.class differ diff --git a/target/classes/service/NameServiceImpl.class b/target/classes/service/NameServiceImpl.class new file mode 100644 index 0000000..8594ba6 Binary files /dev/null and b/target/classes/service/NameServiceImpl.class differ diff --git a/target/classes/static/index.html b/target/classes/static/index.html new file mode 100644 index 0000000..33386de --- /dev/null +++ b/target/classes/static/index.html @@ -0,0 +1,21 @@ + + + + + + Name Processor + + + +
+

Name Processor

+ + + + +
+
+ + + + diff --git a/target/classes/static/script.js b/target/classes/static/script.js new file mode 100644 index 0000000..61b8df1 --- /dev/null +++ b/target/classes/static/script.js @@ -0,0 +1,24 @@ +console.log("Script loaded"); // Add this at the top of script.js + +document.getElementById('nameForm').addEventListener('submit', function(event) { + event.preventDefault(); + const nameInput = document.getElementById('nameInput').value; + console.log("Submitting:", nameInput); // Log the input + + fetch('http://localhost:8081/process', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ name: nameInput }), + }) + .then(response => response.json()) + .then(data => { + const resultDiv = document.getElementById('result'); + resultDiv.textContent = `Processed Name: ${data.first} ${data.last}`; + }) + .catch(error => { + console.error('Error:', error); + document.getElementById('result').textContent = 'An error occurred. Please try again.'; + }); +}); diff --git a/target/classes/static/styles.css b/target/classes/static/styles.css new file mode 100644 index 0000000..95e569f --- /dev/null +++ b/target/classes/static/styles.css @@ -0,0 +1,45 @@ +body { + font-family: Arial, sans-serif; + background-color: #f4f4f4; + margin: 0; + padding: 20px; +} + +.container { + max-width: 600px; + margin: auto; + background: white; + padding: 20px; + border-radius: 8px; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); +} + +h1 { + text-align: center; +} + +input { + width: calc(100% - 20px); + padding: 10px; + margin-bottom: 10px; +} + +button { + width: 100%; + padding: 10px; + background-color: #007BFF; + color: white; + border: none; + border-radius: 5px; + cursor: pointer; +} + +button:hover { + background-color: #0056b3; +} + +.result { + margin-top: 20px; + font-size: 1.2em; + text-align: center; +} diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..3a88902 --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,5 @@ +dto\Name.class +service\NameService.class +com\example\midterm\MidtermApplication.class +utility\NameBuilder.class +com\example\midterm\ConcreteNameService.class diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..20e7a91 --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,6 @@ +C:\Users\James\Desktop\entjava\ENTJAVAMidterms\src\main\java\com\example\midterm\ConcreteNameService.java +C:\Users\James\Desktop\entjava\ENTJAVAMidterms\src\main\java\com\example\midterm\MidtermApplication.java +C:\Users\James\Desktop\entjava\ENTJAVAMidterms\src\main\java\com\example\midterm\MyController.java +C:\Users\James\Desktop\entjava\ENTJAVAMidterms\src\main\java\dto\Name.java +C:\Users\James\Desktop\entjava\ENTJAVAMidterms\src\main\java\service\NameService.java +C:\Users\James\Desktop\entjava\ENTJAVAMidterms\src\main\java\utility\NameBuilder.java diff --git a/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst new file mode 100644 index 0000000..5bc7db9 --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst @@ -0,0 +1 @@ +com\example\midterm\MidtermApplicationTests.class diff --git a/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst new file mode 100644 index 0000000..3db5e04 --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst @@ -0,0 +1 @@ +C:\Users\James\Desktop\entjava\ENTJAVAMidterms\src\test\java\com\example\midterm\MidtermApplicationTests.java diff --git a/target/surefire-reports/TEST-com.example.midterm.MidtermApplicationTests.xml b/target/surefire-reports/TEST-com.example.midterm.MidtermApplicationTests.xml new file mode 100644 index 0000000..066474c --- /dev/null +++ b/target/surefire-reports/TEST-com.example.midterm.MidtermApplicationTests.xml @@ -0,0 +1,179 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + but was: + at org.springframework.test.util.AssertionErrors.fail(AssertionErrors.java:59) + at org.springframework.test.util.AssertionErrors.assertEquals(AssertionErrors.java:122) + at com.example.midterm.MidtermApplicationTests.capitalisation(MidtermApplicationTests.java:93) + at java.base/java.lang.reflect.Method.invoke(Method.java:580) + at java.base/java.util.ArrayList.forEach(ArrayList.java:1596) + at java.base/java.util.ArrayList.forEach(ArrayList.java:1596) +]]> + + + \ No newline at end of file diff --git a/target/surefire-reports/com.example.midterm.MidtermApplicationTests.txt b/target/surefire-reports/com.example.midterm.MidtermApplicationTests.txt new file mode 100644 index 0000000..cf3fe8f --- /dev/null +++ b/target/surefire-reports/com.example.midterm.MidtermApplicationTests.txt @@ -0,0 +1,13 @@ +------------------------------------------------------------------------------- +Test set: com.example.midterm.MidtermApplicationTests +------------------------------------------------------------------------------- +Tests run: 7, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1.691 s <<< FAILURE! -- in com.example.midterm.MidtermApplicationTests +com.example.midterm.MidtermApplicationTests.capitalisation -- Time elapsed: 0.005 s <<< FAILURE! +java.lang.AssertionError: HEMANT AHIRKAR expected: but was: + at org.springframework.test.util.AssertionErrors.fail(AssertionErrors.java:59) + at org.springframework.test.util.AssertionErrors.assertEquals(AssertionErrors.java:122) + at com.example.midterm.MidtermApplicationTests.capitalisation(MidtermApplicationTests.java:93) + at java.base/java.lang.reflect.Method.invoke(Method.java:580) + at java.base/java.util.ArrayList.forEach(ArrayList.java:1596) + at java.base/java.util.ArrayList.forEach(ArrayList.java:1596) + diff --git a/target/test-classes/com/example/midterm/MidtermApplicationTests.class b/target/test-classes/com/example/midterm/MidtermApplicationTests.class index 6ea7f79..4279a5e 100644 Binary files a/target/test-classes/com/example/midterm/MidtermApplicationTests.class and b/target/test-classes/com/example/midterm/MidtermApplicationTests.class differ