[ 
https://issues.apache.org/jira/browse/TOMEE-2087?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16087319#comment-16087319
 ] 

ASF GitHub Bot commented on TOMEE-2087:
---------------------------------------

Github user otaviojava commented on a diff in the pull request:

    https://github.com/apache/tomee/pull/88#discussion_r127456747
  
    --- Diff: 
arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/naming/IvmContextTest.java
 ---
    @@ -0,0 +1,67 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.openejb.arquillian.tests.naming;
    +
    +import org.apache.openejb.arquillian.tests.Runner;
    +import org.apache.ziplock.JarLocation;
    +import org.jboss.arquillian.container.test.api.Deployment;
    +import org.jboss.arquillian.junit.Arquillian;
    +import org.jboss.shrinkwrap.api.ShrinkWrap;
    +import org.jboss.shrinkwrap.api.asset.ClassLoaderAsset;
    +import org.jboss.shrinkwrap.api.spec.WebArchive;
    +import org.junit.Test;
    +import org.junit.runner.RunWith;
    +
    +import javax.ejb.EJB;
    +import java.util.logging.Logger;
    +
    +import static org.junit.Assert.assertNotNull;
    +import static org.junit.Assert.assertTrue;
    +
    +@RunWith(Arquillian.class)
    +public class IvmContextTest {
    +    private static final Logger logger = 
Logger.getLogger(IvmContextTest.class.getName());
    +    private static final String TEST_NAME = 
IvmContextTest.class.getSimpleName();
    +    private static final String RESOURCE_EJB_JAR_XML = "ejb-jar.xml";
    +    private static final String CONTENT_LOCATION_EJB_JAR_XML = 
"org/apache/openejb/arquillian/tests/naming/list-context-ejbjar.xml";
    +
    +    @EJB
    +    NamingBean namingBean;
    --- End diff --
    
    Is there any problem, if namingBean be a private attribute?


> IvmContext.list() does not correctly list the context content
> -------------------------------------------------------------
>
>                 Key: TOMEE-2087
>                 URL: https://issues.apache.org/jira/browse/TOMEE-2087
>             Project: TomEE
>          Issue Type: Bug
>            Reporter: Svetlin Zarev
>            Priority: Critical
>         Attachments: sample.zip
>
>
> MyNamingEnumeration.gatherNodes() adds the wrong federated context entries in 
> the result set (related to TOMEE-2086 - it was indeed a typo, but we "fixed" 
> it with the wrong NameNode).
> Another issue is with MyNamingEnumeration.isMyChild() which considers entries 
> that are NOT children to the "parent" tree as such
> One more issue is that the wrong parentNode is passed as argument to 
> gatherNodes in case we are listing the context for any "IvmContext != this"
> To give an example:
> Expected context content:
> {code}
> ### Context: /module
> Name: TestEJB!org.example.TestEJB     
> Class=org.apache.openejb.assembler.classic.JndiBuilder$ContextualEjbLookup    
>   [looking up: TestEJB!org.example.TestEJB]       [Value]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: TestEJB 
> Class=org.apache.openejb.assembler.classic.JndiBuilder$ContextualEjbLookup    
>   [looking up: TestEJB]   [Value]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: ModuleName      Class=java.lang.String  [looking up: ModuleName]        
> [Value]: 
> Name: env     Class=org.apache.naming.NamingContext   [looking up: env]       
> [Value]: org.apache.naming.NamingContext@1bb2d0a8
> ### Context: /module/env
> Name: name    Class=java.lang.String  [looking up: name]      [Value]: 
> module-env
> {code} 
> Actual context content:
> {code}
> ### Context: /module
> Name: global  Class=org.apache.openejb.core.ivm.naming.IvmContext     
> [looking up: global]    > Failed to lookup: global
> Name: dummy   Class=java.lang.String  [looking up: dummy]     > Failed to 
> lookup: dummy
> Name: TestEJB!org.example.TestEJB     
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference     
> [looking up: TestEJB!org.example.TestEJB]       [Reference]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference     
> [looking up: TestEJB]   [Reference]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: ModuleName      Class=java.lang.String  [looking up: ModuleName]        
> [Value]: 
> Name: env     Class=org.apache.openejb.core.ivm.naming.IvmContext     
> [looking up: env]       [Value]: IvmContext{mynode=}
> Name: TestEJB!org.example.TestEJB     
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference     
> [looking up: TestEJB!org.example.TestEJB]       [Reference]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference     
> [looking up: TestEJB]   [Reference]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> ### Context: /module/env
> Name: TestEJB!org.example.TestEJB     
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference     
> [looking up: TestEJB!org.example.TestEJB]       > Failed to lookup: 
> TestEJB!org.example.TestEJB
> Name: TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference     
> [looking up: TestEJB]   > Failed to lookup: TestEJB
> Name: name    Class=java.lang.String  [looking up: name]      [Value]: 
> module-env
> {code}
> Note the "failed too lookup..." messages - these are all objects that MUST 
> NOT be listed as part of that context.
> I'm attaching an application that reproduces the issue. 
> Requesting it like "http://localhost:8080/?ejb"; will print tomee's naming tree
> Requesting it like "http://localhost:8080"; will print tomcat's naming tree



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to