예제 #1
0
  @Test
  public void test() {
    String user = new String();
    String uploadThumb = new String();
    try {
      user = api.whoAmI();
    } catch (VzaarException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    if (user.length() > 0) System.out.println(user);
    else fail("whoAmI api failed");

    try {
      String path = "D:\\somepath\\to\\test.jpg";
      int videoId = 1628671;
      uploadThumb = api.uploadThumbnail((long) videoId, path);

    } catch (Exception e) {
      e.printStackTrace();
    }

    if (uploadThumb.length() > 0) System.out.println(uploadThumb);
    else fail("uploadThumb api failed");
  }
  @Test
  public void testWhoAmIAPI() {
    // fail("Not yet implemented");
    String user = new String();
    try {
      user = api.whoAmI();
    } catch (VzaarException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    if (user.length() > 0) System.out.println(user);
    else fail("whoAmI api failed");
    UploadSignature signature = api.getUploadSignature(null);

    if (null != signature) System.out.println("Upload Signature - " + signature.toString());
    else fail("getUploadSignature() api failed");
  }