package com.telefonica.momcollector.memcachedkeyvaluecache;

import com.telefonica.tcloud.collectorinterfaces.KeyValueCache;
import com.telefonica.tcloud.collectorinterfaces.KeyValueCacheFactory;
import java.util.Properties;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

/**
 * Unit test for simple App.
 */
public class AppTest 
    extends TestCase
{
    
    KeyValueCache keyValue;
    /**
     * Create the test case
     *
     * @param testName name of the test case
     */
    public AppTest( String testName )
    {
        super( testName );
                Properties config=new Properties();
        config.setProperty("memcached.servers","localhost:11211");
        config.setProperty("memcached.local_cache_capacity","100");
        keyValue=KeyValueCacheFactory.getKeyValueCache(
                "com.telefonica.momcollector.memcachedkeyvaluecache.MemCachedKeyValueCacheFactory",
                 config);

    }

    /**
     * @return the suite of tests being tested
     */
    public static Test suite()
    {
        return new TestSuite( AppTest.class );
    }
    public void testBasic() {
      
        keyValue.putValue("key1","value1");
        keyValue.putValue("key2","value2");
        keyValue.putValue("key3", "value3");
    }
    
    
    
    public void testFullCapacity() {
        
        for(int i=0;i<100;i++)
              keyValue.putValue("key"+i, "value"+i);
        assert(keyValue.getValue("key0")!=null);
        keyValue.putValue("key100","value100");
        assert(keyValue.getValue("key100").equals("value100"));
        assert(keyValue.getValue("key0")!=null);
        
    }
}
   

@@ -65,134 +65,25 @@
 ort 
-com.telefonica.tcloud.collectorinterfaces.KeyValueCache;%0Aimport com.telefonica.tcloud.collectorinterfaces.KeyValueCacheFactory
+java.util.HashMap
 ;%0Aim
@@ -292,40 +292,347 @@
 e%0A%7B%0A
-    %0A    KeyValueCache keyValue;
+%09%0A%09private class mockKeyValueCache %7B%09%0A%09%09private HashMap%3CString, String%3E kv=new HashMap%3CString, String%3E();%09%0A%09%09public mockKeyValueCache() %7B%7D%0A%09%09%0A%09%09public void putValue(String k, String v) %7B%0A%09%09%09kv.put(k,v);%0A%09%09%7D%0A%09%09public String getValue(String k) %7B%0A%09%09%09return kv.get(k);%0A%09%09%7D%0A%09%7D%0A%09%0A    %0A%09mockKeyValueCache keyValue;%0A    //KeyValueCache keyValue;%0A%09
 %0A   
@@ -981,32 +981,35 @@
 ,%22100%22);%0A       
+ /*
  keyValue=KeyVal
@@ -1166,16 +1166,62 @@
 config);
+*/%0A        keyValue = new mockKeyValueCache();
 %0A%0A    %7D%0A
@@ -1555,26 +1555,16 @@
  %7D%0A    %0A
-    %0A    %0A
     publ

Correct erroneous tests