mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-31 17:32:51 +08:00
Fix tests of plugin files with new app dir scheme
(new app target-dir scheme)
This commit is contained in:
parent
576ad183e7
commit
9d03e4ec0a
@ -103,20 +103,20 @@ describe('android project handler', function () {
|
|||||||
}).toThrow(new Error('"' + target + '" already exists!'));
|
}).toThrow(new Error('"' + target + '" already exists!'));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Test#007 : should allow installing sources using proper path', function () {
|
// TODO: renumber these tests and other tests below
|
||||||
|
it('Test#00a6 : should allow installing sources with new app target-dir scheme', function () {
|
||||||
android['source-file'].install(valid_source[1], dummyPluginInfo, dummyProject, {android_studio: true});
|
android['source-file'].install(valid_source[1], dummyPluginInfo, dummyProject, {android_studio: true});
|
||||||
expect(copyFileSpy)
|
expect(copyFileSpy)
|
||||||
.toHaveBeenCalledWith(dummyplugin, 'src/android/DummyPlugin2.java', temp, path.join('app/src/main/src/com/phonegap/plugins/dummyplugin/DummyPlugin2.java'), false);
|
.toHaveBeenCalledWith(dummyplugin, 'src/android/DummyPlugin2.java', temp, path.join('app/src/main/src/com/phonegap/plugins/dummyplugin/DummyPlugin2.java'), false);
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO: renumber these tests and other tests below
|
it('Test#006b : should allow installing jar lib file from sources with new app target-dir scheme', function () {
|
||||||
it('Test#007a : should allow installing lib file from sources using proper path', function () {
|
|
||||||
android['source-file'].install(valid_source[2], dummyPluginInfo, dummyProject, {android_studio: true});
|
android['source-file'].install(valid_source[2], dummyPluginInfo, dummyProject, {android_studio: true});
|
||||||
expect(copyFileSpy)
|
expect(copyFileSpy)
|
||||||
.toHaveBeenCalledWith(dummyplugin, 'src/android/TestLib.jar', temp, path.join('app/libs/TestLib.jar'), false);
|
.toHaveBeenCalledWith(dummyplugin, 'src/android/TestLib.jar', temp, path.join('app/libs/TestLib.jar'), false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Test#007b : should allow installing aar file from sources using proper path', function () {
|
it('Test#006c : should allow installing aar lib file from sources with new app target-dir scheme', function () {
|
||||||
android['source-file'].install(valid_source[3], dummyPluginInfo, dummyProject, {android_studio: true});
|
android['source-file'].install(valid_source[3], dummyPluginInfo, dummyProject, {android_studio: true});
|
||||||
expect(copyFileSpy)
|
expect(copyFileSpy)
|
||||||
.toHaveBeenCalledWith(dummyplugin, 'src/android/TestAar.aar', temp, path.join('app/libs/TestAar.aar'), false);
|
.toHaveBeenCalledWith(dummyplugin, 'src/android/TestAar.aar', temp, path.join('app/libs/TestAar.aar'), false);
|
||||||
@ -270,36 +270,26 @@ describe('android project handler', function () {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO:
|
|
||||||
// - merge tests of <source-file> elements into single describe block
|
|
||||||
// (with proper beforeEach/afterEach)
|
|
||||||
// - renumber the tests after Test#019
|
|
||||||
describe('of <source-file> elements', function () {
|
describe('of <source-file> elements', function () {
|
||||||
it('Test#019 : should remove stuff by calling common.deleteJava for Android Studio projects', function () {
|
it('Test#019 : should remove stuff by calling common.deleteJava for Android Studio projects', function () {
|
||||||
android['source-file'].install(valid_source[0], dummyPluginInfo, dummyProject);
|
android['source-file'].install(valid_source[0], dummyPluginInfo, dummyProject);
|
||||||
android['source-file'].uninstall(valid_source[0], dummyPluginInfo, dummyProject);
|
android['source-file'].uninstall(valid_source[0], dummyPluginInfo, dummyProject);
|
||||||
expect(deleteJavaSpy).toHaveBeenCalledWith(temp, path.join('app/src/main/java/com/phonegap/plugins/dummyplugin/DummyPlugin.java'));
|
expect(deleteJavaSpy).toHaveBeenCalledWith(temp, path.join('app/src/main/java/com/phonegap/plugins/dummyplugin/DummyPlugin.java'));
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
describe('of <source-file> element, with specific app target-dir', function () {
|
|
||||||
it('Test#019a : should remove stuff by calling common.deleteJava for Android Studio projects, with specific app target-dir', function () {
|
it('Test#019a : should remove stuff by calling common.deleteJava for Android Studio projects, with specific app target-dir', function () {
|
||||||
android['source-file'].install(valid_source[1], dummyPluginInfo, dummyProject, {android_studio: true});
|
android['source-file'].install(valid_source[1], dummyPluginInfo, dummyProject, {android_studio: true});
|
||||||
android['source-file'].uninstall(valid_source[1], dummyPluginInfo, dummyProject, {android_studio: true});
|
android['source-file'].uninstall(valid_source[1], dummyPluginInfo, dummyProject, {android_studio: true});
|
||||||
expect(deleteJavaSpy).toHaveBeenCalledWith(temp, path.join('app/src/main/src/com/phonegap/plugins/dummyplugin/DummyPlugin2.java'));
|
expect(deleteJavaSpy).toHaveBeenCalledWith(temp, path.join('app/src/main/src/com/phonegap/plugins/dummyplugin/DummyPlugin2.java'));
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
describe('of <source-file> element, with JAR in specific app target-dir', function () {
|
it('Test#019b : should remove stuff by calling common.removeFile for Android Studio projects, of jar with new app target-dir scheme', function () {
|
||||||
it('Test#019b : should remove stuff by calling common.deleteJava for Android Studio projects, with JAR into specific app target-dir', function () {
|
|
||||||
android['source-file'].install(valid_source[2], dummyPluginInfo, dummyProject, {android_studio: true});
|
android['source-file'].install(valid_source[2], dummyPluginInfo, dummyProject, {android_studio: true});
|
||||||
android['source-file'].uninstall(valid_source[2], dummyPluginInfo, dummyProject, {android_studio: true});
|
android['source-file'].uninstall(valid_source[2], dummyPluginInfo, dummyProject, {android_studio: true});
|
||||||
expect(removeFileSpy).toHaveBeenCalledWith(temp, path.join('app/libs/TestLib.jar'));
|
expect(removeFileSpy).toHaveBeenCalledWith(temp, path.join('app/libs/TestLib.jar'));
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
describe('of <source-file> element, with AAR in specific app target-dir', function () {
|
it('Test#019c : should remove stuff by calling common.removeFile for Android Studio projects, of aar with new app target-dir scheme', function () {
|
||||||
it('Test#019c : should remove stuff by calling common.deleteJava for Android Studio projects, with JAR into specific app target-dir', function () {
|
|
||||||
android['source-file'].install(valid_source[3], dummyPluginInfo, dummyProject, {android_studio: true});
|
android['source-file'].install(valid_source[3], dummyPluginInfo, dummyProject, {android_studio: true});
|
||||||
android['source-file'].uninstall(valid_source[3], dummyPluginInfo, dummyProject, {android_studio: true});
|
android['source-file'].uninstall(valid_source[3], dummyPluginInfo, dummyProject, {android_studio: true});
|
||||||
expect(removeFileSpy).toHaveBeenCalledWith(temp, path.join('app/libs/TestAar.aar'));
|
expect(removeFileSpy).toHaveBeenCalledWith(temp, path.join('app/libs/TestAar.aar'));
|
||||||
|
Loading…
Reference in New Issue
Block a user