-
Notifications
You must be signed in to change notification settings - Fork 166
Adding members' names to README.md file #124
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
Open
DoolyEvgesha
wants to merge
30
commits into
eugene-krivosheyev:master
Choose a base branch
from
DoolyEvgesha:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
5b48e80
Adding team mate's first name
DoolyEvgesha 39098ea
Added my name to team
1c2228e
Adding team mate's first name
DoolyEvgesha 85b474f
Change source and target version for maven
DoolyEvgesha d1767f4
Added methods in Logger to pass the tests (for Char, String, Boolean …
4070639
Refactor Logger
2f83ae2
Implement correct loggers for tests
DoolyEvgesha f1d95b7
Refactor Logger
ad61e3e
add typeChar + Ignore some tests in third iteration
DoolyEvgesha dfa5473
Merge remote-tracking branch 'origin/master'
DoolyEvgesha 54a70e5
add new logging methods
DoolyEvgesha c384ac6
3rd iteration tests
DoolyEvgesha 2fcfb1e
Refactor Logger
6068047
refactor in order to have DI and IoC
DoolyEvgesha 98df284
refactor in order to have DI and IoC
DoolyEvgesha 1ca698e
Refactor Logger
e5043d8
Refactor Logger
ed51370
Refactor Logger (added controllers)
ece1c6b
new JUnit test for ArrayList
DoolyEvgesha 7e94f8c
Refactor Logger
d853d39
Refactor Logger
a187c0c
start JUnit integration testing services
DoolyEvgesha e5de23e
Add SimpleLoggerTest
3ea21ff
add test for Controller
DoolyEvgesha f7c4b02
Merge remote-tracking branch 'origin/master'
DoolyEvgesha 2468de4
add test for Controller
DoolyEvgesha 35e573b
Added tests for SimpleLogger and ComplexLogger
6514a1a
add test for Controller and run clean-up
DoolyEvgesha a7ad1ca
add some pom changes plus clean-up code
DoolyEvgesha 4c111c8
create server and client proxies
DoolyEvgesha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| package com.acme.edu; | ||
|
|
||
| import com.acme.edu.message.*; | ||
|
|
||
| import java.util.Objects; | ||
|
|
||
| import static com.acme.edu.TypeCodeEnum.NONE; | ||
|
|
||
| public class Controller { | ||
| private final StatesDTO statesDTO; | ||
| private final Flusher flusher; | ||
|
|
||
| public Controller(StatesDTO statesDTO) { | ||
| this.statesDTO = statesDTO; | ||
| this.flusher = new Flusher(); | ||
| } | ||
|
|
||
| public Controller(StatesDTO statesDTO, Flusher flusher) { | ||
| this.statesDTO = statesDTO; | ||
| this.flusher = flusher; | ||
| } | ||
|
|
||
| public void log(Message message) { | ||
| TypeCodeEnum typeCodeEnum = message.getCode(); | ||
|
|
||
| if (statesDTO.getPrevTypeCodeEnum() != NONE && typeCodeEnum != statesDTO.getPrevTypeCodeEnum()) { | ||
| flusher.flush(statesDTO); | ||
| } | ||
|
|
||
| switch (typeCodeEnum) { | ||
| case BOOLEAN: { | ||
| statesDTO.setPrevBoolean((BooleanMessage) message); | ||
| break; | ||
| } | ||
| case CHAR: { | ||
| statesDTO.setPrevChar((CharMessage) message); | ||
| break; | ||
| } | ||
| case STRING: { | ||
| stringIteration((StringMessage) message); | ||
| break; | ||
| } | ||
| case BYTE: { | ||
| statesDTO.setByteSum((ByteMessage) message); | ||
| break; | ||
| } | ||
| case INTEGER: { | ||
| statesDTO.setIntegerSum((IntMessage) message); | ||
| break; | ||
| } | ||
| case ARRAY_INT: { | ||
| statesDTO.arrayIncrementer((ArrayMessage) message); | ||
| break; | ||
| } | ||
| case MATRIX_INT: { | ||
| statesDTO.matrixIncrementer((MatrixMessage) message); | ||
| break; | ||
| } | ||
| default: { | ||
| flusher.flush(typeCodeEnum.getTypeReference() + message); | ||
| } | ||
| } | ||
| statesDTO.setPrevTypeCodeEnum(typeCodeEnum); | ||
| } | ||
|
|
||
| private void stringIteration(StringMessage message) { | ||
| if (Objects.equals(statesDTO.getPrevString(), message.getMessage())) { | ||
| statesDTO.incSimilarStringCounter(); | ||
| } else if (statesDTO.getPrevString() != null) { | ||
| flusher.flush(statesDTO); | ||
| } | ||
| statesDTO.setPrevString(message.getMessage()); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| package com.acme.edu; | ||
|
|
||
| import com.acme.edu.saver.Saver; | ||
| import com.acme.edu.saver.SystemOutSaver; | ||
|
|
||
| public class Flusher { | ||
|
|
||
| private final Saver saver; | ||
|
|
||
| public Flusher() { | ||
| this.saver = new SystemOutSaver(); | ||
| } | ||
|
|
||
| public Flusher(Saver saver) { | ||
| this.saver = saver; | ||
| } | ||
|
|
||
| public void flush(String message) { | ||
| saver.save(message); | ||
| } | ||
|
|
||
| public void flush(StatesDTO statesDTO) { | ||
| switch (statesDTO.getPrevTypeCodeEnum()) { | ||
| case BOOLEAN: { | ||
| saver.save(statesDTO.getPrevTypeCodeEnum().getTypeReference() + statesDTO.getPrevBoolean()); | ||
| break; | ||
| } | ||
| case CHAR: { | ||
| saver.save(statesDTO.getPrevTypeCodeEnum().getTypeReference() + statesDTO.getPrevChar()); | ||
| break; | ||
| } | ||
| case STRING: { | ||
| stringCase(statesDTO); | ||
| break; | ||
| } | ||
| case BYTE: { | ||
| saver.save(statesDTO.getPrevTypeCodeEnum().getTypeReference() + statesDTO.getByteSum()); | ||
| statesDTO.clearByteSum(); | ||
| break; | ||
| } | ||
| case INTEGER: { | ||
| saver.save(statesDTO.getPrevTypeCodeEnum().getTypeReference() + statesDTO.getIntegerSum()); | ||
| statesDTO.clearIntegerSum(); | ||
| break; | ||
| } | ||
| case ARRAY_INT: { | ||
| saver.save(statesDTO.getPrevTypeCodeEnum().getTypeReference() + statesDTO.getArrayIntSum()); | ||
| statesDTO.clearArrayIntSum(); | ||
| break; | ||
| } | ||
| case MATRIX_INT: { | ||
| saver.save(statesDTO.getPrevTypeCodeEnum().getTypeReference() + statesDTO.getMatrixIntSum()); | ||
| statesDTO.clearMatrixIntSum(); | ||
| break; | ||
| } | ||
| default: | ||
| break; | ||
| } | ||
| } | ||
|
|
||
| private void stringCase(StatesDTO statesDTO) { | ||
| statesDTO.incSimilarStringCounter(); | ||
| if (statesDTO.getSimilarStringCounter() > 1) { | ||
| saver.save(statesDTO.getPrevTypeCodeEnum().getTypeReference() + statesDTO.getPrevString() + " (x" + statesDTO.getSimilarStringCounter() + ")"); | ||
| } else { | ||
| saver.save(statesDTO.getPrevTypeCodeEnum().getTypeReference() + statesDTO.getPrevString()); | ||
| } | ||
| statesDTO.setPrevString(null); | ||
| statesDTO.clearSimilarStringCounter(); | ||
| } | ||
| } |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't use header