summaryrefslogtreecommitdiff
path: root/java/tests/Connection/HTTPHelperTest.java
blob: 02a16d838afb0d990409c8644993616b0735fd02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package tests.Connection;

import java.io.*;
import JACE.Connection.*;

public class HTTPHelperTest 
{
  public static void main(String args[])
    {
      // This is just a quick test to confirm that the Base 64 encoding and decoding work
      // (tests the example given in the HTTP 1.1 RFC)

      String secret = "Aladdin:open sesame";

      String encoded = JACE.Connection.HTTPHelper.EncodeBase64(secret);

      System.err.println("Encoding string: " + secret);

      System.err.println("Result: " + encoded);

      System.err.println("Is this right? " + (encoded.equals("QWxhZGRpbjpvcGVuIHNlc2FtZQ==") ? "Yes" : "No"));

      // Decode should also be tested
      //
    }
};