Loading .drone.yml +2 −0 Original line number Diff line number Diff line Loading @@ -100,6 +100,8 @@ services: - su www-data -c "php /var/www/html/occ group:adduser users user2" - su www-data -c "git clone -b master https://github.com/nextcloud/activity.git /var/www/html/apps/activity/" - su www-data -c "php /var/www/html/occ app:enable activity" - su www-data -c "git clone -b master https://github.com/nextcloud/text.git /var/www/html/apps/text/" - su www-data -c "php /var/www/html/occ app:enable text" - /run.sh trigger: Loading scripts/analysis/findbugs-results.txt +1 −1 Original line number Diff line number Diff line 168 No newline at end of file 144 scripts/analysis/spotbugs-filter.xml +4 −1 Original line number Diff line number Diff line Loading @@ -8,8 +8,11 @@ <Match> <Class name="~.*\.R\$.*" /> </Match> <Match> <Class name="~.*\$\$Parcelable.*" /> </Match> <Bug pattern="PATH_TRAVERSAL_IN" /> <Bug pattern="ANDROID_EXTERNAL_FILE_ACCESS" /> <Bug pattern="BAS_BLOATED_ASSIGNMENT_SCOPE" /> <Bug pattern="SECHPP" /> <Bug pattern="HTTP_PARAMETER_POLLUTION" /> </FindBugsFilter> src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingCreateFileRemoteOperationTest.java 0 → 100644 +65 −0 Original line number Diff line number Diff line /* Nextcloud Android Library is available under MIT license * * @author Tobias Kaminsky * Copyright (C) 2019 Tobias Kaminsky * Copyright (C) 2019 Nextcloud GmbH * * 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.nextcloud.android.lib.resources.directediting; import com.owncloud.android.AbstractIT; import com.owncloud.android.lib.common.operations.RemoteOperationResult; import org.junit.Test; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; public class DirectEditingCreateFileRemoteOperationTest extends AbstractIT { @Test public void createEmptyFile() { RemoteOperationResult result = new DirectEditingCreateFileRemoteOperation("/test.md", "text", "textdocument") .execute(client); assertTrue(result.isSuccess()); String url = (String) result.getSingleData(); assertFalse(url.isEmpty()); } @Test public void createFileFromTemplate() { RemoteOperationResult result = new DirectEditingCreateFileRemoteOperation("/test.md", "text", "textdocument", "1") .execute(client); assertTrue(result.isSuccess()); String url = (String) result.getSingleData(); assertFalse(url.isEmpty()); } } src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingObtainListOfTemplatesRemoteOperationTest.java 0 → 100644 +53 −0 Original line number Diff line number Diff line /* Nextcloud Android Library is available under MIT license * * @author Tobias Kaminsky * Copyright (C) 2019 Tobias Kaminsky * Copyright (C) 2019 Nextcloud GmbH * * 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.nextcloud.android.lib.resources.directediting; import com.owncloud.android.AbstractIT; import com.owncloud.android.lib.common.TemplateList; import com.owncloud.android.lib.common.operations.RemoteOperationResult; import org.junit.Test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; public class DirectEditingObtainListOfTemplatesRemoteOperationTest extends AbstractIT { @Test public void testGetAll() { RemoteOperationResult result = new DirectEditingObtainListOfTemplatesRemoteOperation("text", "textdocument") .execute(client); assertTrue(result.isSuccess()); TemplateList templateList = (TemplateList) result.getSingleData(); assertEquals("Empty file", templateList.templates.get("empty").title); assertEquals("md", templateList.templates.get("empty").extension); } } Loading
.drone.yml +2 −0 Original line number Diff line number Diff line Loading @@ -100,6 +100,8 @@ services: - su www-data -c "php /var/www/html/occ group:adduser users user2" - su www-data -c "git clone -b master https://github.com/nextcloud/activity.git /var/www/html/apps/activity/" - su www-data -c "php /var/www/html/occ app:enable activity" - su www-data -c "git clone -b master https://github.com/nextcloud/text.git /var/www/html/apps/text/" - su www-data -c "php /var/www/html/occ app:enable text" - /run.sh trigger: Loading
scripts/analysis/findbugs-results.txt +1 −1 Original line number Diff line number Diff line 168 No newline at end of file 144
scripts/analysis/spotbugs-filter.xml +4 −1 Original line number Diff line number Diff line Loading @@ -8,8 +8,11 @@ <Match> <Class name="~.*\.R\$.*" /> </Match> <Match> <Class name="~.*\$\$Parcelable.*" /> </Match> <Bug pattern="PATH_TRAVERSAL_IN" /> <Bug pattern="ANDROID_EXTERNAL_FILE_ACCESS" /> <Bug pattern="BAS_BLOATED_ASSIGNMENT_SCOPE" /> <Bug pattern="SECHPP" /> <Bug pattern="HTTP_PARAMETER_POLLUTION" /> </FindBugsFilter>
src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingCreateFileRemoteOperationTest.java 0 → 100644 +65 −0 Original line number Diff line number Diff line /* Nextcloud Android Library is available under MIT license * * @author Tobias Kaminsky * Copyright (C) 2019 Tobias Kaminsky * Copyright (C) 2019 Nextcloud GmbH * * 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.nextcloud.android.lib.resources.directediting; import com.owncloud.android.AbstractIT; import com.owncloud.android.lib.common.operations.RemoteOperationResult; import org.junit.Test; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; public class DirectEditingCreateFileRemoteOperationTest extends AbstractIT { @Test public void createEmptyFile() { RemoteOperationResult result = new DirectEditingCreateFileRemoteOperation("/test.md", "text", "textdocument") .execute(client); assertTrue(result.isSuccess()); String url = (String) result.getSingleData(); assertFalse(url.isEmpty()); } @Test public void createFileFromTemplate() { RemoteOperationResult result = new DirectEditingCreateFileRemoteOperation("/test.md", "text", "textdocument", "1") .execute(client); assertTrue(result.isSuccess()); String url = (String) result.getSingleData(); assertFalse(url.isEmpty()); } }
src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingObtainListOfTemplatesRemoteOperationTest.java 0 → 100644 +53 −0 Original line number Diff line number Diff line /* Nextcloud Android Library is available under MIT license * * @author Tobias Kaminsky * Copyright (C) 2019 Tobias Kaminsky * Copyright (C) 2019 Nextcloud GmbH * * 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.nextcloud.android.lib.resources.directediting; import com.owncloud.android.AbstractIT; import com.owncloud.android.lib.common.TemplateList; import com.owncloud.android.lib.common.operations.RemoteOperationResult; import org.junit.Test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; public class DirectEditingObtainListOfTemplatesRemoteOperationTest extends AbstractIT { @Test public void testGetAll() { RemoteOperationResult result = new DirectEditingObtainListOfTemplatesRemoteOperation("text", "textdocument") .execute(client); assertTrue(result.isSuccess()); TemplateList templateList = (TemplateList) result.getSingleData(); assertEquals("Empty file", templateList.templates.get("empty").title); assertEquals("md", templateList.templates.get("empty").extension); } }