예제 #1
0
  public void testConstructor4() {

    String uri = "file:///data/file.xml";

    Origin o = null;

    try {
      o = new Origin(uri);

    } catch (OriginException e) {
      fail(e.getMessage());
    }

    assertEquals(uri, o.toString());
  }
예제 #2
0
  public void testConstructor5() {

    String uri = "http://192.168.0.1:8080";

    Origin o = null;

    try {
      o = new Origin(uri);

    } catch (OriginException e) {
      fail(e.getMessage());
    }

    assertEquals(uri, o.toString());
  }
예제 #3
0
  public void testConstructor3() {

    String uri = "https://example.com";

    Origin o = null;

    try {
      o = new Origin(uri);

    } catch (OriginException e) {
      fail(e.getMessage());
    }

    assertEquals(uri, o.toString());
  }
예제 #4
0
  public void testConstructor6() {

    String uri = "https://LOCALHOST:8080/my-app/upload.php";

    Origin o = null;

    try {
      o = new Origin(uri);

    } catch (OriginException e) {
      fail(e.getMessage());
    }

    assertEquals("https://localhost:8080", o.toString());
  }
예제 #5
0
  public void testEqualityWithString() {

    String uri = "http://my.service.com";

    Origin o = null;

    try {
      o = new Origin(uri);

    } catch (OriginException e) {

      fail(e.getMessage());
    }

    assertTrue(o.equals(uri));
  }
예제 #6
0
  public void testEquality2() {

    String uri1 = "http://MY.service.com";
    String uri2 = "HTTPS://my.service.com/my-app";

    Origin o1 = null;
    Origin o2 = null;

    try {
      o1 = new Origin(uri1);
      o2 = new Origin(uri2);

    } catch (OriginException e) {

      fail(e.getMessage());
    }

    assertFalse(o1.equals(o2));
  }
예제 #7
0
  public void testConstructorUnknown() {

    Origin o = new Origin();

    assertTrue(o.equals(Origin.UNKNOWN));
  }