// Path: src/main/java/in/cubestack/android/lib/storm/SortOrder.java
// public enum SortOrder {
//     ASC,
//     DESC
// }
// 
// Path: src/main/java/in/cubestack/android/lib/storm/core/EntityMetaDataCache.java
// public class EntityMetaDataCache {
//     private static final Map<String, TableInformation> cache = new HashMap<String, TableInformation>();
//     
//     private static AliasGenerator aliasGenerator = new AliasGenerator();
// 
//     public static void cacheInformation(Class<?> entityClass, TableInformation metaData) {
//         cache.put(entityClass.getName(), metaData);
//     }
// 
//     public static TableInformation getMetaData(Class<?> entityClass) throws IllegalArgumentException, IllegalAccessException, InstantiationException, StormException {
//         TableInformation tableInformation = cache.get(entityClass.getName());
//         if (tableInformation == null) {
//             synchronized (EntityMetaDataCache.class) {
//                 if (cache.get(entityClass.getName()) == null) {
//                     tableInformation = new MetaDataReader().readAnnotations(entityClass, aliasGenerator);
//                     cacheInformation(entityClass, tableInformation);
//                 }
//             }
//         }
//         return tableInformation;
//     }
// }
// 
// Path: src/main/java/in/cubestack/android/lib/storm/core/StormException.java
// public class StormException extends Exception {
// 
// 	private static final long serialVersionUID = -563476450614494464L;
// 
// 	public StormException(Throwable throwable) {
// 		super(throwable);
// 	}
// 	
// 	public StormException(String msg) {
// 		super(msg);
// 	}
// 
// 	public StormException(String msg, Exception exception) {
// 		super(msg, exception);
// 	}
// 	
// 	
// }
// 
// Path: src/main/java/in/cubestack/android/lib/storm/core/StormRuntimeException.java
// public class StormRuntimeException extends RuntimeException {
// 
// 	private static final long serialVersionUID = -563476450614494464L;
// 
// 	
// 	public StormRuntimeException(String msg) {
// 		super(msg);
// 	}
// 
// 
// 	public StormRuntimeException(String msg, Exception ex) {
// 		super(msg, ex);
// 	}
// 	
// 	
// }
// 
// Path: src/test/java/in/cubestack/apps/android/storm/entitites/RestrictionTestEntity.java
// @Table(name = "TEST_TAB")
// public class RestrictionTestEntity {
// 
// 	@PrimaryKey
// 	@Column(name = "ID", type = FieldType.INTEGER)
// 	private int id;
// 
// 	@Column(name = "NAME", type = FieldType.TEXT)
// 	private String name;
// 
// 	@Column(name = "HOURS", type = FieldType.TEXT)
// 	private int hours;
// 	
// 	@Column(name = "RATE", type = FieldType.REAL)
// 	private float rate;
// 	
// 	@Column(name = "COST", type = FieldType.REAL)
// 	private double cost;
// 	
// }


import java.util.Arrays;
import org.junit.Assert;
import org.junit.Test;
import in.cubestack.android.lib.storm.SortOrder;
import in.cubestack.android.lib.storm.core.EntityMetaDataCache;
import in.cubestack.android.lib.storm.core.StormException;
import in.cubestack.android.lib.storm.core.StormRuntimeException;
import in.cubestack.apps.android.storm.entitites.RestrictionTestEntity;

		restrictions = StormRestrictions.restrictionsFor(RestrictionTestEntity.class);
		
		Assert.assertNotNull(restrictions);
		
		Restriction res = restrictions.equals("name", "Supal Dubey");
		Assert.assertEquals(res.toSqlString(), EntityMetaDataCache.getMetaData(RestrictionTestEntity.class).getAlias() + ".NAME =  ? ");
		
		Assert.assertEquals(res.values().length, 1);
		Assert.assertArrayEquals(res.values(), new String[] {"Supal Dubey"});
	}
	
	@Test
	public void testComposite() throws IllegalArgumentException, IllegalAccessException, InstantiationException, StormException {
		restrictions = StormRestrictions.restrictionsFor(RestrictionTestEntity.class);
		
		Assert.assertNotNull(restrictions);
		
		Restriction resName1 = restrictions.equals("name", "Supal Dubey");
		Restriction resName2 = restrictions.equals("name", "Supal");
		
		Restriction composite = restrictions.or(resName1, resName2);
		
		Assert.assertEquals(composite.toSqlString(), "(" +EntityMetaDataCache.getMetaData(RestrictionTestEntity.class).getAlias()  +".NAME =  ?  OR " + EntityMetaDataCache.getMetaData(RestrictionTestEntity.class).getAlias() +".NAME =  ? )");
		
		Assert.assertEquals(composite.values().length, 2);
		Assert.assertArrayEquals(composite.values(), new String[] {"Supal Dubey", "Supal"});
	}

	
	@Test

