Exemplo n.º 1
0
  @Test
  @Ignore
  public void vmsSendFileTest() throws FileNotFoundException, SmsapiException {

    final long time = (new Date().getTime() / 1000) + 86400;

    final File fileAudio = new File("src/test/java/pl/smsapi/test/voice_small.wav");

    VMSSend action = apiFactory.actionSend().setFile(fileAudio).setTo(numberTest).setDateSent(time);

    StatusResponse result = action.execute();

    System.out.println("VmsSend:");

    if (result.getCount() > 0) {
      ids = new String[result.getCount()];
    }

    int i = 0;

    for (MessageResponse item : result.getList()) {
      if (!item.isError()) {
        renderMessageItem(item);
        ids[i] = item.getId();
        i++;
      }
    }

    if (ids.length > 0) {
      writeIds(ids);
    }
  }
Exemplo n.º 2
0
  @Test
  @Ignore
  public void vmsSendTtsTest() throws SmsapiException {

    final long time = (new Date().getTime() / 1000) + 86400;

    final String tts = "to jest test";

    VMSSend action =
        apiFactory.actionSend().setTts(tts).setTo(numberTest).setInterval(300).setDateSent(time);

    StatusResponse result = action.execute();

    System.out.println("VmsSend:");

    ids = new String[result.getCount()];
    int i = 0;

    for (MessageResponse item : result.getList()) {
      if (!item.isError()) {
        renderMessageItem(item);
        ids[i] = item.getId();
        i++;
      }
    }

    if (ids.length > 0) {
      writeIds(ids);
    }
  }