Package org.ow2.easybeans.tests.common.ejbs.entity.entitytest03

Examples of org.ow2.easybeans.tests.common.ejbs.entity.entitytest03.Student


    Assert.assertFalse(UserManager.getInstance().addTeacher("NAME1"));
  }
 
  @Test public void addStudentTest1() {
    UserManager.getInstance().addStudent("NAME1");
    Assert.assertTrue(UserManager.getInstance().contains(new Student("NAME1")));
  }
View Full Code Here


  @Test public void singletonTest() {
    Assert.assertTrue(EnrolmentManager.getInstance() == EnrolmentManager.getInstance());
  }
 
  @Test public void createDeleteTest() {
    Student s = new Student("Name");
    ClassGroup cls = new ClassGroup("name", "description");
    Enrolment enrol = EnrolmentManager.getInstance().addEnrolment(s, cls);
    Assert.assertTrue(EnrolmentManager.getInstance().contains(enrol));
    Assert.assertTrue(EnrolmentManager.getInstance().delete(enrol));
    Assert.assertFalse(EnrolmentManager.getInstance().contains(enrol));
View Full Code Here

public class StudentTest {
 
  @Test
  public void creationTest1() {
    new Student("Name");
  }
View Full Code Here

    new Student("Name");
  }
 
  @Test(expected=IllegalArgumentException.class)
  public void creationTest2() {
    new Student("");
  }
View Full Code Here

    new Student("");
  }
 
  @Test(expected=IllegalArgumentException.class)
  public void creationTest3() {
    new Student(null);
  }
View Full Code Here

  public void creationTest3() {
    new Student(null);
  }

  @Test public void equalityTest1() {
    Assert.assertTrue(new Student("Name").equals(new Student("Name")));
  }
View Full Code Here

  @Test public void equalityTest1() {
    Assert.assertTrue(new Student("Name").equals(new Student("Name")));
  }

  @Test public void equalityTest2() {
    Assert.assertFalse(new Student("Name").equals(new Student("Different Name")));
  }
View Full Code Here

            } catch (Exception e) {
                this.logger.error("Cannot configure Carol to use CMI", e);
                throw new EZBComponentException("Cannot configure Carol to use CMI", e);
            }

            ClusterViewManagerFactory clusterViewManagerFactory = ClusterViewManagerFactory.getFactory();

            // Start the manager
            try {
                this.clusterViewManager = (ServerClusterViewManager) clusterViewManagerFactory.create();
            } catch (Exception e) {
                this.logger.error("Cannot retrieve the CMI Server", e);
                throw new EZBComponentException("Cannot retrieve the CMI Server", e);
            }
            if (this.clusterViewManager != null
                    && this.clusterViewManager.getState().equals(ClusterViewManager.State.STOPPED)) {
                if (this.eventComponent != null) {
                    List<Component> components =
                        clusterViewManagerFactory.getConfig().getComponents().getComponents();
                    if (components != null) {
                        for (Component cmiEventComponent : components) {
                            if (org.ow2.cmi.component.event.EventComponent.class.isAssignableFrom(cmiEventComponent.getClass())) {
                                ((org.ow2.cmi.component.event.EventComponent) cmiEventComponent).setEventService(
                                        this.eventComponent.getEventService());
View Full Code Here

            return EASYBEANS_ROOT;
        } else if (EZBContainer.class.isAssignableFrom(clazz)) {
            // The object is an EJB container.

            EZBContainer container = (EZBContainer) instance;

            // Get the archive name (remove all character before the last slash/antislash).
            String archiveName = container.getName().replaceAll("(.*[/\\\\])", "");

            // Compute the application id.
            return EASYBEANS_ROOT + "/" + container.getApplicationName() + "/" + archiveName;
        } else if (Factory.class.isAssignableFrom(clazz)) {
            // The object is a bean factory.

            Factory<?, ?> factory = (Factory<?, ?>) instance;
            EZBContainer container = factory.getContainer();

            // Get the archive name (remove all character before the last slash/antislash).
            String archiveName = container.getName().replaceAll("(.*[/\\\\])", "");

            // Get the bean class name (remove all character before the last point).
            String factoryName = factory.getClassName().replaceAll("(.*\\.)", "");

            // Compute the bean id.
            return EASYBEANS_ROOT + "/" + container.getApplicationName() + "/" + archiveName + "/" + factoryName;
        } else {
            throw new java.lang.IllegalArgumentException("Name is not define for argument of type " + instance.getClass());
        }
    }
View Full Code Here

                    throw new EZBComponentException("Cannot start the CMI Server", e);
                }
            }
        }
        // register the listener.
        EZBEventListener eventListener = new CmiEventListener();
        this.eventComponent.registerEventListener(eventListener);

        this.logger.debug("The CMI configuration extension has been added.");
    }
View Full Code Here

TOP

Related Classes of org.ow2.easybeans.tests.common.ejbs.entity.entitytest03.Student

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.