Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
Signed-off-by: jmehrens <[email protected]>
  • Loading branch information
jmehrens committed Nov 19, 2023
1 parent 56377e4 commit cca3b26
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/src/test/java/jakarta/mail/util/DummyStreamProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
import java.io.OutputStream;

public class DummyStreamProvider implements StreamProvider {

public DummyStreamProvider() {
}

@Override
public InputStream inputBase64(InputStream in) {
Expand Down
18 changes: 18 additions & 0 deletions api/src/test/java/jakarta/mail/util/FactoryFinderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@

public class FactoryFinderTest {

public FactoryFinderTest() {
}

@Test
public void specifiedInSystemProperty() {
System.setProperty(Class1.class.getName(), Class2.class.getName());
Expand Down Expand Up @@ -55,6 +58,21 @@ public void doesNotExist() {
// }
}


@Test
public void contextClassLoaderIsBootLoader() {
ClassLoader cl = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader((ClassLoader) null);
//Thread.currentThread().setContextClassLoader(ClassLoader.getPlatformClassLoader());
try {
doesNotExist();
specifiedInSystemProperty();
specifiedInServiceLoader();
} finally {
Thread.currentThread().setContextClassLoader(cl);
}
}

public static class Class1 {
}

Expand Down

0 comments on commit cca3b26

Please sign in to comment.