Examples of CopyInputStreamInputSupplierMap


Examples of org.jclouds.io.CopyInputStreamInputSupplierMap

      } else {
         throw new UnsupportedOperationException("unsupported base type: " + am);
      }
      // isolate tests from eachother, as default credentialStore is static
      return builder.credentials(identity, credential).modules(
               ImmutableSet.of(new ExpectModule(fn), new NullLoggingModule(), new CredentialStoreModule(new CopyInputStreamInputSupplierMap(
                     new ConcurrentHashMap<String, InputSupplier<InputStream>>())), module)).overrides(props)
               .buildInjector();
   }
View Full Code Here

Examples of org.jclouds.io.CopyInputStreamInputSupplierMap

      Map<String, InputStream> map = getMap(injector);
      check(map, getStore(injector), "i-20312", id, name);
   }

   public void testProvidedMapWithValue() throws IOException {
      Map<String, InputStream> map = new CopyInputStreamInputSupplierMap(
            new ConcurrentHashMap<String, InputSupplier<InputStream>>());

      map.put("test", new ByteArrayInputStream("id: instance1\nname: instancename\n".getBytes()));
      checkConsistent(map, getStore(createInjectorWithProvidedMap(map)), "test", "instance1", "instancename");
      checkConsistent(map, getStore(createInjectorWithProvidedMap(map)), "test", "instance1", "instancename");
      remove(map, getStore(createInjectorWithProvidedMap(map)), "test");

   }
View Full Code Here

Examples of org.jclouds.io.CopyInputStreamInputSupplierMap

      remove(map, getStore(createInjectorWithProvidedMap(map)), "test");

   }

   public void testProvidedConsistentAcrossRepeatedWrites() throws IOException {
      Map<String, InputStream> map = new CopyInputStreamInputSupplierMap(
            new ConcurrentHashMap<String, InputSupplier<InputStream>>());

      Injector injector = createInjectorWithProvidedMap(map);
      assertEquals(injector.getInstance(Key.get(new TypeLiteral<Map<String, InputStream>>() {
      }, Names.named("yaml"))), map);
View Full Code Here

Examples of org.jclouds.io.CopyInputStreamInputSupplierMap

         check(map, store, "test" + i, "instance1" + i, "instancename" + i);

   }

   public void testProvidedConsistentAcrossMultipleInjectors() throws IOException {
      Map<String, InputStream> map = new CopyInputStreamInputSupplierMap(
            new ConcurrentHashMap<String, InputSupplier<InputStream>>());

      put(map, getStore(createInjectorWithProvidedMap(map)), "test", "instance1", "instancename");
      checkConsistent(map, getStore(createInjectorWithProvidedMap(map)), "test", "instance1", "instancename");
      checkConsistent(map, getStore(createInjectorWithProvidedMap(map)), "test", "instance1", "instancename");
View Full Code Here

Examples of org.jclouds.io.CopyInputStreamInputSupplierMap

      } else {
         throw new UnsupportedOperationException("unsupported base type: " + am);
      }
      // isolate tests from eachother, as default credentialStore is static
      return builder.credentials(identity, credential).modules(
               ImmutableSet.of(new ExpectModule(fn), new NullLoggingModule(), new CredentialStoreModule(new CopyInputStreamInputSupplierMap(
                     new ConcurrentHashMap<String, InputSupplier<InputStream>>())), module)).overrides(props)
               .buildInjector();
   }
View Full Code Here

Examples of org.jclouds.io.CopyInputStreamInputSupplierMap

      Map<String, InputStream> map = getMap(injector);
      check(map, getStore(injector), "i-20312", new Credentials(identity, credential));
   }

   public void testProvidedMapWithValue() throws IOException {
      Map<String, InputStream> map = new CopyInputStreamInputSupplierMap(
            new ConcurrentHashMap<String, InputSupplier<InputStream>>());

      map.put("test", new ByteArrayInputStream(json.toJson(new Credentials("user", "pass")).getBytes()));
      checkConsistent(map, getStore(createInjectorWithProvidedMap(map)), "test", new Credentials("user", "pass"));
      checkConsistent(map, getStore(createInjectorWithProvidedMap(map)), "test", new Credentials("user", "pass"));
      remove(map, getStore(createInjectorWithProvidedMap(map)), "test");

   }
View Full Code Here

Examples of org.jclouds.io.CopyInputStreamInputSupplierMap

      remove(map, getStore(createInjectorWithProvidedMap(map)), "test");

   }

   public void testProvidedConsistentAcrossRepeatedWrites() throws IOException {
      Map<String, InputStream> map = new CopyInputStreamInputSupplierMap(
            new ConcurrentHashMap<String, InputSupplier<InputStream>>());

      Injector injector = createInjectorWithProvidedMap(map);
      assertEquals(injector.getInstance(Key.get(new TypeLiteral<Map<String, InputStream>>() {
      })), map);
View Full Code Here

Examples of org.jclouds.io.CopyInputStreamInputSupplierMap

         check(map, store, "test" + i, new Credentials("user" + i, "pass" + i));

   }

   public void testProvidedConsistentAcrossMultipleInjectors() throws IOException {
      Map<String, InputStream> map = new CopyInputStreamInputSupplierMap(
            new ConcurrentHashMap<String, InputSupplier<InputStream>>());

      put(map, getStore(createInjectorWithProvidedMap(map)), "test", new Credentials("user", "pass"));
      checkConsistent(map, getStore(createInjectorWithProvidedMap(map)), "test", new Credentials("user", "pass"));
      checkConsistent(map, getStore(createInjectorWithProvidedMap(map)), "test", new Credentials("user", "pass"));
View Full Code Here

Examples of org.jclouds.io.CopyInputStreamInputSupplierMap

      tryOverrideUsingPropertyKey(provider);
   }

   protected void tryOverrideUsingPropertyKey(String propertyKey) {
      // isolate tests from eachother, as default credentialStore is static
      Module credentialStoreModule = new CredentialStoreModule(new CopyInputStreamInputSupplierMap(
            new ConcurrentHashMap<String, InputSupplier<InputStream>>()));

      ComputeServiceContext context = null;
      try {
         Properties overrides = setupProperties();
View Full Code Here

Examples of org.jclouds.io.CopyInputStreamInputSupplierMap

      Map<String, InputStream> map = getMap(injector);
      check(map, getStore(injector), "i-20312", new Credentials(identity, credential));
   }

   public void testProvidedMapWithValue() throws IOException {
      Map<String, InputStream> map = new CopyInputStreamInputSupplierMap(
            new ConcurrentHashMap<String, InputSupplier<InputStream>>());

      map.put("test", new ByteArrayInputStream(json.toJson(new Credentials("user", "pass")).getBytes()));
      checkConsistent(map, getStore(createInjectorWithProvidedMap(map)), "test", new Credentials("user", "pass"));
      checkConsistent(map, getStore(createInjectorWithProvidedMap(map)), "test", new Credentials("user", "pass"));
      remove(map, getStore(createInjectorWithProvidedMap(map)), "test");

   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.