I had to switch (or I thought that I had to) because I wanted JClouds to take care of repeating PUT operations after a failure. And for now it looks like it helped for this issue.
However, I would like to have junit test for this code.
Before I used the same code but with "transient" as a provider.
Now after changing dependency version to 2.0.0 it unit tests trow:

com.google.inject.ConfigurationException: Guice configuration errors:

1) No implementation for org.jclouds.openstack.swift.v1.SwiftApi was bound.
  while locating org.jclouds.openstack.swift.v1.SwiftApi


The same piece of code works perfectly when run with a live swift instance and "openstack-swift" as provider.
Best,
Aleksandra

W dniu 25.11.2016 o 20:03, Andrew Gaul pisze:
Aleksandra, you can use both openstack-swift and transient APIs via the
BlobStore interface.  You should only need to change the provider name
from swift to openstack-swift.

On Fri, Nov 25, 2016 at 04:32:57PM +0100, Aleksandra Nowak wrote:
Hi,
I'm trying to migrate my code to use jclouds 2.0.0. I changed from
swift dependency to openstack-swift, so I use SwiftApi object to
access Swift (instead of BlobStore which I used before). The code
seems to look fine when I run it on a live cluster.

But I had unit tests that were using transient mode/container and
now I cannot make them work.

I got:

com.google.inject.ConfigurationException: Guice configuration errors:

1) No implementation for org.jclouds.openstack.swift.v1.SwiftApi was bound.
   while locating org.jclouds.openstack.swift.v1.SwiftApi

Is transient mode still valid in 2.0? It is listed as possible
"providerOrApi" in
org.jclouds.ContextBuilder#newBuilder(java.lang.String). How to use
it? There is no information about it on documentation pages, wheras
it still claims that " Write your unit tests without mocking
complexity or the brittleness of remote connections. Writing tests
for cloud endpoints is difficult. jclouds provides you with Stub
connections that simulate a cloud without creating network
connections." (from
http://jclouds.apache.org/start/what-is-jclouds/)

Thank you in advance,
Aleksandra


Reply via email to