All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.lordofthejars.nosqlunit.infinispan.DefaultInfinispanComparisonStrategy Maven / Gradle / Ivy

There is a newer version: 1.0.0
Show newest version
package com.lordofthejars.nosqlunit.infinispan;

import java.io.InputStream;
import java.util.Map;

import com.lordofthejars.nosqlunit.core.NoSqlAssertionError;
import com.lordofthejars.nosqlunit.objects.KeyValueObjectMapper;

public class DefaultInfinispanComparisonStrategy implements InfinispanComparisonStrategy {

	@Override
	public boolean compare(InfinispanConnectionCallback connection, InputStream dataset) throws NoSqlAssertionError, Throwable {
		Map expectedMap = loadMap(dataset);
		InfinispanAssertion.strictAssertEquals(connection.basicCache(), expectedMap);
		
		return true;
	}

	private Map loadMap(InputStream dataScript) {
		KeyValueObjectMapper keyValueObjectMapper = new KeyValueObjectMapper();
		Map values = keyValueObjectMapper.readValues(dataScript);
		return values;
	}

    @Override
    public void setIgnoreProperties(String[] ignoreProperties) {
    }
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy