Skip to content

Commit

Permalink
Merge pull request #50 from shifujun/test_multidex
Browse files Browse the repository at this point in the history
补充multidex的自动化测试用例
  • Loading branch information
shifujun committed Jul 17, 2019
2 parents 19ea2d8 + 643dfef commit 673ab95
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.tencent.shadow.test.cases.plugin_multidex;

import org.junit.runner.RunWith;
import org.junit.runners.Suite;

@RunWith(Suite.class)
@Suite.SuiteClasses({MultiDexV102Test.class, MultiDexV201Test.class})
public class MultiDexTest {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.tencent.shadow.test.cases.plugin_multidex;

import com.tencent.shadow.test.lib.constant.Constant;

public class MultiDexV102Test extends PluginMultiDexAppTest {
@Override
protected String getPartKey() {
return Constant.PART_KEY_MULTIDEX_V1_0_2;
}

@Override
protected String getActivityName() {
return "com.tencent.shadow.test.plugin.particular_cases.multidex.v1_0_2.PluginMultidexV1_0_2Activity";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.tencent.shadow.test.cases.plugin_multidex;

import com.tencent.shadow.test.lib.constant.Constant;

public class MultiDexV201Test extends PluginMultiDexAppTest {
@Override
protected String getPartKey() {
return Constant.PART_KEY_MULTIDEX_V2_0_1;
}

@Override
protected String getActivityName() {
return "com.tencent.shadow.test.plugin.particular_cases.multidex.v2_0_1.PluginMultidexV2_0_1Activity";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Tencent is pleased to support the open source community by making Tencent Shadow available.
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
*
* Licensed under the BSD 3-Clause License (the "License"); you may not use
* this file except in compliance with the License. You may obtain a copy of
* the License at
*
* https://opensource.org/licenses/BSD-3-Clause
*
* 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.
*
*/

package com.tencent.shadow.test.cases.plugin_multidex;

import android.content.Intent;

import androidx.test.core.app.ApplicationProvider;

import com.tencent.shadow.test.PluginTest;

import org.junit.Test;

public abstract class PluginMultiDexAppTest extends PluginTest {

abstract protected String getActivityName();

@Override
protected Intent getLaunchIntent() {
Intent pluginIntent = new Intent();
String packageName = ApplicationProvider.getApplicationContext().getPackageName();
pluginIntent.setClassName(
packageName,
getActivityName()
);
return pluginIntent;
}

@Test
public void testSuccessLaunch() {
//assert no crash
}
}

0 comments on commit 673ab95

Please sign in to comment.