Skip to content

Commit

Permalink
Test old plugin aidl & lib mapping - repros apacheGH-547
Browse files Browse the repository at this point in the history
(reproduces apacheGH-547)
  • Loading branch information
Christopher J. Brody committed Nov 14, 2018
1 parent 83f0f87 commit 3832d4d
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spec/fixtures/org.test.plugins.dummyplugin/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@
target-dir="app/libs" />
<source-file src="src/android/mysettings.xml" target-dir="res/xml" />
<source-file src="src/android/other.extension" target-dir="res/values" />
<source-file src="src/android/myapi.aidl" target-dir="src/com/mytest" />
<source-file src="src/android/testaar2.aar" target-dir="libs" />
<source-file src="src/android/testjar2.jar" target-dir="libs" />
<source-file src="src/android/jniLibs/x86/libnative.so" target-dir="libs/x86" />
<lib-file src="src/android/TestLib.jar" />
</platform>
</plugin>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dummy
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dummy
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dummy
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dummy
60 changes: 60 additions & 0 deletions spec/unit/pluginHandlers/handlers.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,38 @@ describe('android project handler', function () {
'src/android/other.extension', temp,
path.join('app/src/main/res/values/other.extension'), false);
});

it('Test#006f : should allow installing aidl file from sources with old target-dir scheme - reproduces GH-547', function () {
// reproduces GH-547
android['source-file'].install(valid_source[6], dummyPluginInfo, dummyProject, {android_studio: true});
expect(copyFileSpy).toHaveBeenCalledWith(dummyplugin,
'src/android/myapi.aidl', temp,
path.join('app/src/main/src/com/mytest/myapi.aidl'), false);
});

it('Test#006g : should allow installing aar lib file from sources with old target-dir scheme - reproduces GH-547', function () {
// reproduces GH-547
android['source-file'].install(valid_source[7], dummyPluginInfo, dummyProject, {android_studio: true});
expect(copyFileSpy).toHaveBeenCalledWith(dummyplugin,
'src/android/testaar2.aar', temp,
path.join('app/src/main/libs/testaar2.aar'), false);
});

it('Test#006h : should allow installing jar lib file from sources with old target-dir scheme - reproduces GH-547', function () {
// reproduces GH-547
android['source-file'].install(valid_source[8], dummyPluginInfo, dummyProject, {android_studio: true});
expect(copyFileSpy).toHaveBeenCalledWith(dummyplugin,
'src/android/testjar2.jar', temp,
path.join('app/src/main/libs/testjar2.jar'), false);
});

it('Test#006i : should allow installing .so lib file from sources with old target-dir scheme - reproduces GH-547', function () {
// reproduces GH-547
android['source-file'].install(valid_source[9], dummyPluginInfo, dummyProject, {android_studio: true});
expect(copyFileSpy).toHaveBeenCalledWith(dummyplugin,
'src/android/jniLibs/x86/libnative.so', temp,
path.join('app/src/main/libs/x86/libnative.so'), false);
});
});

describe('of <framework> elements', function () {
Expand Down Expand Up @@ -326,6 +358,34 @@ describe('android project handler', function () {
android['source-file'].uninstall(valid_source[5], dummyPluginInfo, dummyProject, {android_studio: true});
expect(removeFileSpy).toHaveBeenCalledWith(temp, path.join('app/src/main/res/values/other.extension'));
});

it('Test#019f : should remove stuff by calling common.removeFile for Android Studio projects, of aidl with old target-dir scheme - reproduces GH-547', function () {
// reproduces GH-547
android['source-file'].install(valid_source[6], dummyPluginInfo, dummyProject, {android_studio: true});
android['source-file'].uninstall(valid_source[6], dummyPluginInfo, dummyProject, {android_studio: true});
expect(removeFileSpy).toHaveBeenCalledWith(temp, path.join('app/src/main/src/com/mytest/myapi.aidl'));
});

it('Test#019g : should remove stuff by calling common.removeFile for Android Studio projects, of aar with old target-dir scheme - reproduces GH-547', function () {
// reproduces GH-547
android['source-file'].install(valid_source[7], dummyPluginInfo, dummyProject, {android_studio: true});
android['source-file'].uninstall(valid_source[7], dummyPluginInfo, dummyProject, {android_studio: true});
expect(removeFileSpy).toHaveBeenCalledWith(temp, path.join('app/src/main/libs/testaar2.aar'));
});

it('Test#019h : should remove stuff by calling common.removeFile for Android Studio projects, of jar with old target-dir scheme - reproduces GH-547', function () {
// reproduces GH-547
android['source-file'].install(valid_source[8], dummyPluginInfo, dummyProject, {android_studio: true});
android['source-file'].uninstall(valid_source[8], dummyPluginInfo, dummyProject, {android_studio: true});
expect(removeFileSpy).toHaveBeenCalledWith(temp, path.join('app/src/main/libs/testjar2.jar'));
});

it('Test#019i : should remove stuff by calling common.removeFile for Android Studio projects, of .so lib file with old target-dir scheme - reproduces GH-547', function () {
// reproduces GH-547
android['source-file'].install(valid_source[9], dummyPluginInfo, dummyProject, {android_studio: true});
android['source-file'].uninstall(valid_source[9], dummyPluginInfo, dummyProject, {android_studio: true});
expect(removeFileSpy).toHaveBeenCalledWith(temp, path.join('app/src/main/libs/x86/libnative.so'));
});
});

describe('of <framework> elements', function () {
Expand Down

0 comments on commit 3832d4d

Please sign in to comment.