// Path: test/src/com/orm/androrm/impl/BlankModel.java
// public class BlankModel extends Model {
// 
// 	public static final QuerySet<BlankModel> objects(Context context) {
// 		return objects(context, BlankModel.class);
// 	}
// 	
// 	protected CharField mName;
// 	protected LocationField mLocation;
// 	protected DateField mDate;
// 	
// 	public BlankModel() {
// 		super();
// 		
// 		mName = new CharField();
// 		mLocation = new LocationField();
// 		mDate = new DateField();
// 	}
// 	
// 	public void setName(String name) {
// 		mName.set(name);
// 	}
// 	
// 	public String getName() {
// 		return mName.get();
// 	}
// 	
// 	public void setLocation(Location l) {
// 		mLocation.set(l);
// 	}
// 	
// 	public Location getLocation() {
// 		return mLocation.get();
// 	}
// 	
// 	public Date getDate() {
// 		return mDate.get();
// 	}
// 	
// 	public void setDate(Date date) {
// 		mDate.set(date);
// 	}
// }


import java.util.ArrayList;
import java.util.List;
import com.orm.androrm.DatabaseAdapter;
import com.orm.androrm.Model;
import com.orm.androrm.impl.BlankModel;
import android.test.AndroidTestCase;
package com.orm.androrm.test.database;




public class TransactionTest extends AndroidTestCase {

	@Override
	public void setUp() {
		List<Class<? extends Model>> models = new ArrayList<Class<? extends Model>>();
		models.add(BlankModel.class);

		DatabaseAdapter adapter = DatabaseAdapter.getInstance(getContext());
		adapter.setModels(models);
	}
	
	public void testRollback() {
		assertEquals(0, BlankModel.objects(getContext()).count());
		
		DatabaseAdapter adapter = DatabaseAdapter.getInstance(getContext());
		adapter.beginTransaction();
		
		BlankModel b1 = new BlankModel();
		b1.save(getContext());
		
		BlankModel b2 = new BlankModel();
		b2.save(getContext());
		
		adapter.rollbackTransaction();
		
		assertEquals(0, BlankModel.objects(getContext()).count());
	}
	
	public void testCommit() {
		assertEquals(0, BlankModel.objects(getContext()).count());
		
		DatabaseAdapter adapter = DatabaseAdapter.getInstance(getContext());
		adapter.beginTransaction();
		
// Path: test/src/com/orm/androrm/impl/BlankModel.java
// public class BlankModel extends Model {
// 
// 	public static final QuerySet<BlankModel> objects(Context context) {
// 		return objects(context, BlankModel.class);
// 	}
// 	
// 	protected CharField mName;
// 	protected LocationField mLocation;
// 	protected DateField mDate;
// 	
// 	public BlankModel() {
// 		super();
// 		
// 		mName = new CharField();
// 		mLocation = new LocationField();
// 		mDate = new DateField();
// 	}
// 	
// 	public void setName(String name) {
// 		mName.set(name);
// 	}
// 	
// 	public String getName() {
// 		return mName.get();
// 	}
// 	
// 	public void setLocation(Location l) {
// 		mLocation.set(l);
// 	}
// 	
// 	public Location getLocation() {
// 		return mLocation.get();
// 	}
// 	
// 	public Date getDate() {
// 		return mDate.get();
// 	}
// 	
// 	public void setDate(Date date) {
// 		mDate.set(date);
// 	}
// }


// Path: test/src/com/orm/androrm/test/database/TransactionTest.java
import java.util.ArrayList;
import java.util.List;
import com.orm.androrm.DatabaseAdapter;
import com.orm.androrm.Model;
import com.orm.androrm.impl.BlankModel;
import android.test.AndroidTestCase;

package com.orm.androrm.test.database;




public class TransactionTest extends AndroidTestCase {

	@Override
	public void setUp() {
		List<Class<? extends Model>> models = new ArrayList<Class<? extends Model>>();
		models.add(BlankModel.class);

		DatabaseAdapter adapter = DatabaseAdapter.getInstance(getContext());
		adapter.setModels(models);
	}
	
	public void testRollback() {
		assertEquals(0, BlankModel.objects(getContext()).count());
		
		DatabaseAdapter adapter = DatabaseAdapter.getInstance(getContext());
		adapter.beginTransaction();
		
		BlankModel b1 = new BlankModel();
		b1.save(getContext());
		
		BlankModel b2 = new BlankModel();
		b2.save(getContext());
		
		adapter.rollbackTransaction();
		
		assertEquals(0, BlankModel.objects(getContext()).count());
	}
	
	public void testCommit() {
		assertEquals(0, BlankModel.objects(getContext()).count());
		
		DatabaseAdapter adapter = DatabaseAdapter.getInstance(getContext());
		adapter.beginTransaction();
		
		BlankModel b1 = new BlankModel();