コード例 #1
0
 // it is ok to have multiple services in the same classpath (ex. ec2 vs elb)
 @Test
 public void testTransformableToContains() {
   for (TypeToken<? extends View> view : views) {
     ImmutableSet<ApiMetadata> ofType = ImmutableSet.copyOf(Apis.viewableAs(view));
     assert ofType.contains(toTest)
         : String.format("%s not found in %s for %s", toTest, ofType, view);
   }
 }
コード例 #2
0
 /**
  * Returns true if provider or api is currently installed.
  *
  * @param api
  * @return
  */
 private boolean isApiInstalled(String api) {
   boolean apiFound = false;
   try {
     Apis.withId(api);
     apiFound = true;
   } catch (Exception ex) {
     // ignore
   }
   return apiFound;
 }
コード例 #3
0
 @Test
 public void testAllContains() {
   ImmutableSet<ApiMetadata> all = ImmutableSet.copyOf(Apis.all());
   assert all.contains(toTest) : String.format("%s not found in %s", toTest, all);
 }
コード例 #4
0
  @Test
  public void testWithId() {
    ApiMetadata apiMetadata = Apis.withId(toTest.getId());

    assertEquals(toTest, apiMetadata);
  }