// Path: test/src/android/app/MockAlertDialog.java
// public class MockAlertDialog extends AlertDialog {
//     public MockAlertDialog(Context context) {
//         super(context, AlertDialog.THEME_TRADITIONAL);
//     }
// 
//     @Override
//     public void show() {
//         // Nothing
//     }
// }
// 
// Path: sdk/src/com/sharethis/loopy/sdk/util/AppDataCache.java
// public class AppDataCache {
// 
//     private final Map<String, Drawable> iconCache = new HashMap<String, Drawable>();
//     private final Map<String, String> labelCache = new HashMap<String, String>();
// 
//     static AppDataCache instance = new AppDataCache();
// 
//     AppDataCache() {}
// 
//     public static AppDataCache getInstance() {
//         return instance;
//     }
// 
//     public void onCreate(final Context context) {
//         new AsyncTask<Void, Void, Void>() {
//             @Override
//             protected Void doInBackground(Void... params) {
//                 Collection<ResolveInfo> appsForContentType = getAppUtils().getAppsForContentType(context, "*/*");
//                 for (ResolveInfo resolveInfo : appsForContentType) {
//                     getAppIcon(context, resolveInfo);
//                     getAppLabel(context, resolveInfo);
//                 }
//                 return null;
//             }
//         }.execute();
//     }
// 
//     public void onDestroy(Context context) {
//         iconCache.clear();
//         labelCache.clear();
//     }
// 
//     public synchronized Drawable getAppIcon(Context context, ResolveInfo item) {
//         String key = getKey(item);
//         Drawable icon = iconCache.get(key);
//         if(icon == null) {
//             icon = item.activityInfo.loadIcon(context.getPackageManager());
//             iconCache.put(key, icon);
//         }
//         return icon;
//     }
// 
//     /**
//      * May return null!
//      * @param packageName The package name.
//      * @param className The activity class name
//      * @return The app (activity) label, or null
//      */
//     public String getAppLabel(String packageName, String className) {
//         return labelCache.get(packageName + "." + className);
//     }
// 
//     public synchronized String getAppLabel(Context context, ResolveInfo item) {
//         String key = getKey(item);
//         String label = labelCache.get(key);
//         if(label == null) {
//             label = item.activityInfo.loadLabel(context.getPackageManager()).toString();
//             labelCache.put(key, label);
//         }
//         return label;
//     }
// 
//     String getKey(ResolveInfo item) {
//         return item.activityInfo.packageName + "." + item.activityInfo.name;
//     }
// 
//     // mockable
//     AppUtils getAppUtils() {
//         return AppUtils.getInstance();
//     }
// 
// }


import android.view.View;
import com.sharethis.loopy.sdk.*;
import com.sharethis.loopy.sdk.util.AppDataCache;
import org.mockito.Mockito;
import java.util.Arrays;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import android.app.AlertDialog;
import android.app.MockAlertDialog;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ResolveInfo;
import android.graphics.drawable.Drawable;
/*
 *
 *  * Copyright (c) 2013 ShareThis Inc.
 *  *
 *  * Permission is hereby granted, free of charge, to any person obtaining a copy
 *  * of this software and associated documentation files (the "Software"), to deal
 *  * in the Software without restriction, including without limitation the rights
 *  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 *  * copies of the Software, and to permit persons to whom the Software is
 *  * furnished to do so, subject to the following conditions:
 *  *
 *  * The above copyright notice and this permission notice shall be included in
 *  * all copies or substantial portions of the Software.
 *  *
 *  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 *  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 *  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 *  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 *  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 *  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 *  * THE SOFTWARE.
 *
 */

package com.sharethis.loopy.test;



/**
 * @author Jason Polites
 */
public class ShareDialogAdapterTest extends LoopyActivityTestCase {

