コード例 #1
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);
    }
  }
コード例 #2
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);
    }
  }
コード例 #3
0
  @Test
  @Ignore
  public void vmsDeleteTest() throws SmsapiException {

    System.out.println("VmsDelete:");
    ids = readIds();

    if (ids != null) {
      VMSDelete action = apiFactory.actionDelete().ids(ids);

      CountableResponse item = action.execute();

      System.out.println("Delete: " + item.getCount());
    }
  }
コード例 #4
0
  @Test
  @Ignore
  public void vmsGetTest() throws SmsapiException {

    System.out.println("VmsGet:");
    ids = readIds();

    if (ids != null) {
      VMSGet action = apiFactory.actionGet().ids(ids);

      StatusResponse result = action.execute();

      for (MessageResponse item : result.getList()) {
        renderMessageItem(item);
      }
    }
  }