New concept: Optional
Write explanation for the Optional concept, as well as the test file, the stub implementation, the reference solution and other required files. Some files must be modified. This is a draft.
This solves #2555
Reviewer Resources:
I just committed a first draft. Don't worry about the linting errors, I will sort them out during this week. I'd like to receive feedback about the reference solution and the test file, the bulk of the work is done.
- Is there an exercise for the
genericsconcept ? That is a prerequisite for this concept. - If that concept is not explained on the Java track, I can adapt it from other track.
@kahgoh @jagdish-15
Thanks @josealonso! I plan to have a look at the draft soon.
In regards to the generics concept, it is covered as generics type.
Thanks @josealonso! I plan to have a look at the draft soon.
In regards to the
genericsconcept, it is covered as generics type.
Thanks for the link to the generic-types exercise!! Shame on me
Which icon should I choose?
Did you mean the icon for the exercise? They get added to exercism/icons repository, though that can be done after the exercise is added. We'll have to make one, but I think it will be the same icon as the original Tim From Marketing, but with a "2" in the top right corner. Compare Wizards and Warriors and Wizards and Warriors 2 for an example.
Did you mean the icon for the exercise? They get added to exercism/icons repository, though that can be done after the exercise is added. We'll have to make one, but I think it will be the same icon as the original Tim From Marketing, but with a "2" in the top right corner. Compare Wizards and Warriors and Wizards and Warriors 2 for an example.
Who can make that icon? I'm sorry I don't know how to edit a simple icon :(
I don't understand why the java-test-runner failed, @kahgoh. It probably has to do with some missing configuration files,
Who can make that icon? I'm sorry I don't know how to edit a simple icon :(
That's fine, we can do that later. For now, let's just work on the concept content.
I don't understand why the java-test-runner failed, @kahgoh. It probably has to do with some missing configuration files,
Its a bit hard to find, but this appears in the log:
tim-from-marketing-2: exemplar solution did not pass the tests
Are the tests passing locally for you?
Are the tests passing locally for you?
Yes.
Maybe this doc on configlet could be useful for you as well to check
Maybe this doc on configlet could be useful for you as well to check
Thanks, I went through it already. I'll have to read it again.
@kahgoh, can you please go through these files and tell me if that's the right approach ? Thanks :)
I will continue tomorrow.
I will continue tomorrow.
No worries @josealonso . There's no hurry for this one, so feel free to take longer if you need to
I will continue tomorrow.
No worries @josealonso . There's no hurry for this one, so feel free to take longer if you need to
-
The value of
concepts.uuidis a zero-length string. I thought it had to match theexercises.uuid, but doing that produced an error, so I left it empty. It's the only error in the configlet phase. -
The tests are failing to build even locally, it might be a configuration issue.
I addressed all the suggestions you made, except using List.of() instead of a function in the tests.
Please tell me how to fix the two errors mentioned above and fell free to suggest any improvements.
Thanks @kahgoh!
The value of concepts.uuid is a zero-length string. I thought it had to match the exercises.uuid, but doing that produced an error, so I left it empty.
They are two different UUIDs. You can generate one using configlet uuid.
The tests are failing to build even locally, it might be a configuration issue.
I'm a little confused as to which solution to look at as there is one in src/reference/java and I can also see an implementation in src/main/java. I assume the one in src/main/java is just a work in progress (ultimately, we want to end up with the working one in src/referece/java). Could you let me know how you are currently testing?
Btw, to test against the reference solution, you can go into the exercises directory and run ./gradlew :concept:tim-from-marketing-2:test.
I've just tried running the tests locally. The failing tests have the following messages:
EmployeeDatabaseTest > Retrieve employee details by id when department is null and name is not null FAILED
org.opentest4j.AssertionFailedError:
expected: "No employee found for id: 6"
but was: "6 - Alice - null"
at [email protected]/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62)
at [email protected]/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502)
at app//EmployeeDatabaseTest.retrieveEmployeeDetailsById_whenDepartmentIsNull(EmployeeDatabaseTest.java:92)
and
EmployeeDatabaseTest > Retrieve employee details by id when the id does not exist FAILED
org.opentest4j.AssertionFailedError:
expected: "No employee found for id: 10"
but was: "That id does not exist: 10"
at [email protected]/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62)
at [email protected]/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502)
at app//EmployeeDatabaseTest.retrieveEmployeeDetailsById_forANonExistingId(EmployeeDatabaseTest.java:100)
I ran them against the .meta/src/reference using gradlew :concept:tim-from-marketing-2:test. Can you see why these test may fail?
The value of concepts.uuid is a zero-length string. I thought it had to match the exercises.uuid, but doing that produced an error, so I left it empty.
They are two different UUIDs. You can generate one using
configlet uuid.The tests are failing to build even locally, it might be a configuration issue.
I'm a little confused as to which solution to look at as there is one in
src/reference/javaand I can also see an implementation insrc/main/java. I assume the one insrc/main/javais just a work in progress (ultimately, we want to end up with the working one insrc/referece/java). Could you let me know how you are currently testing? Oh, sorry, I thought both files had the same content. I changed only the file name, as you suggested. I might have changed something else without realizing it. Let me take a look tonight (in Europe). Thanks for the hint, because I couldn't run the tests locally.
Btw, to test against the reference solution, you can go into the
exercisesdirectory and run./gradlew :concept:tim-from-marketing-2:test. Thanks, hopefully this command will work locally!
I've just tried running the tests locally. The failing tests have the following messages:
EmployeeDatabaseTest > Retrieve employee details by id when department is null and name is not null FAILED org.opentest4j.AssertionFailedError: expected: "No employee found for id: 6" but was: "6 - Alice - null" at [email protected]/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62) at [email protected]/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502) at app//EmployeeDatabaseTest.retrieveEmployeeDetailsById_whenDepartmentIsNull(EmployeeDatabaseTest.java:92)and
EmployeeDatabaseTest > Retrieve employee details by id when the id does not exist FAILED org.opentest4j.AssertionFailedError: expected: "No employee found for id: 10" but was: "That id does not exist: 10" at [email protected]/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62) at [email protected]/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502) at app//EmployeeDatabaseTest.retrieveEmployeeDetailsById_forANonExistingId(EmployeeDatabaseTest.java:100)I ran them against the
.meta/src/referenceusinggradlew :concept:tim-from-marketing-2:test. Can you see why these test may fail?
I'll let you know if I can run the tests locally. Thanks!
I haven't made any progress on this branch since last March, shame on me. I think most of the work is done, but I'm not motivated to follow. So I'm going to unassign me. Thanks for your time and patience, @kahgoh.
No worries @josealonso. Thanks for trying and letting us know.