Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | Membase | Membase Server 1.6.x

Unit testing serialization pre-membase

3 replies [Last post]
  • Login or register to post comments
Thu, 05/12/2011 - 04:59
terry_brown
Offline
Joined: 04/20/2010
Groups: None

hey folks,

I've recently come across a problem with a complex domain object where it's no longer being cached by membase, and I can't (looking through all the properties/sub properties) see a good reason for it not caching - other objects are, so there isn't a server problem.

What I'd love to do with my code is write simple unit tests against each of my objects that I plan to use within membase to ensure that they *are* serializable, and if not, the test fails with the 'why not'.

I'm using the default transcoder.

At the moment I have:

[Test]
public void MyUser_ShouldBeSerializable()
{
MyUser user = new MyUser();
MemoryStream mem = new MemoryStream();
BinaryFormatter b = new BinaryFormatter();
try
{
b.Serialize(mem, user);
}
catch (Exception ex)
{
Assert.Fail(ex.Message);
}
}

now according to this, it serializes fine (the test passes) so I guess membase (and the enyim client) aren't using the binary formatter to serialize the object.

Can anyone shed any light on what type of serialization I should be testing against to ensure I'm testing my objects against the default transcoder/serializer within membase?

Many thanks,
Terry

Top
  • Login or register to post comments
Fri, 05/20/2011 - 00:42
terry_brown
Offline
Joined: 04/20/2010
Groups: None

I've added a question on stackoverflow in an attempt to get some feedback if anyone has any:

http://stackoverflow.com/questions/6068741/unit-testing-serialization-of...

Top
  • Login or register to post comments
Mon, 05/23/2011 - 20:26
perry
Offline
Joined: 10/11/2010
Groups:

Sorry for the delay Terry, I've got one of our .NET developers looking into this as we speak.

__________________

Forum support is great for free but sometimes you need a guaranteed response time and dedicated resources for your questions or issues.
Consider purchasing enterprise-level support from Couchbase: http://www.couchbase.com/products-and-services/overview
Call or email "sales -at- couchbase-dot- com" today!

Top
  • Login or register to post comments
Tue, 05/24/2011 - 01:46
Attila Kisko
Offline
Joined: 04/22/2010
Groups: None

The client does use the binary serializer (see https://github.com/enyim/EnyimMemcached/blob/master/Enyim.Caching/Memcac...)

Questions:

- What's the return value of Store, when you try to put your object into the cache?
- Can you enable logging to see what's going on in the client? (https://github.com/enyim/EnyimMemcached/wiki/Configure-Logging)

Top
  • Login or register to post comments
  • Login or register to post comments
  • Login
  • Register

Company

  • About Us
  • Leadership
  • Customers
  • Partners
  • Contact Us

Product

  • Couchbase Server
  • Couchbase SDKs
  • Use Cases
  • Documentation
  • Forums

Open Source

  • Couchbase Project
  • Couchbase vs. CouchDB

Commercial

  • Subscriptions & Support
  • Training & Services

News

  • Blog
  • Newsletter
  • Press Releases
  • Buzz

Follow Us

    
  • Customer Login
  • Terms of Service
  • Privacy Policy
  • Trademark Policy
  • Site Map

© 2013 COUCHBASE All rights reserved.

Sign in to Couchbase Community

close
  • Create new account
  • Request new password
You are logging into the Forums, Wiki and Issue Tracker