// Path: test/src/com/sharethis/loopy/sdk/MockConfig.java
// public class MockConfig extends Config {
// 
//     @Override
//     public Properties newProperties() {
//         return super.newProperties();
//     }
// 
//     @Override
//     public String clean(String url) {
//         return super.clean(url);
//     }
// 
//     @Override
//     public ResourceLocator newResourceLocator() {
//         return super.newResourceLocator();
//     }
// 
//     @Override
//     public boolean getBooleanProperty(Properties props, String key, boolean defaultValue) {
//         return super.getBooleanProperty(props, key, defaultValue);
//     }
// 
//     @Override
//     public int getIntProperty(Properties props, String key, int defaultValue) {
//         return super.getIntProperty(props, key, defaultValue);
//     }
// 
//     @Override
//     public String getUrlProperty(Properties props, String key) {
//         return super.getUrlProperty(props, key);
//     }
// }
// 
// Path: sdk/src/com/sharethis/loopy/sdk/util/ResourceLocator.java
// public class ResourceLocator {
//     private ClassLoaderProvider classLoaderProvider = new ClassLoaderProvider();
// 
//     public InputStream locateInAssets(Context context, String name) throws IOException {
//         InputStream in = null;
// 
//         try {
//             if(Logger.isDebugEnabled()) {
//                 Logger.d("Looking for " +
//                         name +
//                         " in asset path...");
//             }
// 
//             in = context.getAssets().open(name);
// 
//             if(Logger.isDebugEnabled()) {
//                 Logger.d("Found " +
//                         name +
//                         " in asset path");
//             }
//         }
//         catch (IOException ignore) {
//             // Ignore this, just means no override.
//             if(Logger.isDebugEnabled()) {
//                 Logger.d("No file found in assets with name [" +
//                         name +
//                         "].");
//             }
//         }
// 
//         return in;
//     }
// 
//     public InputStream locateInClassPath(String name) throws IOException {
// 
//         InputStream in = null;
// 
//         if(classLoaderProvider != null) {
// 
//             if(Logger.isDebugEnabled()) {
//                 Logger.d("Looking for " +
//                         name +
//                         " in classpath...");
//             }
// 
//             in = classLoaderProvider.getClassLoader().getResourceAsStream(name);
// 
//             if(in != null) {
//                 if(Logger.isDebugEnabled()) {
//                     Logger.d("Found " +
//                             name +
//                             " in classpath");
//                 }
//             }
//         }
// 
//         return in;
//     }
// 
//     public InputStream locate(Context context, String name) throws IOException {
// 
//         InputStream in = locateInAssets(context, name);
// 
//         if(in == null) {
//             in = locateInClassPath(name);
//         }
// 
//         if(in == null) {
//             Logger.w("Could not locate [" +
//                     name +
//                     "] in any location");
//         }
// 
//         return in;
//     }
// 
//     public ClassLoaderProvider getClassLoaderProvider() {
//         return classLoaderProvider;
//     }
// 
//     public void setClassLoaderProvider(ClassLoaderProvider classLoaderProvider) {
//         this.classLoaderProvider = classLoaderProvider;
//     }
// }


import java.io.InputStream;
import java.util.Properties;
import android.content.Context;
import com.sharethis.loopy.sdk.MockConfig;
import com.sharethis.loopy.sdk.util.ResourceLocator;
import org.mockito.Mockito;
import java.io.IOException;
/*
 *
 *  * 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 ConfigTest extends LoopyActivityTestCase {

    public void testConfigLoadWithOverride() throws IOException {

        final Context context = getContext();
        final String apiUrl = "foobar_url/";
        final String secureApiUrl =  "foobar_secure_url/";
        final String apiTimeout = "69";
        final String sessionTimeout = "96";
        final String debug = "true";


// Path: test/src/com/sharethis/loopy/sdk/MockConfig.java
// public class MockConfig extends Config {
// 
//     @Override
//     public Properties newProperties() {
//         return super.newProperties();
//     }
// 
//     @Override
//     public String clean(String url) {
//         return super.clean(url);
//     }
// 
//     @Override
//     public ResourceLocator newResourceLocator() {
//         return super.newResourceLocator();
//     }
// 
//     @Override
//     public boolean getBooleanProperty(Properties props, String key, boolean defaultValue) {
//         return super.getBooleanProperty(props, key, defaultValue);
//     }
// 
//     @Override
//     public int getIntProperty(Properties props, String key, int defaultValue) {
//         return super.getIntProperty(props, key, defaultValue);
//     }
// 
//     @Override
//     public String getUrlProperty(Properties props, String key) {
//         return super.getUrlProperty(props, key);
//     }
// }
// 
// Path: sdk/src/com/sharethis/loopy/sdk/util/ResourceLocator.java
// public class ResourceLocator {
//     private ClassLoaderProvider classLoaderProvider = new ClassLoaderProvider();
// 
//     public InputStream locateInAssets(Context context, String name) throws IOException {
//         InputStream in = null;
// 
//         try {
//             if(Logger.isDebugEnabled()) {
//                 Logger.d("Looking for " +
//                         name +
//                         " in asset path...");
//             }
// 
//             in = context.getAssets().open(name);
// 
//             if(Logger.isDebugEnabled()) {
//                 Logger.d("Found " +
//                         name +
//                         " in asset path");
//             }
//         }
//         catch (IOException ignore) {
//             // Ignore this, just means no override.
//             if(Logger.isDebugEnabled()) {
//                 Logger.d("No file found in assets with name [" +
//                         name +
//                         "].");
//             }
//         }
// 
//         return in;
//     }
// 
//     public InputStream locateInClassPath(String name) throws IOException {
// 
//         InputStream in = null;
// 
//         if(classLoaderProvider != null) {
// 
//             if(Logger.isDebugEnabled()) {
//                 Logger.d("Looking for " +
//                         name +
//                         " in classpath...");
//             }
// 
//             in = classLoaderProvider.getClassLoader().getResourceAsStream(name);
// 
//             if(in != null) {
//                 if(Logger.isDebugEnabled()) {
//                     Logger.d("Found " +
//                             name +
//                             " in classpath");
//                 }
//             }
//         }
// 
//         return in;
//     }
// 
//     public InputStream locate(Context context, String name) throws IOException {
// 
//         InputStream in = locateInAssets(context, name);
// 
//         if(in == null) {
//             in = locateInClassPath(name);
//         }
// 
//         if(in == null) {
//             Logger.w("Could not locate [" +
//                     name +
//                     "] in any location");
//         }
// 
//         return in;
//     }
// 
//     public ClassLoaderProvider getClassLoaderProvider() {
//         return classLoaderProvider;
//     }
// 
//     public void setClassLoaderProvider(ClassLoaderProvider classLoaderProvider) {
//         this.classLoaderProvider = classLoaderProvider;
//     }
// }


// Path: test/src/com/sharethis/loopy/test/ConfigTest.java
import java.io.InputStream;
import java.util.Properties;
import android.content.Context;
import com.sharethis.loopy.sdk.MockConfig;
import com.sharethis.loopy.sdk.util.ResourceLocator;
import org.mockito.Mockito;
import java.io.IOException;

/*
 *
 *  * 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 ConfigTest extends LoopyActivityTestCase {

    public void testConfigLoadWithOverride() throws IOException {

        final Context context = getContext();
        final String apiUrl = "foobar_url/";
        final String secureApiUrl =  "foobar_secure_url/";
        final String apiTimeout = "69";
        final String sessionTimeout = "96";
        final String debug = "true";


        final ResourceLocator resourceLocator = Mockito.mock(ResourceLocator.class);