diff --git a/.codelab/revpro.yml b/.codelab/revpro.yml index 1befed7ee2..25f2a3d6a2 100644 --- a/.codelab/revpro.yml +++ b/.codelab/revpro.yml @@ -1,48 +1,1074 @@ --- :lab_name: pep-labs :repo_path: "/workspace/revpro-cli/pep-labs" -:previous_lab: -:current_lab: -:origin_remote: https://github.com/revature-curriculum/pep-labs +:previous_lab: Library +:current_lab: Library +:origin_remote: https://github.com/oseghale/pep-labs :repo_clone_folder: "/workspace/revpro-cli/pep-labs" -:github_username: revature-curriculum -:git_name: ubshreenath -:git_email: sreenathb@revature.com +:github_username: oseghale +:git_name: oseghale +:git_email: ebeaemmanuel@gmail.com :gitpod: :gitpod_workspace_context: isFile: false path: '' - title: ubshreenath/revpro-cli - main + title: oseghale/pep-gitpod-workspace - main ref: main refType: branch - revision: 7f9c4472ee6ba45f99a2da4b3eb53df2af9fea81 + revision: 5d0ee2b0d677c8aee69a52cbfbf882eaab758954 repository: - cloneUrl: https://github.com/ubshreenath/revpro-cli.git + cloneUrl: https://github.com/oseghale/pep-gitpod-workspace.git host: github.com - name: revpro-cli - owner: ubshreenath - private: true + name: pep-gitpod-workspace + owner: oseghale + private: false fork: parent: - cloneUrl: https://github.com/revature-curriculum/revpro-cli.git + cloneUrl: https://github.com/revature-curriculum/pep-gitpod-workspace.git host: github.com - name: revpro-cli + name: pep-gitpod-workspace owner: revature-curriculum - private: true - normalizedContextURL: https://github.com/ubshreenath/revpro-cli - checkoutLocation: revpro-cli - upstreamRemoteURI: https://github.com/revature-curriculum/revpro-cli.git - additionalFiles: - ".gitpod.yml": |+ - # This configuration file was automatically generated by Gitpod. - # Please adjust to your needs (see https://www.gitpod.io/docs/config-gitpod-file) - # and commit this file to your remote git repository to share the goodness with others. - tasks: - - init: bin/setup + private: false + normalizedContextURL: https://github.com/oseghale/pep-gitpod-workspace + checkoutLocation: pep-gitpod-workspace + upstreamRemoteURI: https://github.com/revature-curriculum/pep-gitpod-workspace.git :gitpod_workspace: - :workspace_id: ubshreenath-revprocli-yizgvuzg2kj - :workspace_url: https://ubshreenath-revprocli-yizgvuzg2kj.ws-us77.gitpod.io - :repo_root: "/workspace/revpro-cli" - :git_user_email: sreenathb@revature.com - :git_user_name: ubshreenath -:progress: {} + :workspace_id: oseghale-pepgitpodworks-cx3o719ke5r + :workspace_url: https://oseghale-pepgitpodworks-cx3o719ke5r.ws-us80.gitpod.io + :repo_root: "/workspace/pep-gitpod-workspace" + :git_user_email: ebeaemmanuel@gmail.com + :git_user_name: oseghale +:progress: + :count_labs_total: 96 + :count_labs_passed: 1 + :count_tests_total: 361 + :count_tests_passed: 13 +:progress_test: + :count_tests_total: 361 + :count_tests_passed: 13 + Start: + :Week: 1 + :Order: 1 + :Type: lab + :count_tests: 2 + :count_tests_passed: 0 + :tests: + basicsTest1: 0 + basicsTest2: 0 + HelloWorld: + :Week: 1 + :Order: 2 + :Type: lab + :count_tests: 1 + :count_tests_passed: 0 + :tests: + helloTest: 0 + MethodParameters: + :Week: 1 + :Order: 3 + :Type: lab + :count_tests: 2 + :count_tests_passed: 0 + :tests: + parrotTestHello: 0 + parrotTestPolly: 0 + Comparisons: + :Week: 1 + :Order: 4 + :Type: lab + :count_tests: 16 + :count_tests_passed: 0 + :tests: + isEqualTest1: 0 + isEqualTest2: 0 + greaterThanTest1: 0 + greaterThanTest2: 0 + greaterThanTest3: 0 + lessThanTest1: 0 + lessThanTest2: 0 + lessThanTest3: 0 + greaterThanOrEqualToTest1: 0 + greaterThanOrEqualToTest2: 0 + greaterThanOrEqualToTest3: 0 + lessThanOrEqualToTest1: 0 + lessThanOrEqualToTest2: 0 + lessThanOrEqualToTest3: 0 + notEqualToTest1: 0 + notEqualToTest2: 0 + CombineStrings: + :Week: 1 + :Order: 5 + :Type: lab + :count_tests: 2 + :count_tests_passed: 0 + :tests: + combineTest1: 0 + combineTest2: 0 + IfStatement: + :Week: 1 + :Order: 6 + :Type: lab + :count_tests: 2 + :count_tests_passed: 0 + :tests: + ifStatementTest1: 0 + ifStatementTest2: 0 + BooleanOperators: + :Week: 1 + :Order: 7 + :Type: lab + :count_tests: 12 + :count_tests_passed: 0 + :tests: + returnBooleanTest1: 0 + returnBooleanTest2: 0 + returnNotTest1: 0 + returnNotTest2: 0 + returnAndTest1: 0 + returnAndTest2: 0 + returnAndTest3: 0 + returnAndTest4: 0 + returnOrTest1: 0 + returnOrTest2: 0 + returnOrTest3: 0 + returnOrTest4: 0 + Add: + :Week: 1 + :Order: 8 + :Type: challenge + :count_tests: 2 + :count_tests_passed: 0 + :tests: + addTest1: 0 + addTest2: 0 + Subtract: + :Week: 1 + :Order: 9 + :Type: challenge + :count_tests: 3 + :count_tests_passed: 0 + :tests: + subTest1: 0 + subTest2: 0 + subTest3: 0 + GreaterOrLesser: + :Week: 1 + :Order: 10 + :Type: challenge + :count_tests: 3 + :count_tests_passed: 0 + :tests: + greaterOrLesserTest1: 0 + greaterOrLesserTest2: 0 + greaterOrLesserTest3: 0 + IntroToOOP: + :Week: 2 + :Order: 1 + :Type: lab + :count_tests: 3 + :count_tests_passed: 0 + :tests: + birdTest1: 0 + birdTest2: 0 + birdTest3: 0 + Instantiation: + :Week: 2 + :Order: 2 + :Type: lab + :count_tests: 1 + :count_tests_passed: 0 + :tests: + testObjectNotNull: 0 + Constructors: + :Week: 2 + :Order: 3 + :Type: lab + :count_tests: 3 + :count_tests_passed: 0 + :tests: + player1ArgConstructorTest1: 0 + player1ArgConstructorTest2: 0 + player2ArgConstructorTest1: 0 + Arrays: + :Week: 2 + :Order: 4 + :Type: lab + :count_tests: 9 + :count_tests_passed: 0 + :tests: + getLengthTest1: 0 + getLengthTest2: 0 + getNthElementOfArrayTest1: 0 + getNthElementOfArrayTest2: 0 + getNthElementOfArrayTest3: 0 + setNthElementOfArrayTest1: 0 + setNthElementOfArrayTest2: 0 + returnNewArraySizeNTest1: 0 + returnNewArraySizeNTest2: 0 + WhileLoop: + :Week: 2 + :Order: 5 + :Type: lab + :count_tests: 4 + :count_tests_passed: 0 + :tests: + whileLoopTest1: 0 + whileLoopTest2: 0 + whileLoopTest3: 0 + whileLoopTest4: 0 + ForLoop: + :Week: 2 + :Order: 6 + :Type: lab + :count_tests: 3 + :count_tests_passed: 0 + :tests: + returnStringTest1: 0 + returnStringTest2: 0 + returnStringTest3: 0 + Math: + :Week: 2 + :Order: 7 + :Type: lab + :count_tests: 2 + :count_tests_passed: 0 + :tests: + mathClassTest1: 0 + mathClassTest2: 0 + EvenOrOdd: + :Week: 2 + :Order: 8 + :Type: challenge + :count_tests: 5 + :count_tests_passed: 0 + :tests: + evenTest1: 0 + evenTest2: 0 + evenTest3: 0 + oddTest1: 0 + oddTest2: 0 + HardcodedLogin: + :Week: 2 + :Order: 9 + :Type: challenge + :count_tests: 7 + :count_tests_passed: 0 + :tests: + loginTest1: 0 + loginTest2: 0 + loginTest3: 0 + loginTest4: 0 + loginTest5: 0 + loginTest6: 0 + loginTest7: 0 + FizzBuzz: + :Week: 2 + :Order: 10 + :Type: challenge + :count_tests: 6 + :count_tests_passed: 0 + :tests: + FizzBuzzTest1: 0 + FizzBuzzTest2: 0 + FizzBuzzTest3: 0 + FizzBuzzTest4: 0 + FizzBuzzTest5: 0 + FizzBuzzTest6: 0 + SetAllArrayElementsToN: + :Week: 2 + :Order: 11 + :Type: challenge + :count_tests: 2 + :count_tests_passed: 0 + :tests: + setTest1: 0 + setTest2: 0 + ReturnArrayContents: + :Week: 2 + :Order: 12 + :Type: challenge + :count_tests: 2 + :count_tests_passed: 0 + :tests: + arrayStringTest1: 0 + arrayStringTest2: 0 + GuessingGame: + :Week: 2 + :Order: 13 + :Type: project + :count_tests: 3 + :count_tests_passed: 0 + :tests: + gameServiceTest1: 0 + gameServiceTest2: 0 + gameServiceTest3: 0 + Exceptions: + :Week: 3 + :Order: 1 + :Type: lab + :count_tests: 1 + :count_tests_passed: 0 + :tests: + exceptionMustThrowTest: 0 + UncheckedException: + :Week: 3 + :Order: 2 + :Type: lab + :count_tests: 1 + :count_tests_passed: 0 + :tests: + uncheckedExceptionTest: 0 + ThrowCustomException: + :Week: 3 + :Order: 3 + :Type: lab + :count_tests: 1 + :count_tests_passed: 0 + :tests: + customExceptionTest1: 0 + Lists: + :Week: 3 + :Order: 4 + :Type: lab + :count_tests: 11 + :count_tests_passed: 0 + :tests: + createListTest1: 0 + getSizeTest1: 0 + getSizeTest2: 0 + addItemTest1: 0 + addItemTest2: 0 + getItemTest1: 0 + getItemTest2: 0 + removeFromListTest1: 0 + removeFromListTest2: 0 + updatePositionTest1: 0 + updatePositionTest2: 0 + Sets: + :Week: 3 + :Order: 5 + :Type: lab + :count_tests: 6 + :count_tests_passed: 0 + :tests: + createSetTest: 0 + getSizeTest: 0 + getSizeTest2: 0 + addItemTest1: 0 + addItemTest2: 0 + removeItemTest1: 0 + Map: + :Week: 3 + :Order: 6 + :Type: lab + :count_tests: 7 + :count_tests_passed: 0 + :tests: + createMapTest: 0 + getSizeTest1: 0 + getSizeTest2: 0 + addKeyValuePairTest1: 0 + addKeyValuePairTest2: 0 + removeKeyValuePairTest1: 0 + overwriteValueTest1: 0 + Queue: + :Week: 3 + :Order: 7 + :Type: lab + :count_tests: 7 + :count_tests_passed: 0 + :tests: + createQueueTest: 0 + getSizeTest1: 0 + addToQueueTest1: 0 + addToQueueTest2: 0 + removeFromStartOfQueueTest1: 0 + removeFromStartOfQueueTest2: 0 + getStartOfQueueWithoutRemovingTest1: 0 + Stack: + :Week: 3 + :Order: 8 + :Type: lab + :count_tests: 7 + :count_tests_passed: 0 + :tests: + createStackTest: 0 + getSizeTest1: 0 + getSizeTest2: 0 + addToTopOfStackTest1: 0 + removeFromTopOfStackTest1: 0 + removeFromTopOfStackTest2: 0 + getTopOfStackWithoutRemovingTest1: 0 + Casting: + :Week: 3 + :Order: 9 + :Type: lab + :count_tests: 2 + :count_tests_passed: 0 + :tests: + castTest1: 0 + castTest2: 0 + ArraySum: + :Week: 3 + :Order: 10 + :Type: challenge + :count_tests: 3 + :count_tests_passed: 0 + :tests: + testSum1: 0 + testSum2: 0 + testSumZeroes: 0 + Average: + :Week: 3 + :Order: 11 + :Type: challenge + :count_tests: 4 + :count_tests_passed: 0 + :tests: + averageTest1: 0 + averageTest2: 0 + averageTest3: 0 + averageTest4: 0 + GetMax: + :Week: 3 + :Order: 12 + :Type: challenge + :count_tests: 3 + :count_tests_passed: 0 + :tests: + getMaxTest1: 0 + getMaxTest2: 0 + getMaxTest3: 0 + BankAccount: + :Week: 3 + :Order: 13 + :Type: project + :count_tests: 6 + :count_tests_passed: 0 + :tests: + bankServiceTest1: 0 + bankServiceTest2: 0 + bankServiceTest3: 0 + bankServiceTest4: 0 + bankServiceTest5: 0 + bankServiceTest6: 0 + StaticKeyword: + :Week: 4 + :Order: 1 + :Type: lab + :count_tests: 1 + :count_tests_passed: 0 + :tests: + classTest1: 0 + CreateTable: + :Week: 4 + :Order: 2 + :Type: lab + :count_tests: 1 + :count_tests_passed: 0 + :tests: + problem1Test: 0 + DropTable: + :Week: 4 + :Order: 3 + :Type: lab + :count_tests: 1 + :count_tests_passed: 0 + :tests: + dropTableTest: 0 + Insert: + :Week: 4 + :Order: 4 + :Type: lab + :count_tests: 1 + :count_tests_passed: 0 + :tests: + addSongTest: 0 + SelectAll: + :Week: 4 + :Order: 5 + :Type: lab + :count_tests: 1 + :count_tests_passed: 0 + :tests: + getAllSongsTest: 0 + PrimaryKey: + :Week: 4 + :Order: 6 + :Type: lab + :count_tests: 2 + :count_tests_passed: 0 + :tests: + createTableSurrogateKeyTest: 0 + TestPrimaryKeyUniqueConstraint: 0 + SelectColumns: + :Week: 4 + :Order: 7 + :Type: lab + :count_tests: 1 + :count_tests_passed: 0 + :tests: + problem1Test: 0 + SelectWhere: + :Week: 4 + :Order: 8 + :Type: lab + :count_tests: 2 + :count_tests_passed: 0 + :tests: + problem1GetAllSmiths: 0 + problem2SalaryGreaterThan: 0 + Update: + :Week: 4 + :Order: 9 + :Type: lab + :count_tests: 1 + :count_tests_passed: 0 + :tests: + problem1Test: 0 + Delete: + :Week: 4 + :Order: 10 + :Type: lab + :count_tests: 1 + :count_tests_passed: 0 + :tests: + deleteTest: 0 + SelectWhereAndOr: + :Week: 4 + :Order: 11 + :Type: lab + :count_tests: 3 + :count_tests_passed: 0 + :tests: + testActivityFindEmployeesAnd: 0 + testActivityFindEmployeesOr: 0 + testActivityFindEmployeesNotIn: 0 + OrderBy: + :Week: 4 + :Order: 12 + :Type: lab + :count_tests: 1 + :count_tests_passed: 0 + :tests: + problem1AlphabeticalOrder: 0 + Contains: + :Week: 4 + :Order: 13 + :Type: challenge + :count_tests: 4 + :count_tests_passed: 0 + :tests: + containsTest1: 0 + containTest2: 0 + containTest3: 0 + containTest4: 0 + DoesNotContain: + :Week: 4 + :Order: 14 + :Type: challenge + :count_tests: 4 + :count_tests_passed: 0 + :tests: + containsTest1: 0 + containTest2: 0 + containTest3: 0 + containTest4: 0 + ArraysAreEqual: + :Week: 4 + :Order: 15 + :Type: challenge + :count_tests: 3 + :count_tests_passed: 0 + :tests: + equalTest1: 0 + equalTest2: 0 + equalTest3: 0 + MaxMinusMin: + :Week: 4 + :Order: 16 + :Type: challenge + :count_tests: 4 + :count_tests_passed: 0 + :tests: + maxMinTest1: 0 + maxMinTest2: 0 + maxMinTest3: 0 + maxMinTest4: 0 + GroceryList: + :Week: 4 + :Order: 17 + :Type: project + :count_tests: 2 + :count_tests_passed: 0 + :tests: + groceryListEmptyOnStartTest: 0 + groceryListAddTest1: 0 + Truncate: + :Week: 5 + :Order: 1 + :Type: lab + :count_tests: 1 + :count_tests_passed: 0 + :tests: + problem2Test: 0 + AlterTable: + :Week: 5 + :Order: 2 + :Type: lab + :count_tests: 1 + :count_tests_passed: 0 + :tests: + problem1Test: 0 + AggregateFunctions: + :Week: 5 + :Order: 3 + :Type: lab + :count_tests: 4 + :count_tests_passed: 0 + :tests: + testActivityCalculatePayroll: 0 + testActivityCountTheSmiths: 0 + testActivityFindMinSalary: 0 + testActivityFindMaxSalary: 0 + GroupBy: + :Week: 5 + :Order: 4 + :Type: lab + :count_tests: 1 + :count_tests_passed: 0 + :tests: + problem1Test: 0 + StringMethods: + :Week: 5 + :Order: 5 + :Type: lab + :count_tests: 5 + :count_tests_passed: 0 + :tests: + lengthTest: 0 + charAtTest1: 0 + charAtTest2: 0 + indexOfTest1: 0 + indexOfTest2: 0 + CreatingEndpoints: + :Week: 5 + :Order: 6 + :Type: lab + :count_tests: 1 + :count_tests_passed: 0 + :tests: + shouldAnswerWithTrue: 0 + StatusCodes: + :Week: 5 + :Order: 7 + :Type: lab + :count_tests: 1 + :count_tests_passed: 0 + :tests: + problem1Test: 0 + PathParameters: + :Week: 5 + :Order: 8 + :Type: lab + :count_tests: 2 + :count_tests_passed: 0 + :tests: + problem1aTest: 0 + problem1bTest: 0 + RequestBody: + :Week: 5 + :Order: 9 + :Type: lab + :count_tests: 3 + :count_tests_passed: 0 + :tests: + prob1a: 0 + prob1b: 0 + prob2a: 0 + IndexOf: + :Week: 5 + :Order: 10 + :Type: challenge + :count_tests: 3 + :count_tests_passed: 0 + :tests: + indexTest1: 0 + indexTest2: 0 + indexTest3: 0 + IsSorted: + :Week: 5 + :Order: 11 + :Type: challenge + :count_tests: 3 + :count_tests_passed: 0 + :tests: + isSortedTest1: 0 + isSortedTest2: 0 + isSortedTest3: 0 + ReturnLongestString: + :Week: 5 + :Order: 12 + :Type: challenge + :count_tests: 3 + :count_tests_passed: 0 + :tests: + ReturnLongestStringTest1: 0 + ReturnLongestStringTest2: 0 + ReturnLongestStringTest3: 0 + FlightTracker: + :Week: 5 + :Order: 13 + :Type: project + :count_tests: 13 + :count_tests_passed: 0 + :tests: + getAllFlightsTest1: 0 + getFlightByIDTest1: 0 + getFlightByIDTest2: 0 + getFlightsDAOFromCityToCityTest1: 0 + getFlightsFromCityToCityTest2: 0 + addFlightCheckByIdTest1: 0 + addFlightCheckAllFlightsTest1: 0 + updateFlightDAOTest1: 0 + getAllFlightsTest: 0 + addFlightTest: 0 + getFlightsFromCityToCityTest1: 0 + updateFlightTest1: 0 + updateFlightTestNonExistent: 0 + ForeignKey: + :Week: 6 + :Order: 1 + :Type: lab + :count_tests: 2 + :count_tests_passed: 0 + :tests: + problem1Test: 0 + problem1TestRefIntegrity: 0 + InnerJoin: + :Week: 6 + :Order: 2 + :Type: lab + :count_tests: 1 + :count_tests_passed: 0 + :tests: + testActivityInnerJoin1: 0 + OuterJoin: + :Week: 6 + :Order: 3 + :Type: lab + :count_tests: 2 + :count_tests_passed: 0 + :tests: + activityOuterJoin1: 0 + activityOuterJoin2: 0 + CreateView: + :Week: 6 + :Order: 4 + :Type: lab + :count_tests: 1 + :count_tests_passed: 0 + :tests: + problemTest: 0 + Pyramid: + :Week: 6 + :Order: 5 + :Type: challenge + :count_tests: 2 + :count_tests_passed: 0 + :tests: + pyramidTest1: 0 + pyramidTest2: 0 + ContainsDuplicates: + :Week: 6 + :Order: 6 + :Type: challenge + :count_tests: 4 + :count_tests_passed: 0 + :tests: + containsDuplicatesTest1: 0 + containsDuplicatesTest2: 0 + containsDuplicatesTest3: 0 + containsDuplicatesTest4: 0 + Search2dArray: + :Week: 6 + :Order: 7 + :Type: challenge + :count_tests: 5 + :count_tests_passed: 0 + :tests: + searchTest1: 0 + searchTest2: 0 + searchTest3: 0 + searchTest4: 0 + searchTest5: 0 + CombineArrays: + :Week: 6 + :Order: 8 + :Type: challenge + :count_tests: 2 + :count_tests_passed: 0 + :tests: + combineArraysTest1: 0 + combineArraysTest2: 0 + Library: + :Week: 6 + :Order: 9 + :Type: project + :count_tests: 13 + :count_tests_passed: 13 + :tests: + getAllAuthorsDAOTest: 1 + insertAuthorCheckWithGetAllTest: 1 + getAllAuthorsServiceTest: 1 + addAuthorTest: 1 + getAllBooksTest: 1 + getBookByIsbnTest: 1 + insertBookCheckWithGetAllTest: 1 + insertBookCheckWithGetByIdTest: 1 + getBooksWithBookCountOverZeroTest: 1 + getAllBooksTest1: 1 + addBookVerifyNotNullOnSuccessfulAddTest: 1 + addBookVerifyNullOnUnsuccessfulAdd: 1 + getAllAvailableBooksTest: 1 + AdvancedBooleans: + :Week: 7 + :Order: 1 + :Type: lab + :count_tests: 12 + :count_tests_passed: 0 + :tests: + returnNotBothTest1: 0 + returnNotBothTest2: 0 + returnNotBothTest3: 0 + returnNotBothTest4: 0 + returnExclusiveOrTest1: 0 + returnExclusiveOrTest2: 0 + returnExclusiveOrTest3: 0 + returnExclusiveOrTest4: 0 + returnNeitherNorTest1: 0 + returnNeitherNorTest2: 0 + returnNeitherNorTest3: 0 + returnNeitherNorTest4: 0 + OtherStringMethods: + :Week: 7 + :Order: 2 + :Type: lab + :count_tests: 7 + :count_tests_passed: 0 + :tests: + partOfStringTest1: 0 + partOfStringTest2: 0 + compareToTest1: 0 + compareToTest2: 0 + compareToTest3: 0 + splitStringTest1: 0 + splitStringTest2: 0 + RemoveAllCharacter: + :Week: 7 + :Order: 3 + :Type: challenge + :count_tests: 3 + :count_tests_passed: 0 + :tests: + removeTest1: 0 + removeTest2: 0 + removeTest3: 0 + IsThereSum: + :Week: 7 + :Order: 4 + :Type: challenge + :count_tests: 4 + :count_tests_passed: 0 + :tests: + isThereSumTest1: 0 + isThereSumTest2: 0 + isThereSumTest3: 0 + isThereSumTest4: 0 + WordCount: + :Week: 7 + :Order: 5 + :Type: challenge + :count_tests: 3 + :count_tests_passed: 0 + :tests: + wordCountTest1: 0 + wordCountTest2: 0 + wordCountTest3: 0 + ArrayAbsoluteValue: + :Week: 7 + :Order: 6 + :Type: challenge + :count_tests: 4 + :count_tests_passed: 0 + :tests: + abvTest1: 0 + abvTest2: 0 + abvTest3: 0 + abvTest4: 0 + ParentObjectClassMethods: + :Week: 8 + :Order: 1 + :Type: lab + :count_tests: 9 + :count_tests_passed: 0 + :tests: + implementEqualsMethodTest1: 0 + implementEqualsMethodTest2: 0 + implementEqualsMethodTest3: 0 + implementEqualsMethodTest4: 0 + implementEqualsMethodTest5: 0 + toStringTest1: 0 + toStringTest2: 0 + toStringTest3: 0 + toStringTest4: 0 + Overriding: + :Week: 8 + :Order: 2 + :Type: lab + :count_tests: 2 + :count_tests_passed: 0 + :tests: + noiseTestDog: 0 + noiseTestShiba: 0 + Interfaces: + :Week: 8 + :Order: 3 + :Type: lab + :count_tests: 3 + :count_tests_passed: 0 + :tests: + comparableObjectTest1: 0 + comparableObjectTest2: 0 + comparableObjectTest3: 0 + Generic: + :Week: 8 + :Order: 4 + :Type: lab + :count_tests: 2 + :count_tests_passed: 0 + :tests: + GenericStringTest: 0 + GenericIntTest: 0 + PigLatin: + :Week: 8 + :Order: 5 + :Type: challenge + :count_tests: 3 + :count_tests_passed: 0 + :tests: + pigLatinTest1: 0 + pigLatinTest2: 0 + pigLatinTest3: 0 + CharComparison: + :Week: 8 + :Order: 6 + :Type: challenge + :count_tests: 4 + :count_tests_passed: 0 + :tests: + charCompareTest1: 0 + charCompareTest2: 0 + charCompareTest3: 0 + charCompareTest4: 0 + Isogram: + :Week: 8 + :Order: 7 + :Type: challenge + :count_tests: 6 + :count_tests_passed: 0 + :tests: + isoTest1: 0 + isoTest2: 0 + isoTest3: 0 + isoTest4: 0 + isoTest5: 0 + isoTest6: 0 + InsertPosition: + :Week: 8 + :Order: 8 + :Type: challenge + :count_tests: 5 + :count_tests_passed: 0 + :tests: + testSearchInsert1: 0 + testSearchInsert2: 0 + testSearchInsert3: 0 + testSearchInsert4: 0 + testSearchInsert5: 0 + ReverseAString: + :Week: 9 + :Order: 1 + :Type: challenge + :count_tests: 5 + :count_tests_passed: 0 + :tests: + StringReverseTest1: 0 + StringReverseTest2: 0 + StringReverseTest3: 0 + StringReverseTest4: 0 + StringReverseTest5: 0 + LargestSum: + :Week: 9 + :Order: 2 + :Type: challenge + :count_tests: 4 + :count_tests_passed: 0 + :tests: + sumTest1: 0 + sumTest2: 0 + sumTest3: 0 + sumTest4: 0 + MostCommonCharacter: + :Week: 9 + :Order: 3 + :Type: challenge + :count_tests: 6 + :count_tests_passed: 0 + :tests: + mostCommonCharacterTest1: 0 + mostCommonCharacterTest2: 0 + mostCommonCharacterTest3: 0 + mostCommonCharacterTest4: 0 + mostCommonCharacterTest5: 0 + mostCommonCharacterTest6: 0 + Fibonacci: + :Week: 9 + :Order: 4 + :Type: challenge + :count_tests: 3 + :count_tests_passed: 0 + :tests: + fibTest1: 0 + fibTest2: 0 + fibTest3: 0 + StringIsPalindrome: + :Week: 10 + :Order: 1 + :Type: challenge + :count_tests: 3 + :count_tests_passed: 0 + :tests: + palindromeTest1: 0 + palindromeTest2: 0 + palindromeTest3: 0 + SubArray: + :Week: 10 + :Order: 2 + :Type: challenge + :count_tests: 3 + :count_tests_passed: 0 + :tests: + subTest1: 0 + subTest2: 0 + subTest3: 0 + WordCountMap: + :Week: 10 + :Order: 3 + :Type: challenge + :count_tests: 3 + :count_tests_passed: 0 + :tests: + wordCountTest1: 0 + wordCountTest2: 0 + wordCountTest3: 0 diff --git a/Library/src/main/java/Application/DAO/AuthorDAO.java b/Library/src/main/java/Application/DAO/AuthorDAO.java index 697b469f99..be467b12bb 100644 --- a/Library/src/main/java/Application/DAO/AuthorDAO.java +++ b/Library/src/main/java/Application/DAO/AuthorDAO.java @@ -28,7 +28,7 @@ public List getAllAuthors(){ List authors = new ArrayList<>(); try { //Write SQL logic here - String sql = "change me"; + String sql = "SELECT * FROM author;"; PreparedStatement preparedStatement = connection.prepareStatement(sql); ResultSet rs = preparedStatement.executeQuery(); while(rs.next()){ @@ -52,10 +52,11 @@ public Author insertAuthor(Author author){ try { // Write SQL logic here. You should only be inserting with the name column, so that the database may // automatically generate a primary key. - String sql = "change me" ; + String sql = "INSERT INTO author (name) values (?);" ; PreparedStatement preparedStatement = connection.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS); //write preparedStatement's setString method here. + preparedStatement.setString(1, author.getName()); preparedStatement.executeUpdate(); ResultSet pkeyResultSet = preparedStatement.getGeneratedKeys(); diff --git a/Library/src/main/java/Application/DAO/BookDAO.java b/Library/src/main/java/Application/DAO/BookDAO.java index a05c59759e..9d46baacc7 100644 --- a/Library/src/main/java/Application/DAO/BookDAO.java +++ b/Library/src/main/java/Application/DAO/BookDAO.java @@ -32,7 +32,7 @@ public List getAllBooks(){ List books = new ArrayList<>(); try { //Write SQL logic here - String sql = "change me"; + String sql = "SELECT * from book;"; PreparedStatement preparedStatement = connection.prepareStatement(sql); ResultSet rs = preparedStatement.executeQuery(); while(rs.next()){ @@ -57,10 +57,11 @@ public Book getBookByIsbn(int isbn){ Connection connection = ConnectionUtil.getConnection(); try { //Write SQL logic here - String sql = "change me"; + String sql = "SELECT * from book WHERE isbn = ?;"; PreparedStatement preparedStatement = connection.prepareStatement(sql); //write preparedStatement's setInt method here. + preparedStatement.setInt(1, isbn); ResultSet rs = preparedStatement.executeQuery(); while(rs.next()){ @@ -87,10 +88,16 @@ public Book insertBook(Book book){ Connection connection = ConnectionUtil.getConnection(); try { //Write SQL logic here - String sql = "change me" ; + String sql = "INSERT INTO book(isbn, author_id, title, copies_available) VALUES (?,?,?,?);" ; PreparedStatement preparedStatement = connection.prepareStatement(sql); //write preparedStatement's setString and setInt methods here. + preparedStatement.setInt(1, book.getIsbn()); + preparedStatement.setInt(2, book.getAuthor_id()); + preparedStatement.setString(3, book.getTitle()); + preparedStatement.setInt(4, book.getCopies_available()); + + preparedStatement.executeUpdate(); return book; @@ -109,10 +116,11 @@ public List getBooksWithBookCountOverZero(){ List books = new ArrayList<>(); try { //Write SQL logic here - String sql = "change me"; + String sql = "SELECT * FROM book WHERE copies_available > ?;"; PreparedStatement preparedStatement = connection.prepareStatement(sql); //write preparedStatement's setInt method here. + preparedStatement.setInt(1, 0); ResultSet rs = preparedStatement.executeQuery(); while(rs.next()){ diff --git a/Library/src/main/java/Application/Service/AuthorService.java b/Library/src/main/java/Application/Service/AuthorService.java index dc109d6772..f6679affa1 100644 --- a/Library/src/main/java/Application/Service/AuthorService.java +++ b/Library/src/main/java/Application/Service/AuthorService.java @@ -40,7 +40,7 @@ public AuthorService(AuthorDAO authorDAO){ * @return all authors */ public List getAllAuthors() { - return null; + return authorDAO.getAllAuthors(); } /** * TODO: Use the AuthorDAO to persist an author. The given Author will not have an id provided. @@ -49,6 +49,6 @@ public List getAllAuthors() { * @return The persisted author if the persistence is successful. */ public Author addAuthor(Author author) { - return null; + return authorDAO.insertAuthor(author); } } diff --git a/Library/src/main/java/Application/Service/BookService.java b/Library/src/main/java/Application/Service/BookService.java index 32706ccb53..169bcc89ee 100644 --- a/Library/src/main/java/Application/Service/BookService.java +++ b/Library/src/main/java/Application/Service/BookService.java @@ -40,7 +40,7 @@ public BookService(BookDAO bookDAO){ * @return all books. */ public List getAllBooks() { - return null; + return bookDAO.getAllBooks(); } /** * TODO: Use the bookDAO to persist a book to the database. @@ -51,15 +51,21 @@ public List getAllBooks() { * key was already in use.) */ public Book addBook(Book book) { + // Check if the ISBN exists in the database + if (bookDAO.getBookByIsbn(book.getIsbn()) == null ) { + bookDAO.insertBook(book); + return book; + } else { + return null; + } - return null; } /** * TODO: Use the bookDAO to retrieve a list of all books that have a bookCount above 0. * @return all available books (bookCount over zero) */ public List getAllAvailableBooks() { - return null; + return bookDAO.getBooksWithBookCountOverZero(); } }