Re: how to test swift api in transient mode

2017-01-18 Thread Andrew Gaul
[parallel discussion on Stack Overflow
https://stackoverflow.com/questions/40929969/transient-mode-for-unit-tests-with-jclouds-and-openstack-swift-doesnt-work
 ]

You can't create a SwiftApi view of a transient blobstore; instead you
must use the portable BlobStore view:

String provider = ...;  // openstack-swift or transient
BlobStoreContext context = ContextBuilder.newBuilder(provider)
.endpoint(endpoint)
.credentials(user, password)
.buildApi(BlobStoreContext.class);
BlobStore blobStore = context.getBlobStore();
// interact with blobStore, e.g., get, put
...
context.close();

On Tue, Nov 29, 2016 at 03:00:00PM +0100, Aleksandra Nowak wrote:
> 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
> >>
> 

-- 
Andrew Gaul
http://gaul.org/


ApacheCon CFP closing soon (11 February)

2017-01-18 Thread Rich Bowen
Hello, fellow Apache enthusiast. Thanks for your participation, and
interest in, the projects of the Apache Software Foundation.

I wanted to remind you that the Call For Papers (CFP) for ApacheCon
North America, and Apache: Big Data North America, closes in less than a
month. If you've been putting it off because there was lots of time
left, it's time to dig for that inspiration and get those talk proposals in.

It's also time to discuss with your developer and user community whether
there's a track of talks that you might want to propose, so that you
have more complete coverage of your project than a talk or two.

We're looking for talks directly, and indirectly, related to projects at
the Apache Software Foundation. These can be anything from in-depth
technical discussions of the projects you work with, to talks about
community, documentation, legal issues, marketing, and so on. We're also
very interested in talks about projects and services built on top of
Apache projects, and case studies of how you use Apache projects to
solve real-world problems.

We are particularly interested in presentations from Apache projects
either in the Incubator, or recently graduated. ApacheCon is where
people come to find out what technology they'll be using this time next
year.

Important URLs are:

To submit a talk for Apache: Big Data -
http://events.linuxfoundation.org/events/apache-big-data-north-america/program/cfp
To submit a talk for ApacheCon -
http://events.linuxfoundation.org/events/apachecon-north-america/program/cfp

To register for Apache: Big Data -
http://events.linuxfoundation.org/events/apache-big-data-north-america/attend/register-
To register for ApacheCon -
http://events.linuxfoundation.org/events/apachecon-north-america/attend/register-

Early Bird registration rates end March 12th, but if you're a committer
on an Apache project, you get the low committer rate, which is less than
half of the early bird rate!

For further updated about ApacheCon, follow us on Twitter, @ApacheCon,
or drop by our IRC channel, #apachecon on the Freenode IRC network. Or
contact me - rbo...@apache.org - with any questions or concerns.

Thanks!

Rich Bowen, VP Conferences, Apache Software Foundation

-- 
(You've received this email because you're on a dev@ or users@ mailing
list of an Apache Software Foundation project. For subscription and
unsubscription information, consult the headers of this email message,
as this varies from one list to another.)