Skip to content

Commit

Permalink
also removed JSF ManagedBeans from tests (#1101)
Browse files Browse the repository at this point in the history
* small faces cleanup

* removed JSF ManagedBeans also in XML parser test
  • Loading branch information
tandraschko authored Jan 18, 2024
1 parent 03139fc commit 035d386
Showing 1 changed file with 0 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@

import junit.framework.TestCase;
import org.apache.openejb.jee.FacesConfig;
import org.apache.openejb.jee.FacesManagedBean;
import org.apache.openejb.jee.JaxbJavaee;

import jakarta.xml.bind.JAXBElement;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;

import static org.apache.openejb.jee.JeeTest.marshalAndUnmarshal;

Expand All @@ -37,29 +30,6 @@
*/
public class JsfTest extends TestCase {

/**
* This test requires that there are three managed beans in faces-config.xml. It will ask JaxbJavaee to load faces-config.xml
* and then assert if it found the three managed beans and checks if the class names are correct
*
* @throws Exception
*/
public void testFacesConfig() throws Exception {
final List<String> managedBeanClasses = new ArrayList<String>();
managedBeanClasses.add("org.apache.openejb.faces.EmployeeBean");
managedBeanClasses.add("org.apache.openejb.faces.OneBean");
managedBeanClasses.add("org.apache.openejb.faces.TwoBean");
final InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("jsf/faces-config.xml");
final FacesConfig facesConfig = (FacesConfig) JaxbJavaee.unmarshalJavaee(FacesConfig.class, inputStream);
final List<FacesManagedBean> managedBean = facesConfig.getManagedBean();

for (final FacesManagedBean bean : managedBean) {
assertTrue(managedBeanClasses.contains(bean.getManagedBeanClass().trim()));
}
assertEquals(3, managedBean.size());

marshalAndUnmarshal(FacesConfig.class, "jsf/faces-config.xml", null);
}

public void test10() throws Exception {
marshalAndUnmarshal(FacesConfig.class, "jsf/1_0_dtd/faces-config-simple-src.xml", "jsf/1_0_dtd/faces-config-simple-expected.xml");
marshalAndUnmarshal(FacesConfig.class, "jsf/1_0_dtd/faces-config-moderate-src.xml", "jsf/1_0_dtd/faces-config-moderate-expected.xml");
Expand Down

0 comments on commit 035d386

Please sign in to comment.