Package no.ugland.utransprod.model

Examples of no.ugland.utransprod.model.Accident


    @Override
    public final AccidentModel getBufferedObjectModel(
            final PresentationModel presentationModel) {
        AccidentModel accidentModel = new AccidentModel(
                new Accident());
        accidentModel.setAccidentId((Integer) presentationModel
                .getBufferedValue(PROPERTY_ACCIDENT_ID));
        accidentModel.setRegisteredBy((String) presentationModel
                .getBufferedValue(PROPERTY_REGISTERED_BY));
        accidentModel.setRegistrationDate((Date) presentationModel
View Full Code Here


     * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
     */
    public void actionPerformed(final ActionEvent arg0) {
        AccidentViewHandler accidentViewHandler = new AccidentViewHandler(login,managerRepository);

        AccidentModel accidentModel = new AccidentModel(new Accident());
        EditAccidentView editAccidentView = new EditAccidentView(false, accidentModel, accidentViewHandler);

        menuBarBuilder.openFrame(editAccidentView);
    }
View Full Code Here

    dialogFixture.checkBox("CheckBoxPolice").check();
    dialogFixture.checkBox("CheckBoxSocialSecurity").check();

    dialogFixture.button("SaveAccident").click();

    Accident accident = new Accident();
    accident.setRegisteredBy("test");

    List<Accident> list = accidentManager.findByObject(accident);
    assertNotNull(list);
    assertEquals(1, list.size());

    accident = list.get(0);

    assertEquals("test", accident.getRegisteredBy());
    assertEquals("Transport", accident.getJobFunction()
        .getJobFunctionName());
    assertEquals("tiltaksbeskrivelse", accident
        .getPreventiveActionComment());
    assertEquals("testbeskrivelse", accident.getAccidentDescription());
    assertEquals("test�rsak", accident.getAccidentCause());
    assertEquals(Integer.valueOf(1), accident.getPersonalInjury());
    assertEquals(Integer.valueOf(1), accident.getReportedLeader());
    assertEquals(Integer.valueOf(1), accident.getReportedPolice());
    assertEquals(Integer.valueOf(1), accident.getReportedSocialSecurity());
    dialogFixture.close();
  }
View Full Code Here

    Login login = new LoginImpl(user, userType);

    AccidentViewHandler accidentViewHandler = new AccidentViewHandler(
        login, managerRepository);

    AccidentModel accidentModel = new AccidentModel(new Accident());
    final EditAccidentView editAccidentView = new EditAccidentView(false,
        accidentModel, accidentViewHandler);

    JDialog dialog = GuiActionRunner.execute(new GuiQuery<JDialog>() {
      protected JDialog executeInEDT() {
View Full Code Here

  @After
  public void tearDown() throws Exception {
    dialogFixture.cleanUp();

    Accident accident = new Accident();
    accident.setRegisteredBy("test");
    List<Accident> list = accidentManager.findByObject(accident);
    if (list != null) {
      for (Accident acc : list) {
        accidentManager.removeObject(acc);
      }
View Full Code Here

    dialogFixture.checkBox("CheckBoxPolice").check();
    dialogFixture.checkBox("CheckBoxSocialSecurity").check();

    dialogFixture.button("SaveAccident").click();

    Accident accident = new Accident();
    accident.setRegisteredBy("test");

    List<Accident> list = accidentManager.findByObject(accident);
    assertNotNull(list);
    assertEquals(1, list.size());

    accident = list.get(0);

    assertEquals("test", accident.getRegisteredBy());
    assertEquals("Transport", accident.getJobFunction()
        .getJobFunctionName());
    assertEquals("testbeskrivelse", accident.getAccidentDescription());
    assertEquals("test�rsak", accident.getAccidentCause());
    assertEquals(Integer.valueOf(1), accident.getPersonalInjury());
    assertEquals(Integer.valueOf(1), accident.getReportedLeader());
    assertEquals(Integer.valueOf(1), accident.getReportedPolice());
    assertEquals(Integer.valueOf(1), accident.getReportedSocialSecurity());
    dialogFixture.close();
  }
View Full Code Here

    dialogFixture.list("ListParticipant").selectItem(0);

    dialogFixture.button("SaveAccident").click();

    Accident accident = new Accident();
    accident.setRegisteredBy("test");

    List<Accident> list = accidentManager.findByObject(accident);
    assertNotNull(list);
    assertEquals(1, list.size());

    accident = list.get(0);

    accidentManager.lazyLoad(accident, new LazyLoadEnum[][] { {
        LazyLoadEnum.ACCIDENT_PARTICIPANTS, LazyLoadEnum.NONE } });

    assertEquals("test", accident.getRegisteredBy());
    assertEquals("Transport", accident.getJobFunction()
        .getJobFunctionName());
    assertEquals("testbeskrivelse", accident.getAccidentDescription());
    assertEquals("test�rsak", accident.getAccidentCause());

    Set<AccidentParticipant> participants = accident
        .getAccidentParticipants();
    assertNotNull(participants);
    assertEquals(1, participants.size());

    AccidentParticipant participant = participants.iterator().next();
View Full Code Here

    dialogFixture.list("ListParticipant").selectItem(0);

    dialogFixture.button("SaveAccident").click();

    Accident accident = new Accident();
    accident.setRegisteredBy("test");

    List<Accident> list = accidentManager.findByObject(accident);
    assertNotNull(list);
    assertEquals(1, list.size());

    accident = list.get(0);

    accidentManager.lazyLoad(accident, new LazyLoadEnum[][] { {
        LazyLoadEnum.ACCIDENT_PARTICIPANTS, LazyLoadEnum.NONE } });

    assertEquals("test", accident.getRegisteredBy());
    assertEquals("Transport", accident.getJobFunction()
        .getJobFunctionName());
    assertEquals("testbeskrivelse", accident.getAccidentDescription());
    assertEquals("test�rsak", accident.getAccidentCause());

    Set<AccidentParticipant> participants = accident
        .getAccidentParticipants();
    assertNotNull(participants);
    assertEquals(1, participants.size());

    AccidentParticipant participant = participants.iterator().next();
    assertEquals("Atle", participant.getFirstName());
    assertEquals("Brekka", participant.getLastName());
    assertEquals("Sj�f�r", participant.getEmployeeType()
        .getEmployeeTypeName());

    dialogFixture.button("ButtonDeleteParticipant").requireEnabled();
    dialogFixture.button("ButtonDeleteParticipant").click();

    JOptionPaneFinder.findOptionPane().using(dialogFixture.robot)
        .buttonWithText("Ja").click();

    assertEquals(0, dialogFixture.list("ListParticipant").target.getModel()
        .getSize());

    dialogFixture.button("SaveAccident").click();

    accident = new Accident();
    accident.setRegisteredBy("test");

    list = accidentManager.findByObject(accident);
    assertNotNull(list);
    assertEquals(1, list.size());

    accident = list.get(0);

    accidentManager.lazyLoad(accident, new LazyLoadEnum[][] { {
        LazyLoadEnum.ACCIDENT_PARTICIPANTS, LazyLoadEnum.NONE } });

    participants = accident.getAccidentParticipants();
    assertNotNull(participants);
    assertEquals(0, participants.size());
    dialogFixture.close();

  }
View Full Code Here

    assertEquals(0, dialogFixture.list("ListParticipant").target.getModel()
        .getSize());

    dialogFixture.button("SaveAccident").click();

    Accident accident = new Accident();
    accident.setRegisteredBy("test");

    List<Accident> list = accidentManager.findByObject(accident);
    assertNotNull(list);
    assertEquals(1, list.size());

    accident = list.get(0);

    accidentManager.lazyLoad(accident, new LazyLoadEnum[][] { {
        LazyLoadEnum.ACCIDENT_PARTICIPANTS, LazyLoadEnum.NONE } });

    assertEquals("test", accident.getRegisteredBy());
    assertEquals("Transport", accident.getJobFunction()
        .getJobFunctionName());
    assertEquals("testbeskrivelse", accident.getAccidentDescription());
    assertEquals("test�rsak", accident.getAccidentCause());

    Set<AccidentParticipant> participants = accident
        .getAccidentParticipants();
    assertNotNull(participants);
    assertEquals(0, participants.size());
    dialogFixture.close();
View Full Code Here

     */
    public void actionPerformed(final ActionEvent arg0) {
      Util.setWaitCursor(window.getComponent());
      AccidentViewHandler accidentViewHandler = new AccidentViewHandler(
          login, managerRepository);
      accidentViewHandler.openEditView(new Accident(), false, window);
      Util.setDefaultCursor(window.getComponent());
    }
View Full Code Here

TOP

Related Classes of no.ugland.utransprod.model.Accident

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.