Skip to content

Commit

Permalink
Fix internal deprecation warnings, close ShrinkWrapClassLoader in tes…
Browse files Browse the repository at this point in the history
…t suite
  • Loading branch information
WolfgangHG committed Nov 30, 2024
1 parent 19f8006 commit 5527e1d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ void decode(byte[] in, int inPos, int inAvail) {
* <code>false</code>, otherwise
* @deprecated 1.5 Use {@link #isBase64(byte[])}, will be removed in 2.0.
*/
@Deprecated
public static boolean isArrayByteBase64(byte[] arrayOctet) {
return isBase64(arrayOctet);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public void initialize() throws Exception {
}

@After
public void finalize() {
public void finalizeTest() {
fire(new AfterClass(TestingClass.class));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ public void test() throws Exception {

JavaArchive archive = ShrinkWrap.create(JavaArchive.class).add(new CtClassAsset(ctClass));

ClassLoader classLoader = new ShrinkWrapClassLoader(ClassLoaderUtils.getBootstrapClassLoader(), archive);
ShrinkWrapClassLoader classLoader = new ShrinkWrapClassLoader(ClassLoaderUtils.getBootstrapClassLoader(), archive);

assertNotNull(classLoader.loadClass(CLASS_NAME));

classLoader.close();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

import static org.junit.Assert.assertNotNull;

import java.io.IOException;

import org.jboss.shrinkwrap.api.classloader.ShrinkWrapClassLoader;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.Test;
Expand All @@ -33,7 +35,7 @@ public void testJavaArchiveFromClass() throws Throwable {
}

@Test
public void testMultipleUse() throws ClassNotFoundException {
public void testMultipleUse() throws ClassNotFoundException, IOException {
JavaArchive archive = ShrinkWrapUtils.getJavaArchiveFromClass(Test.class);

ShrinkWrapClassLoader classLoader =
Expand All @@ -44,5 +46,7 @@ public void testMultipleUse() throws ClassNotFoundException {

assertNotNull(nestedArchive.get("/org/junit/Test.class"));
assertNotNull(nestedArchive.get("/org/junit/Ignore.class"));

classLoader.close();
}
}

0 comments on commit 5527e1d

Please sign in to comment.