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

#16: New Engine: GraphvizCmdLineEngine #19

Merged
merged 9 commits into from
Jun 9, 2017
Merged

#16: New Engine: GraphvizCmdLineEngine #19

merged 9 commits into from
Jun 9, 2017

Conversation

kerkhofsd
Copy link
Contributor

No description provided.

@kerkhofsd
Copy link
Contributor Author

@nidi3 I created a test for my GraphvizCmdLine engine. Since the dot command is not available on the test executor, this tests fails. What do you suggest as a solution for this problem?

@nidi3
Copy link
Owner

nidi3 commented May 19, 2017

Thinks for the PR, good work.

Just a few comments:

  • Would it be possible to just copy a simple mock "dot" file (.bat or .sh) on the filesystem $PATH in order to fix the test?
  • Are the 2 apache commons dependencies really needed?
  • You introduced a circular dependency between engine and service packages: engine.mayUse(model, service, executor); and service.mayUse(engine, executor);

@kerkhofsd
Copy link
Contributor Author

Hi @nidi3

  • Would it be possible to just copy a simple mock "dot" file (.bat or .sh) on the filesystem $PATH in order to fix the test?
    I created a solution where I mock the CommandExecutor. Hence for the tests, the dot command get's executed by the mock, that just copies the expected output file to the correct folder.
    What do you think about this solution?
  • Are the 2 apache commons dependencies really needed?
    The commons-lang3 was needed to determine the OS. I removed this dependency.
    The commons-exec is quite essential in the code to execute the Commands...
  • You introduced a circular dependency between engine and service packages: engine.mayUse(model, service, executor); and service.mayUse(engine, executor)
    Completely agree, I fixed this.

PR Updated, feel free to share your thoughts / comments!

@codecov-io
Copy link

codecov-io commented May 23, 2017

Codecov Report

Merging #19 into master will decrease coverage by 0.41%.
The diff coverage is 71.81%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #19      +/-   ##
============================================
- Coverage     76.78%   76.37%   -0.42%     
- Complexity      510      556      +46     
============================================
  Files            46       51       +5     
  Lines          1650     1799     +149     
  Branches        177      189      +12     
============================================
+ Hits           1267     1374     +107     
- Misses          292      320      +28     
- Partials         91      105      +14
Impacted Files Coverage Δ Complexity Δ
...n/java/guru/nidi/graphviz/service/SystemUtils.java 50% <50%> (ø) 5 <5> (?)
...ava/guru/nidi/graphviz/service/CommandBuilder.java 65.62% <65.62%> (ø) 9 <9> (?)
...ru/nidi/graphviz/engine/GraphvizCmdLineEngine.java 72.72% <72.72%> (ø) 12 <12> (?)
...java/guru/nidi/graphviz/service/CommandRunner.java 77.14% <77.14%> (ø) 17 <17> (?)
...va/guru/nidi/graphviz/service/DefaultExecutor.java 86.66% <86.66%> (ø) 3 <3> (?)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f0d0441...3ed8199. Read the comment docs.

@nidi3
Copy link
Owner

nidi3 commented Jun 2, 2017

Sorry for the late answer, here are some more things:

  • VizJsOptions are not considered, right?
  • Is ICommandExecutor really needed, there's only one implementation. If yes, please drop the I
  • I see System.outs, so I'm going to setup proper logging

@nidi3
Copy link
Owner

nidi3 commented Jun 2, 2017

logging is in place.

@kerkhofsd
Copy link
Contributor Author

Hi @nidi3, thans for the feedback

  • VizJsOptions are not considered, right?
    Indeed. But with some parsing of the VizJsOptions to the correct command line arguments, this should be possible.
  • Is ICommandExecutor really needed, there's only one implementation. If yes, please drop the I
    You are right, in this case it is not needed
  • I see System.outs, so I'm going to setup proper logging
    I used the logging you provided!

@nidi3
Copy link
Owner

nidi3 commented Jun 6, 2017

Sounds great. I refactored AbstractGraphvizEngine so that the signature is String doExecute(String src, Options options); and there's no need to parse the js call.

@kerkhofsd
Copy link
Contributor Author

PR Updated, Options are now included!

@nidi3
Copy link
Owner

nidi3 commented Jun 8, 2017

Great, going to merge it.

@nidi3 nidi3 merged commit cc482eb into nidi3:master Jun 9, 2017
@nidi3
Copy link
Owner

nidi3 commented Jun 9, 2017

It's merged. I adjusted some code styling and replaced all System.out and e.printStacktrace() with logger calls.
I think the handling of Options.engine is not quite right, going to fix this.

@nidi3
Copy link
Owner

nidi3 commented Jun 9, 2017

Sorry, Options.engine works perfectly.

@kerkhofsd
Copy link
Contributor Author

Thanks for merging my PR ;-)

syoon2 referenced this pull request in Summer2023SHY/graphviz-java May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants