|
| 1 | +/* |
| 2 | + * Copyright (c) 2010-2020 Tencent Cloud. All rights reserved. |
| 3 | + * |
| 4 | + * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 5 | + * of this software and associated documentation files (the "Software"), to deal |
| 6 | + * in the Software without restriction, including without limitation the rights |
| 7 | + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 8 | + * copies of the Software, and to permit persons to whom the Software is |
| 9 | + * furnished to do so, subject to the following conditions: |
| 10 | + * |
| 11 | + * The above copyright notice and this permission notice shall be included in all |
| 12 | + * copies or substantial portions of the Software. |
| 13 | + * |
| 14 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 15 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 16 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 17 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 18 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 19 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 20 | + * SOFTWARE. |
| 21 | + */ |
| 22 | + |
| 23 | +package com.tencent.cos.xml; |
| 24 | + |
| 25 | +import androidx.test.ext.junit.runners.AndroidJUnit4; |
| 26 | + |
| 27 | +import com.tencent.cos.xml.model.tag.Tagging; |
| 28 | + |
| 29 | +import org.junit.Assert; |
| 30 | +import org.junit.Test; |
| 31 | +import org.junit.runner.RunWith; |
| 32 | + |
| 33 | +@RunWith(AndroidJUnit4.class) |
| 34 | +public class OtherTest { |
| 35 | + @Test |
| 36 | + public void testTagging(){ |
| 37 | + Tagging tagging1 = new Tagging(); |
| 38 | + Tagging.TagSet tagSet1 = new Tagging.TagSet(); |
| 39 | + Tagging.Tag tag11 = new Tagging.Tag("key1", "value1"); |
| 40 | + Tagging.Tag tag12 = new Tagging.Tag("key2", "value2"); |
| 41 | + Tagging.Tag tag13 = new Tagging.Tag("key3", "value3"); |
| 42 | + tagSet1.addTag(tag11); |
| 43 | + tagSet1.addTag(tag12); |
| 44 | + tagSet1.addTag(tag13); |
| 45 | + tagging1.tagSet = tagSet1; |
| 46 | + |
| 47 | + Tagging tagging2 = new Tagging(); |
| 48 | + Tagging.TagSet tagSet2 = new Tagging.TagSet(); |
| 49 | + Tagging.Tag tag21 = new Tagging.Tag("key1", "value1"); |
| 50 | + Tagging.Tag tag22 = new Tagging.Tag("key2", "value2"); |
| 51 | + Tagging.Tag tag23 = new Tagging.Tag("key3", "value3"); |
| 52 | + tagSet2.addTag(tag21); |
| 53 | + tagSet2.addTag(tag22); |
| 54 | + tagSet2.addTag(tag23); |
| 55 | + tagging2.tagSet = tagSet2; |
| 56 | + |
| 57 | + Assert.assertEquals(tagging1, tagging2); |
| 58 | + } |
| 59 | +} |
0 commit comments