// Path: ormlite-content-provider-library-test/src/com/tojc/ormlite/android/test/provider/AccountContract.java
// public final class AccountContract implements BaseColumns {
// 
//     private AccountContract() {
//         // utility constructor
//     }
// 
//     public static final String AUTHORITY = "com.tojc.ormlite.android.test";
// 
//     public static final String CONTENT_URI_PATH = "accounts";
// 
//     public static final String MIMETYPE_TYPE = "accounts";
//     public static final String MIMETYPE_NAME = "com.tojc.ormlite.android.test.provider";
// 
//     public static final Uri CONTENT_URI = new Uri.Builder().scheme(ContentResolver.SCHEME_CONTENT).authority(AUTHORITY).appendPath(CONTENT_URI_PATH).build();
// 
//     public static final String NAME = "name";
// }
// 
// Path: ormlite-content-provider-library-test/src/com/tojc/ormlite/android/test/provider/SampleHelper.java
// public class SampleHelper extends OrmLiteSqliteOpenHelper {
// 
//     /* package-private */static final Class<?>[] CLASS_LIST = new Class<?>[] {Account.class, Membership.class};
// 
//     public SampleHelper(Context context) {
//         super(context, "MyDatabase", null, 1);
//     }
// 
//     @Override
//     public void onCreate(SQLiteDatabase database, ConnectionSource connectionSource) {
//         try {
//             resetAllTables();
//         } catch (SQLException e) {
//             e.printStackTrace();
//         }
//     }
// 
//     @Override
//     public void onUpgrade(SQLiteDatabase database, ConnectionSource connectionSource, int oldVersion, int newVersion) {
//         try {
//             resetAllTables();
//         } catch (SQLException e) {
//             e.printStackTrace();
//         }
//     }
// 
//     public void resetAllTables() throws SQLException {
//         for (Class<?> clazz : CLASS_LIST) {
//             TableUtils.dropTable(connectionSource, clazz, true);
//             TableUtils.createTable(connectionSource, clazz);
//         }
//     }
// }
// 
// Path: ormlite-content-provider-library-test/src/com/tojc/ormlite/android/test/provider/UnderTestSampleProvider.java
// public class UnderTestSampleProvider extends OrmLiteSimpleContentProvider<SampleHelper> {
//     @Override
//     protected Class<SampleHelper> getHelperClass() {
//         return SampleHelper.class;
//     }
// 
//     @Override
//     public boolean onCreate() {
//         int patternCode = 1;
//         setMatcherController(new MatcherController()//
//                 .add(Account.class, SubType.DIRECTORY, "", patternCode++)//
//                 .add(Account.class, SubType.ITEM, "#", patternCode++)//
//                 .add(Membership.class, SubType.DIRECTORY, "", patternCode++)//
//                 .add(Membership.class, SubType.ITEM, "#", patternCode++));
//         return true;
//     }
// }


import android.provider.BaseColumns;
import android.test.InstrumentationTestCase;
import android.test.mock.MockContentResolver;
import android.test.suitebuilder.annotation.MediumTest;
import com.j256.ormlite.dao.RuntimeExceptionDao;
import com.tojc.ormlite.android.test.model.Account;
import com.tojc.ormlite.android.test.provider.AccountContract;
import com.tojc.ormlite.android.test.provider.SampleHelper;
import com.tojc.ormlite.android.test.provider.UnderTestSampleProvider;
import java.util.ArrayList;
import java.util.List;
import android.content.ContentProviderClient;
import android.content.ContentProviderOperation;
import android.content.ContentValues;
import android.content.OperationApplicationException;
import android.database.Cursor;
import android.os.RemoteException;
/*
 * This file is part of the Android-OrmLiteContentProvider package.
 *
 * Copyright (c) 2012, Android-OrmLiteContentProvider Team.
 *                     Jaken Jarvis (jaken.jarvis@gmail.com)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * The author may be contacted via
 * https://github.com/jakenjarvis/Android-OrmLiteContentProvider
 */
package com.tojc.ormlite.android;




@MediumTest
public class TestOrmLiteSimpleProvider extends InstrumentationTestCase {

    private static final String TEST_NAME_1 = "Yamada Tarou";
    private static final String TEST_NAME_2 = "Stephane Nicolas";

    private MockContentResolver resolver;

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        getHelper().resetAllTables();

        UnderTestSampleProvider provider = new UnderTestSampleProvider();
        provider.attachInfo(getInstrumentation().getContext(), null);