    public void testGetView() throws Throwable {

        final Context context = getContext();
        final MockShareClickListener shareDialogListener = Mockito.mock(MockShareClickListener.class);
// Path: test/src/android/app/MockAlertDialog.java
// public class MockAlertDialog extends AlertDialog {
//     public MockAlertDialog(Context context) {
//         super(context, AlertDialog.THEME_TRADITIONAL);
//     }
// 
//     @Override
//     public void show() {
//         // Nothing
//     }
// }
// 
// Path: sdk/src/com/sharethis/loopy/sdk/util/AppDataCache.java
// public class AppDataCache {
// 
//     private final Map<String, Drawable> iconCache = new HashMap<String, Drawable>();
//     private final Map<String, String> labelCache = new HashMap<String, String>();
// 
//     static AppDataCache instance = new AppDataCache();
// 
//     AppDataCache() {}
// 
//     public static AppDataCache getInstance() {
//         return instance;
//     }
// 
//     public void onCreate(final Context context) {
//         new AsyncTask<Void, Void, Void>() {
//             @Override
//             protected Void doInBackground(Void... params) {
//                 Collection<ResolveInfo> appsForContentType = getAppUtils().getAppsForContentType(context, "*/*");
//                 for (ResolveInfo resolveInfo : appsForContentType) {
//                     getAppIcon(context, resolveInfo);
//                     getAppLabel(context, resolveInfo);
//                 }
//                 return null;
//             }
//         }.execute();
//     }
// 
//     public void onDestroy(Context context) {
//         iconCache.clear();
//         labelCache.clear();
//     }
// 
//     public synchronized Drawable getAppIcon(Context context, ResolveInfo item) {
//         String key = getKey(item);
//         Drawable icon = iconCache.get(key);
//         if(icon == null) {
//             icon = item.activityInfo.loadIcon(context.getPackageManager());
//             iconCache.put(key, icon);
//         }
//         return icon;
//     }
// 
//     /**
//      * May return null!
//      * @param packageName The package name.
//      * @param className The activity class name
//      * @return The app (activity) label, or null
//      */
//     public String getAppLabel(String packageName, String className) {
//         return labelCache.get(packageName + "." + className);
//     }
// 
//     public synchronized String getAppLabel(Context context, ResolveInfo item) {
//         String key = getKey(item);
//         String label = labelCache.get(key);
//         if(label == null) {
//             label = item.activityInfo.loadLabel(context.getPackageManager()).toString();
//             labelCache.put(key, label);
//         }
//         return label;
//     }
// 
//     String getKey(ResolveInfo item) {
//         return item.activityInfo.packageName + "." + item.activityInfo.name;
//     }
// 
//     // mockable
//     AppUtils getAppUtils() {
//         return AppUtils.getInstance();
//     }
// 
// }


// Path: test/src/com/sharethis/loopy/test/ShareDialogAdapterTest.java
import android.view.View;
import com.sharethis.loopy.sdk.*;
import com.sharethis.loopy.sdk.util.AppDataCache;
import org.mockito.Mockito;
import java.util.Arrays;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import android.app.AlertDialog;
import android.app.MockAlertDialog;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ResolveInfo;
import android.graphics.drawable.Drawable;

/*
 *
 *  * Copyright (c) 2013 ShareThis Inc.
 *  *
 *  * Permission is hereby granted, free of charge, to any person obtaining a copy
 *  * of this software and associated documentation files (the "Software"), to deal
 *  * in the Software without restriction, including without limitation the rights
 *  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 *  * copies of the Software, and to permit persons to whom the Software is
 *  * furnished to do so, subject to the following conditions:
 *  *
 *  * The above copyright notice and this permission notice shall be included in
 *  * all copies or substantial portions of the Software.
 *  *
 *  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 *  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 *  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 *  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 *  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 *  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 *  * THE SOFTWARE.
 *
 */

package com.sharethis.loopy.test;



/**
 * @author Jason Polites
 */
public class ShareDialogAdapterTest extends LoopyActivityTestCase {

    public void testGetView() throws Throwable {

        final Context context = getContext();
        final MockShareClickListener shareDialogListener = Mockito.mock(MockShareClickListener.class);
        final AlertDialog dlg = Mockito.spy(new MockAlertDialog( context ));