Skip to content

Conversation

@ascopes
Copy link
Owner

@ascopes ascopes commented Feb 19, 2023

Fix explicit class handling.

  • Passing explicit classes to .compile() requires annotation processing #354: Fail if no compilation units are found/filtered classes not found
    • Add new method: PathFileObject#getBinaryName
    • JctCompilationFactoryImpl will now error if no initial compilation units
      were found with a clearer error message.
    • JctCompilationFactoryImpl will now error if any of the explicitly provided
      class names are not found as compilation units.
    • JctCompilationFactoryImpl will now error if the list of provided class
      names is non-null but empty.
  • Contributes to Integration testing coverage #294: Integration test compiling specific class names.
  • API improvement that assists with Integration testing coverage #294: Allow call chaining on PackageContainerGroupAssert#allFilesExist (non-breaking API change).
  • Fixes Missing test for JctCompilationFactoryImpl #356: Write tests for JctCompilationFactoryImpl
    • Add test pack for JctCompilationFactoryImpl.
    • Add new helper test class for Mockito matchers used within
      collection-like types.
    • Add a new method TeeWriter#getContent that gets the lines of content
      within a TeeWriter, as this is easier to stub than #toString due to
      how Mockito works internally.
    • Add a new method TeeWriter#wrapOutputStream that wraps a given
      OutputStream and Charset in an OutputStreamWriter and inserts that
      into a new TeeWriter that is returned.
    • Fix regression in JctCompilationFactoryImpl where the locale was not
      being set during compilations.
    • Fix bug in JctCompilationFactory where the TeeWriter was not being flushed,
      so buffered content may not have been written to System.out properly
      in some edge cases.
    • Improve performance of JctCompilationFactoryImpl for explicit class name
      lookup by avoiding creating a distinct collection that is iteratively
      resized with O(n) space complexity.
  • Fixes Passing explicit classes to .compile() requires annotation processing #354: Fix incorrect logic for filtering explicit class names that previously
    resulted in an exception being raised if annotation processing was not configured in
    a very specific way.

@ascopes ascopes added bug Something isn't working testing Improvements to test packs labels Feb 19, 2023
@ascopes ascopes self-assigned this Feb 19, 2023
…ound

- Add new method: PathFileObject#getBinaryName
- JctCompilationFactoryImpl will now error if no initial compilation units
  were found with a clearer error message.
- JctCompilationFactoryImpl will now error if any of the explicitly provided
  class names are not found as compilation units.
- JctCompilationFactoryImpl will now error if the list of provided class
  names is non-null but empty.
@github-actions
Copy link

github-actions bot commented Feb 19, 2023

Test Results

  1 628 files  +  24    1 628 suites  +24   0s ⏱️ ±0s
23 528 tests +476  23 515 ✔️ +476  13 💤 ±0  0 ±0 
23 792 runs  +476  23 779 ✔️ +476  13 💤 ±0  0 ±0 

Results for commit 46781d0. ± Comparison against base commit 9508405.

♻️ This comment has been updated with latest results.

@codecov-commenter
Copy link

codecov-commenter commented Feb 19, 2023

Codecov Report

Merging #355 (46781d0) into main (9508405) will increase coverage by 2.51%.
The diff coverage is 100.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #355      +/-   ##
==========================================
+ Coverage   78.66%   81.17%   +2.51%     
==========================================
  Files          91       91              
  Lines        2789     2816      +27     
  Branches      231      234       +3     
==========================================
+ Hits         2194     2286      +92     
+ Misses        536      481      -55     
+ Partials       59       49      -10     
Impacted Files Coverage Δ
...es/jct/assertions/PackageContainerGroupAssert.java 43.13% <100.00%> (+25.82%) ⬆️
.../jct/compilers/impl/JctCompilationFactoryImpl.java 98.85% <100.00%> (+23.46%) ⬆️
...a/io/github/ascopes/jct/diagnostics/TeeWriter.java 100.00% <100.00%> (ø)
...ithub/ascopes/jct/filemanagers/PathFileObject.java 100.00% <100.00%> (ø)
...containers/impl/AbstractPackageContainerGroup.java 55.68% <0.00%> (+6.81%) ⬆️
.../jct/workspaces/impl/AbstractManagedDirectory.java 60.00% <0.00%> (+8.00%) ⬆️
...jct/containers/impl/PathWrappingContainerImpl.java 67.34% <0.00%> (+8.16%) ⬆️
...opes/jct/workspaces/impl/DirectoryBuilderImpl.java 82.75% <0.00%> (+82.75%) ⬆️

- Add test pack for JctCompilationFactoryImpl.
- Add new helper test class for Mockito matchers used within
  collection-like types.
- Add a new method TeeWriter#getContent that gets the lines of content
  within a TeeWriter, as this is easier to stub than #toString due to
  how Mockito works internally.
- Add a new method TeeWriter#wrapOutputStream that wraps a given
  OutputStream and Charset in an OutputStreamWriter and inserts that
  into a new TeeWriter that is returned.
- Fix regression in JctCompilationFactoryImpl where the locale was not
  being set during compilations.
- Fix bug in JctCompilationFactory where the TeeWriter was not being flushed,
  so buffered content may not have been written to System.out properly
  in some edge cases.
- Improve performance of JctCompilationFactoryImpl for explicit class name
  lookup by avoiding creating a distinct collection that is iteratively
  resized with O(n) space complexity.
@ascopes ascopes force-pushed the bugfix/354-explicit-classes branch from 5e9c1eb to 46781d0 Compare February 19, 2023 15:36
@ascopes ascopes mentioned this pull request Feb 19, 2023
6 tasks
@ascopes ascopes merged commit 8b373d8 into main Feb 19, 2023
@ascopes ascopes deleted the bugfix/354-explicit-classes branch February 19, 2023 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working testing Improvements to test packs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing test for JctCompilationFactoryImpl Passing explicit classes to .compile() requires annotation processing

3 participants