        this.resolver = new MockContentResolver();
// Path: ormlite-content-provider-library-test/src/com/tojc/ormlite/android/test/provider/AccountContract.java
// public final class AccountContract implements BaseColumns {
// 
//     private AccountContract() {
//         // utility constructor
//     }
// 
//     public static final String AUTHORITY = "com.tojc.ormlite.android.test";
// 
//     public static final String CONTENT_URI_PATH = "accounts";
// 
//     public static final String MIMETYPE_TYPE = "accounts";
//     public static final String MIMETYPE_NAME = "com.tojc.ormlite.android.test.provider";
// 
//     public static final Uri CONTENT_URI = new Uri.Builder().scheme(ContentResolver.SCHEME_CONTENT).authority(AUTHORITY).appendPath(CONTENT_URI_PATH).build();
// 
//     public static final String NAME = "name";
// }
// 
// Path: ormlite-content-provider-library-test/src/com/tojc/ormlite/android/test/provider/SampleHelper.java
// public class SampleHelper extends OrmLiteSqliteOpenHelper {
// 
//     /* package-private */static final Class<?>[] CLASS_LIST = new Class<?>[] {Account.class, Membership.class};
// 
//     public SampleHelper(Context context) {
//         super(context, "MyDatabase", null, 1);
//     }
// 
//     @Override
//     public void onCreate(SQLiteDatabase database, ConnectionSource connectionSource) {
//         try {
//             resetAllTables();
//         } catch (SQLException e) {
//             e.printStackTrace();
//         }
//     }
// 
//     @Override
//     public void onUpgrade(SQLiteDatabase database, ConnectionSource connectionSource, int oldVersion, int newVersion) {
//         try {
//             resetAllTables();
//         } catch (SQLException e) {
//             e.printStackTrace();
//         }
//     }
// 
//     public void resetAllTables() throws SQLException {
//         for (Class<?> clazz : CLASS_LIST) {
//             TableUtils.dropTable(connectionSource, clazz, true);
//             TableUtils.createTable(connectionSource, clazz);
//         }
//     }
// }
// 
// Path: ormlite-content-provider-library-test/src/com/tojc/ormlite/android/test/provider/UnderTestSampleProvider.java
// public class UnderTestSampleProvider extends OrmLiteSimpleContentProvider<SampleHelper> {
//     @Override
//     protected Class<SampleHelper> getHelperClass() {
//         return SampleHelper.class;
//     }
// 
//     @Override
//     public boolean onCreate() {
//         int patternCode = 1;
//         setMatcherController(new MatcherController()//
//                 .add(Account.class, SubType.DIRECTORY, "", patternCode++)//
//                 .add(Account.class, SubType.ITEM, "#", patternCode++)//
//                 .add(Membership.class, SubType.DIRECTORY, "", patternCode++)//
//                 .add(Membership.class, SubType.ITEM, "#", patternCode++));
//         return true;
//     }
// }


// Path: ormlite-content-provider-library-test/src/com/tojc/ormlite/android/TestOrmLiteSimpleProvider.java
import android.provider.BaseColumns;
import android.test.InstrumentationTestCase;
import android.test.mock.MockContentResolver;
import android.test.suitebuilder.annotation.MediumTest;
import com.j256.ormlite.dao.RuntimeExceptionDao;
import com.tojc.ormlite.android.test.model.Account;
import com.tojc.ormlite.android.test.provider.AccountContract;
import com.tojc.ormlite.android.test.provider.SampleHelper;
import com.tojc.ormlite.android.test.provider.UnderTestSampleProvider;
import java.util.ArrayList;
import java.util.List;
import android.content.ContentProviderClient;
import android.content.ContentProviderOperation;
import android.content.ContentValues;
import android.content.OperationApplicationException;
import android.database.Cursor;
import android.os.RemoteException;

/*
 * This file is part of the Android-OrmLiteContentProvider package.
 *
 * Copyright (c) 2012, Android-OrmLiteContentProvider Team.
 *                     Jaken Jarvis (jaken.jarvis@gmail.com)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * The author may be contacted via
 * https://github.com/jakenjarvis/Android-OrmLiteContentProvider
 */
package com.tojc.ormlite.android;




@MediumTest
public class TestOrmLiteSimpleProvider extends InstrumentationTestCase {

    private static final String TEST_NAME_1 = "Yamada Tarou";
    private static final String TEST_NAME_2 = "Stephane Nicolas";

    private MockContentResolver resolver;

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        getHelper().resetAllTables();

        UnderTestSampleProvider provider = new UnderTestSampleProvider();
        provider.attachInfo(getInstrumentation().getContext(), null);

        this.resolver = new MockContentResolver();
        this.resolver.addProvider(AccountContract.AUTHORITY, provider);