コード例 #1
0
  @Test
  public void test() {
    String[] strs = {"and", "dan"};
    Anagrams a = new Anagrams();
    List<String> result = new ArrayList<String>(Arrays.asList(strs));

    AssertUtil.assertArrayCommonEquals(result, a.anagrams(strs));
  }
コード例 #2
0
  @Test
  public void test4() {
    String[] strs = {"tea", "cat", "abc", "tac", "eds", "cat", "egddfs", "eat"};
    String[] ret = {"tea", "cat", "cat", "tac", "eat"};
    Anagrams a = new Anagrams();
    List<String> result = new ArrayList<String>(Arrays.asList(ret));

    AssertUtil.assertArrayCommonEquals(result, a.anagrams(strs));
  }
コード例 #3
0
  @Override
  public void expected(Object o) {
    assertTrue(o instanceof PersonNetwork);

    PersonNetwork other = (PersonNetwork) o;

    AssertUtil.assertEquals("homeNetwork", homeNetwork, other.isHomeNetwork());
    if (network != null) {
      network.expected(other.getNetwork());
    }
  }
コード例 #4
0
 @Test(description = "Add an Android device.")
 public void testEnrollment() throws Exception {
   JsonObject enrollmentData =
       PayloadGenerator.getJsonPayload(
           Constants.AndroidEnrollment.ENROLLMENT_PAYLOAD_FILE_NAME, Constants.HTTP_METHOD_POST);
   enrollmentData.addProperty(Constants.DEVICE_IDENTIFIER_KEY, Constants.DEVICE_ID);
   MDMResponse response =
       client.post(Constants.AndroidEnrollment.ENROLLMENT_ENDPOINT, enrollmentData.toString());
   Assert.assertEquals(HttpStatus.SC_OK, response.getStatus());
   AssertUtil.jsonPayloadCompare(
       PayloadGenerator.getJsonPayload(
               Constants.AndroidEnrollment.ENROLLMENT_RESPONSE_PAYLOAD_FILE_NAME,
               Constants.HTTP_METHOD_POST)
           .toString(),
       response.getBody(),
       true);
 }