@Test
  @InSequence(2)
  public void adminCreateApplicationTest() {
    driver.get(contextRoot.toExternalForm());
    loginPage.waitForPage();
    loginPage.login(ADMIN_USERNAME, PASSWORD);
    if (passwordChangePage.isPagePresent()) {
      passwordChangePage.changePassword(PASSWORD);
    }
    navigation.goToApplications();
    pushAppsPage.waitForPage();

    navigation.goToApplications();
    // initially there shouldn't exist any push applications
    while (!pushAppsPage.getApplicationList().isEmpty()) {
      Application application = pushAppsPage.getApplicationList().get(0);
      application.remove();
      modal.waitForDialog();
      modal.confirmName(application.getName());
      modal.remove();
    }

    pushAppsPage.pressCreateButton();
    pushAppEditPage.registerNewPushApp(ADMIN_APPLICATION, "");

    header.logout();
  }
  @Test
  @InSequence(1)
  public void createNewUserTest() throws URISyntaxException {
    driver.get(authContextRoot.toURI().resolve(CONSOLE_PATH).toString());
    loginPage.waitForPage();
    loginPage.login(ADMIN_USERNAME, PASSWORD);
    if (passwordChangePage.isPagePresent()) {
      passwordChangePage.changePassword(PASSWORD);
    }
    keyCloakNavigation.waitForPage();
    keyCloakNavigation.users();

    User newUser = new User();
    newUser.setUsername(NEW_USER_USERNAME);
    newUser.setEnabled(true);

    usersPage.addUser(newUser);

    userPageNavBar.roleMappings();
    roleMappingsPage.assignRole("developer");
    userPageNavBar.credentials();
    credentialsPage.setPassword(NEW_USER_PASSWORD);
    modal.waitForDialog();
    modal.remove();
    dropdown.click("Sign Out");
    loginPage.waitForPage();
  }
Exemplo n.º 3
0
  public OperandToken evaluate(Token[] operands) {

    // exactly one operand
    if (getNArgIn(operands) != 1) throwMathLibException("fix: number of arguments != 1");

    // only works on numbers
    if (!(operands[0] instanceof DoubleNumberToken))
      throwMathLibException("fix: only works on numbers");

    Frame f = new Frame();
    ModalDialog m =
        new ModalDialog(f, "kk", "What do you want?", new String[] {"ok", "not ok", "maybe"});

    // f.show();
    m.show();

    debugLine("questdlg: " + m.str);

    DoubleNumberToken matrix = ((DoubleNumberToken) operands[0]);
    OperandToken temp = ((OperandToken) matrix.clone());

    double[][] reValues = matrix.getValuesRe();
    double[][] imValues = matrix.getValuesIm();
    for (int y = 0; y < matrix.getSizeY(); y++) {
      for (int x = 0; x < matrix.getSizeX(); x++) {
        if (reValues[y][x] >= 0) {
          // e.g. fix(3.2) => 3
          reValues[y][x] = java.lang.Math.floor(reValues[y][x]);
        } else {
          // e.g. fix(-3.2) => -3
          reValues[y][x] = java.lang.Math.ceil(reValues[y][x]);
        }
        if (imValues[y][x] >= 0) {
          // e.g. fix(3.2i) => 3
          imValues[y][x] = java.lang.Math.floor(imValues[y][x]);
        } else {
          // e.g. fix(-3.2i) => -3
          imValues[y][x] = java.lang.Math.ceil(imValues[y][x]);
        }
      }
    }
    return new DoubleNumberToken(reValues, imValues);
  }
Exemplo n.º 4
0
 /** Imposta il titolo della vista */
 public void setTitle(String title) {
   super.setTitle(title);
   titleLabel.setText(title);
 }
Exemplo n.º 5
0
 protected void setBackgroundColor(Color color) {
   super.setBackgroundColor(color);
   if (m_cmbUser != null) ((BasicComboBoxRenderer) m_cmbUser.getRenderer()).setBackground(color);
 }