Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Scott M Stark <starksm64@gmail.com>
- Loading branch information
Showing
5 changed files
with
398 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
123 changes: 123 additions & 0 deletions
123
src/com/sun/ts/tests/ejb30/lite/basic/common/JsfClientBase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
/* | ||
* Copyright (c) 2008, 2020 Oracle and/or its affiliates. All rights reserved. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0, which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the | ||
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
* version 2 with the GNU Classpath Exception, which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
*/ | ||
|
||
/* | ||
* $Id$ | ||
*/ | ||
package com.sun.ts.tests.ejb30.lite.basic.common; | ||
|
||
import com.sun.ts.tests.ejb30.common.helper.Helper; | ||
import com.sun.ts.tests.ejb30.common.lite.EJBLiteJsfClientBase; | ||
|
||
import jakarta.annotation.PostConstruct; | ||
import jakarta.annotation.PreDestroy; | ||
import jakarta.ejb.EJB; | ||
|
||
abstract public class JsfClientBase extends EJBLiteJsfClientBase { | ||
protected static final String appName = null; | ||
|
||
protected BasicBeanBase basicBean; | ||
|
||
// beanName is needed since both OneInterfaceBasicBean and | ||
// TwoInterfacesBasicBean | ||
// implements Basic1IF | ||
@EJB(beanName = "OneInterfaceBasicBean", name = "oneInterfaceBasicBeanBoth") | ||
private Basic1IF oneInterfaceBasicBean; | ||
|
||
@EJB(beanName = "OneInterfaceBasicBean", name = "oneInterfaceBasicBeanBoth") | ||
private Basic1IF oneInterfaceBasicBeanAgain; | ||
|
||
@EJB(beanName = "TwoInterfacesBasicBean") | ||
private Basic1IF twoInterfacesBasicBean1; | ||
|
||
@EJB(name = "twoInterfacesBasicBean2Both", beanName = "TwoInterfacesBasicBean") | ||
private Basic2IF twoInterfacesBasicBean2; | ||
|
||
@EJB(name = "twoInterfacesBasicBean2Both", beanName = "TwoInterfacesBasicBean") | ||
private Basic2IF twoInterfacesBasicBean2Again; | ||
|
||
public void add() { | ||
int a = -2, b = -3; | ||
int expected = a + b; | ||
assertEquals("Verify BasicBean.add ", expected, basicBean.add(a, b)); | ||
assertEquals("Verify OneInterfaceBasicBean.add ", expected, | ||
oneInterfaceBasicBean.add(a, b)); | ||
assertEquals("Verify oneInterfaceBasicBeanAgain.add ", expected, | ||
oneInterfaceBasicBeanAgain.add(a, b)); | ||
assertEquals("Verify TwoInterfaceBasicBean(1).add ", expected, | ||
twoInterfacesBasicBean1.add(a, b)); | ||
assertEquals("Verify TwoInterfaceBasicBean(2).add ", expected, | ||
twoInterfacesBasicBean2.add(a, b)); | ||
assertEquals("Verify twoInterfacesBasicBean2Again(2).add ", expected, | ||
twoInterfacesBasicBean2Again.add(a, b)); | ||
} | ||
|
||
public void globalJNDI() { | ||
BasicBeanHelper.globalJNDI(appName, getModuleName(), | ||
basicBean.getBusinessInterface(), getReasonBuffer(), | ||
(jakarta.ejb.EJBContext) null, getContext()); | ||
} | ||
|
||
public void globalJNDI2() { | ||
appendReason(basicBean.globalJNDI(appName, getModuleName())); | ||
} | ||
|
||
public void appJNDI() { | ||
if (getContainer() != null) { | ||
return; | ||
} | ||
BasicBeanHelper.appJNDI(getModuleName(), basicBean.getBusinessInterface(), | ||
getReasonBuffer()); | ||
} | ||
|
||
public void appJNDI2() { | ||
appendReason(basicBean.appJNDI(getModuleName())); | ||
} | ||
|
||
public void moduleJNDI() { | ||
if (getContainer() != null) { | ||
return; | ||
} | ||
BasicBeanHelper.moduleJNDI(basicBean.getBusinessInterface(), | ||
getReasonBuffer()); | ||
} | ||
|
||
public void moduleJNDI2() { | ||
appendReason(basicBean.moduleJNDI()); | ||
} | ||
|
||
@SuppressWarnings("unused") | ||
@PostConstruct | ||
private void postConstruct() { | ||
Helper.getLogger().info("In postConstruct of " + this); | ||
assertNotEquals("check oneInterfaceBasicBean not null", null, | ||
oneInterfaceBasicBean); | ||
assertNotEquals("check oneInterfaceBasicBeanAgain not null", null, | ||
oneInterfaceBasicBeanAgain); | ||
assertNotEquals("check twoInterfacesBasicBean1 not null", null, | ||
twoInterfacesBasicBean1); | ||
assertNotEquals("check twoInterfacesBasicBean2 not null", null, | ||
twoInterfacesBasicBean2); | ||
assertNotEquals("check twoInterfacesBasicBean2Again not null", null, | ||
twoInterfacesBasicBean2Again); | ||
} | ||
|
||
@SuppressWarnings("unused") | ||
@PreDestroy | ||
private void preDestroy() { | ||
Helper.getLogger().info("In preDestroy of " + this); | ||
} | ||
} |
89 changes: 89 additions & 0 deletions
89
src/com/sun/ts/tests/ejb30/lite/basic/singleton/JsfClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/* | ||
* Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0, which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the | ||
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
* version 2 with the GNU Classpath Exception, which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
*/ | ||
|
||
/* | ||
* $Id$ | ||
*/ | ||
package com.sun.ts.tests.ejb30.lite.basic.singleton; | ||
|
||
import java.io.Serializable; | ||
|
||
import com.sun.ts.tests.ejb30.lite.basic.common.JsfClientBase; | ||
|
||
import jakarta.ejb.EJB; | ||
|
||
@jakarta.inject.Named("client") | ||
@jakarta.enterprise.context.RequestScoped | ||
public class JsfClient extends JsfClientBase implements Serializable { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
@SuppressWarnings("unused") | ||
@EJB(beanInterface = BasicBean.class, beanName = "BasicBean") | ||
private void setBasicBean(BasicBean b) { | ||
basicBean = b; | ||
} | ||
|
||
/* | ||
* @testName: add | ||
* | ||
* @test_Strategy: a simple no-interface local singleton bean. The bean field | ||
* (basicBean, of type BasicBeanBase) is declared in superclass (ClientBase), | ||
* and the setter injection is in subclass (Client). Besides, one-interface | ||
* local singleton bean, accessed with Basic1IF; two-interface local singleton | ||
* bean, accessed with Basic1IF; two-interface local singleton bean, accessed | ||
* with Basic2IF. | ||
*/ | ||
/* | ||
* @testName: globalJNDI | ||
* | ||
* @test_Strategy: lookup portable global jndi names of various beans from web | ||
* components or standalone client. | ||
*/ | ||
/* | ||
* @testName: globalJNDI2 | ||
* | ||
* @test_Strategy: lookup portable global jndi names of various beans from ejb | ||
* bean class | ||
*/ | ||
/* | ||
* @testName: appJNDI | ||
* | ||
* @test_Strategy: lookup portable app jndi names of various beans from web | ||
* component client (not standalone client). | ||
*/ | ||
|
||
/* | ||
* @testName: appJNDI2 | ||
* | ||
* @test_Strategy: lookup portable app jndi names of various beans from ejb | ||
* bean class | ||
*/ | ||
|
||
/* | ||
* @testName: moduleJNDI | ||
* | ||
* @test_Strategy: lookup portable module jndi names of various beans from web | ||
* component client (not standalone client). | ||
*/ | ||
|
||
/* | ||
* @testName: moduleJNDI2 | ||
* | ||
* @test_Strategy: lookup portable module jndi names of various beans from ejb | ||
* bean class | ||
*/ | ||
} |
88 changes: 88 additions & 0 deletions
88
src/com/sun/ts/tests/ejb30/lite/basic/stateful/JsfClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
/* | ||
* Copyright (c) 2008, 2020 Oracle and/or its affiliates. All rights reserved. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0, which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the | ||
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
* version 2 with the GNU Classpath Exception, which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
*/ | ||
|
||
/* | ||
* $Id$ | ||
*/ | ||
package com.sun.ts.tests.ejb30.lite.basic.stateful; | ||
|
||
import java.io.Serializable; | ||
|
||
import com.sun.ts.tests.ejb30.lite.basic.common.JsfClientBase; | ||
import jakarta.ejb.EJB; | ||
|
||
@jakarta.inject.Named("client") | ||
@jakarta.enterprise.context.RequestScoped | ||
public class JsfClient extends JsfClientBase implements Serializable { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
@SuppressWarnings("unused") | ||
@EJB(beanInterface = BasicBean.class, beanName = "BasicBean") | ||
private void setBasicBean(BasicBean b) { | ||
basicBean = b; | ||
} | ||
|
||
/* | ||
* @testName: add | ||
* | ||
* @test_Strategy: a simple no-interface local singleton bean. The bean field | ||
* (basicBean, of type BasicBeanBase) is declared in superclass (ClientBase), | ||
* and the setter injection is in subclass (Client). Besides, one-interface | ||
* local singleton bean, accessed with Basic1IF; two-interface local singleton | ||
* bean, accessed with Basic1IF; two-interface local singleton bean, accessed | ||
* with Basic2IF. | ||
*/ | ||
/* | ||
* @testName: globalJNDI | ||
* | ||
* @test_Strategy: lookup portable global jndi names of various beans from web | ||
* components or standalone client. | ||
*/ | ||
/* | ||
* @testName: globalJNDI2 | ||
* | ||
* @test_Strategy: lookup portable global jndi names of various beans from ejb | ||
* bean class | ||
*/ | ||
/* | ||
* @testName: appJNDI | ||
* | ||
* @test_Strategy: lookup portable app jndi names of various beans from web | ||
* component client (not standalone client). | ||
*/ | ||
|
||
/* | ||
* @testName: appJNDI2 | ||
* | ||
* @test_Strategy: lookup portable app jndi names of various beans from ejb | ||
* bean class | ||
*/ | ||
|
||
/* | ||
* @testName: moduleJNDI | ||
* | ||
* @test_Strategy: lookup portable module jndi names of various beans from web | ||
* component client (not standalone client). | ||
*/ | ||
|
||
/* | ||
* @testName: moduleJNDI2 | ||
* | ||
* @test_Strategy: lookup portable module jndi names of various beans from ejb | ||
* bean class | ||
*/ | ||
} |
Oops, something went wrong.