| File was renamed from sdk/tests/unit-tests-testng/src/org/opends/sdk/LinkedAttributeTest.java |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009 Sun Microsystems, Inc. |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk; |
| | |
| | | import org.testng.Assert; |
| | | import org.testng.annotations.Test; |
| | | |
| | | import org.opends.sdk.ByteString; |
| | | |
| | | |
| | | |
| | | /** |
| | | * Test {@code BasicAttribute}. |
| | | */ |
| | | @Test(groups = { "precommit", "types", "sdk" }, sequential = true) |
| | | public final class LinkedAttributeTest extends OpenDSTestCase |
| | | |
| | | public final class LinkedAttributeTestCase extends SdkTestCase |
| | | { |
| | | @Test |
| | | public void SmokeTest() throws Exception |
| | | public void smokeTest() throws Exception |
| | | { |
| | | // TODO: write a proper test suite. |
| | | AbstractAttribute attribute = new LinkedAttribute( |
| | | AttributeDescription.valueOf("ALTSERVER", Schema |
| | | .getCoreSchema())); |
| | | final AbstractAttribute attribute = new LinkedAttribute( |
| | | AttributeDescription.valueOf("ALTSERVER", Schema.getCoreSchema())); |
| | | |
| | | attribute.add(1); |
| | | attribute.add("a value"); |
| | |
| | | |
| | | Assert.assertTrue(attribute.contains(1)); |
| | | Assert.assertTrue(attribute.contains("a value")); |
| | | Assert.assertTrue(attribute.contains(ByteString |
| | | .valueOf("another value"))); |
| | | Assert.assertTrue(attribute.contains(ByteString.valueOf("another value"))); |
| | | |
| | | Assert.assertEquals(attribute.size(), 3); |
| | | Assert.assertTrue(attribute.remove(1)); |
| | |
| | | Assert.assertEquals(attribute.size(), 2); |
| | | Assert.assertTrue(attribute.remove("a value")); |
| | | Assert.assertEquals(attribute.size(), 1); |
| | | Assert.assertTrue(attribute.remove(ByteString |
| | | .valueOf("another value"))); |
| | | Assert.assertTrue(attribute.remove(ByteString.valueOf("another value"))); |
| | | Assert.assertEquals(attribute.size(), 0); |
| | | } |
| | | } |