@@ -0,0 +1,2588 @@
+/* ownCloud Android Library is available under MIT license%0A *   Copyright (C) 2014 ownCloud (http://www.owncloud.org/)%0A *   %0A *   Permission is hereby granted, free of charge, to any person obtaining a copy%0A *   of this software and associated documentation files (the %22Software%22), to deal%0A *   in the Software without restriction, including without limitation the rights%0A *   to use, copy, modify, merge, publish, distribute, sublicense, and/or sell%0A *   copies of the Software, and to permit persons to whom the Software is%0A *   furnished to do so, subject to the following conditions:%0A *   %0A *   The above copyright notice and this permission notice shall be included in%0A *   all copies or substantial portions of the Software.%0A *   %0A *   THE SOFTWARE IS PROVIDED %22AS IS%22, WITHOUT WARRANTY OF ANY KIND, %0A *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF%0A *   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND %0A *   NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS %0A *   BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN %0A *   ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN %0A *   CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN%0A *   THE SOFTWARE.%0A *%0A */%0A%0Apackage com.owncloud.android.lib.test_project.test;%0A%0Aimport com.owncloud.android.lib.operations.common.OCShare;%0Aimport com.owncloud.android.lib.operations.common.RemoteOperationResult;%0Aimport com.owncloud.android.lib.test_project.TestActivity;%0A%0Aimport android.test.ActivityInstrumentationTestCase2;%0Aimport android.util.Log;%0A%0Apublic class RemoveShareTest extends ActivityInstrumentationTestCase2%3CTestActivity%3E %7B%0A%09%0A%09private static final String TAG = RemoveShareTest.class.getSimpleName();%0A%09%0A%09private TestActivity mActivity;%0A%0A%09public RemoveShareTest() %7B%0A%09%09super(TestActivity.class);%0A%09%09%0A%09%7D%0A%0A%09@Override%0A%09  protected void setUp() throws Exception %7B%0A%09    super.setUp();%0A%09    setActivityInitialTouchMode(false);%0A%09    mActivity = getActivity();%0A%09%7D%0A%09%0A%09/**%0A%09 * Test Remove Share: the server must support SHARE API%0A%09 */%0A%09public void testRemoveShare() %7B%0A%09%09// Get the shares%0A%09%09RemoteOperationResult result = mActivity.getShares();%0A%09%09if (result.isSuccess()) %7B%0A%09%09%09int size = result.getData().size();%0A%0A%09%09%09if (size %3E 0) %7B%0A%09%09%09%09OCShare share = ((OCShare) result.getData().get(size -1));%0A%09%09%09%09long id = share.getIdRemoteShared();%0A%09%09%09%09Log.d(TAG, %22File to unshare: %22 + share.getPath() );%0A%09%09%09%09result = mActivity.removeShare((int) id);%09// Unshare%0A%09%09%09%09assertTrue(result.isSuccess());%0A%09%09%09%7D else %7B%0A%09%09%09%09assertTrue(true);%0A%09%09%09%7D%0A%09%09%7D else %7B%0A%09%09%09assertTrue(true);%0A%09%09%7D%0A%09%7D%0A%7D%0A

Create unitTests in the library: unshare a item.