// Path: src/main/java/in/cubestack/android/lib/storm/SortOrder.java
// public enum SortOrder {
//     ASC,
//     DESC
// }
// 
// Path: src/main/java/in/cubestack/android/lib/storm/core/EntityMetaDataCache.java
// public class EntityMetaDataCache {
//     private static final Map<String, TableInformation> cache = new HashMap<String, TableInformation>();
//     
//     private static AliasGenerator aliasGenerator = new AliasGenerator();
// 
//     public static void cacheInformation(Class<?> entityClass, TableInformation metaData) {
//         cache.put(entityClass.getName(), metaData);
//     }
// 
//     public static TableInformation getMetaData(Class<?> entityClass) throws IllegalArgumentException, IllegalAccessException, InstantiationException, StormException {
//         TableInformation tableInformation = cache.get(entityClass.getName());
//         if (tableInformation == null) {
//             synchronized (EntityMetaDataCache.class) {
//                 if (cache.get(entityClass.getName()) == null) {
//                     tableInformation = new MetaDataReader().readAnnotations(entityClass, aliasGenerator);
//                     cacheInformation(entityClass, tableInformation);
//                 }
//             }
//         }
//         return tableInformation;
//     }
// }
// 
// Path: src/main/java/in/cubestack/android/lib/storm/core/StormException.java
// public class StormException extends Exception {
// 
// 	private static final long serialVersionUID = -563476450614494464L;
// 
// 	public StormException(Throwable throwable) {
// 		super(throwable);
// 	}
// 	
// 	public StormException(String msg) {
// 		super(msg);
// 	}
// 
// 	public StormException(String msg, Exception exception) {
// 		super(msg, exception);
// 	}
// 	
// 	
// }
// 
// Path: src/main/java/in/cubestack/android/lib/storm/core/StormRuntimeException.java
// public class StormRuntimeException extends RuntimeException {
// 
// 	private static final long serialVersionUID = -563476450614494464L;
// 
// 	
// 	public StormRuntimeException(String msg) {
// 		super(msg);
// 	}
// 
// 
// 	public StormRuntimeException(String msg, Exception ex) {
// 		super(msg, ex);
// 	}
// 	
// 	
// }
// 
// Path: src/test/java/in/cubestack/apps/android/storm/entitites/RestrictionTestEntity.java
// @Table(name = "TEST_TAB")
// public class RestrictionTestEntity {
// 
// 	@PrimaryKey
// 	@Column(name = "ID", type = FieldType.INTEGER)
// 	private int id;
// 
// 	@Column(name = "NAME", type = FieldType.TEXT)
// 	private String name;
// 
// 	@Column(name = "HOURS", type = FieldType.TEXT)
// 	private int hours;
// 	
// 	@Column(name = "RATE", type = FieldType.REAL)
// 	private float rate;
// 	
// 	@Column(name = "COST", type = FieldType.REAL)
// 	private double cost;
// 	
// }


// Path: src/test/java/in/cubestack/android/lib/storm/criteria/StormRestrictionTest.java
import java.util.Arrays;
import org.junit.Assert;
import org.junit.Test;
import in.cubestack.android.lib.storm.SortOrder;
import in.cubestack.android.lib.storm.core.EntityMetaDataCache;
import in.cubestack.android.lib.storm.core.StormException;
import in.cubestack.android.lib.storm.core.StormRuntimeException;
import in.cubestack.apps.android.storm.entitites.RestrictionTestEntity;

		restrictions = StormRestrictions.restrictionsFor(RestrictionTestEntity.class);
		
		Assert.assertNotNull(restrictions);
		
		Restriction res = restrictions.equals("name", "Supal Dubey");
		Assert.assertEquals(res.toSqlString(), EntityMetaDataCache.getMetaData(RestrictionTestEntity.class).getAlias() + ".NAME =  ? ");
		
		Assert.assertEquals(res.values().length, 1);
		Assert.assertArrayEquals(res.values(), new String[] {"Supal Dubey"});
	}
	
	@Test
	public void testComposite() throws IllegalArgumentException, IllegalAccessException, InstantiationException, StormException {
		restrictions = StormRestrictions.restrictionsFor(RestrictionTestEntity.class);
		
		Assert.assertNotNull(restrictions);
		
		Restriction resName1 = restrictions.equals("name", "Supal Dubey");
		Restriction resName2 = restrictions.equals("name", "Supal");
		
		Restriction composite = restrictions.or(resName1, resName2);
		
		Assert.assertEquals(composite.toSqlString(), "(" +EntityMetaDataCache.getMetaData(RestrictionTestEntity.class).getAlias()  +".NAME =  ?  OR " + EntityMetaDataCache.getMetaData(RestrictionTestEntity.class).getAlias() +".NAME =  ? )");
		
		Assert.assertEquals(composite.values().length, 2);
		Assert.assertArrayEquals(composite.values(), new String[] {"Supal Dubey", "Supal"});
	}

	
	@Test

	public void testIn() throws IllegalArgumentException, IllegalAccessException, InstantiationException, StormException {
