Skip to content

Commit

Permalink
fix mocking osgi-classes
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Bischof <[email protected]>
  • Loading branch information
stbischof committed Nov 10, 2020
1 parent 405662d commit 06ed6c7
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public synchronized Class<?> loadClass(String name)
Builder<Exception> builder = new ByteBuddy()
.subclass(Exception.class);
return builder.name("org.osgi.framework.InvalidSyntaxException")
.make().load(this, ClassLoadingStrategy.Default.WRAPPER)
.make().load(this, ClassLoadingStrategy.Default.CHILD_FIRST.allowExistingTypes())
.getLoaded();
} else if (name.equals("org.osgi.framework.FrameworkUtil")) {
Builder<Object> builder = new ByteBuddy()
Expand All @@ -81,7 +81,7 @@ public synchronized Class<?> loadClass(String name)
.withParameter(Class.class)
.intercept(MethodDelegation.to(Interceptor.class))
.name(name).make()
.load(this, ClassLoadingStrategy.Default.WRAPPER)
.load(this, ClassLoadingStrategy.Default.CHILD_FIRST.allowExistingTypes())
.getLoaded();
return fwUtil;
} else if (name.startsWith(vaadinPackagePrefix)) {
Expand All @@ -106,7 +106,7 @@ private Class<?> defineBundleClass() {
Builder<?> builder = new ByteBuddy().makeInterface();

Class<?> bundleClass = builder.name("org.osgi.framework.Bundle")
.make().load(this, ClassLoadingStrategy.Default.WRAPPER)
.make().load(this, ClassLoadingStrategy.Default.CHILD_FIRST.allowExistingTypes())
.getLoaded();
return bundleClass;
}
Expand Down

0 comments on commit 06ed6c7

Please sign in to comment.