Skip to content

Commit

Permalink
Merge pull request #23992 from tnagao7/cditck-getknownclasses
Browse files Browse the repository at this point in the history
Fix provider tests in CDI TCK
  • Loading branch information
dmatej authored Jun 14, 2022
2 parents 54e853b + d78d6a3 commit ccae753
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,11 @@ public void addBeanClass(String beanClassName) {
}
}

@Override
public Collection<String> getKnownClasses() {
return moduleClassNames;
}

@Override
public BeansXml getBeansXml() {
WeldBootstrap weldBootstrap = context.getTransientAppMetaData(WELD_BOOTSTRAP, WeldBootstrap.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ public BeanDeploymentArchive getBeanDeploymentArchive(Class<?> beanClass) {

for (BeanDeploymentArchive beanDeploymentArchive : beanDeploymentArchives) {
BeanDeploymentArchiveImpl beanDeploymentArchiveImpl = (BeanDeploymentArchiveImpl) beanDeploymentArchive;
if (beanDeploymentArchiveImpl.getBeanClassObjects().contains(beanClass)) {
if (beanDeploymentArchiveImpl.getKnownClasses().contains(beanClass.getName())) {
return beanDeploymentArchive;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public Collection<Class<?>> getModuleBeanClassObjects() {

@Override
public BeansXml getBeansXml() {
return getModuleBda().getBeansXml();
return null;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import static org.easymock.EasyMock.expect;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertSame;
import static org.junit.jupiter.api.Assertions.assertTrue;

Expand Down Expand Up @@ -115,6 +116,7 @@ public void testConstructor() throws Exception {
assertEquals(WeldUtils.BDAType.UNKNOWN, rootBeanDeploymentArchive.getBDAType());
assertEquals(0, rootBeanDeploymentArchive.getBeanClasses().size());
assertEquals(0, rootBeanDeploymentArchive.getBeanClassObjects().size());
assertNull(rootBeanDeploymentArchive.getBeansXml());

BeanDeploymentArchiveImpl moduleBda = (BeanDeploymentArchiveImpl) rootBeanDeploymentArchive.getModuleBda();
assertNotNull(moduleBda);
Expand Down

0 comments on commit ccae753

Please sign in to comment.