You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kw...@apache.org on 2014/12/29 18:08:21 UTC

svn commit: r1648393 [2/2] - in /qpid/trunk/qpid/java/broker-core/src: main/java/org/apache/qpid/server/plugin/ test/java/org/apache/qpid/server/model/ test/java/org/apache/qpid/server/model/testmodel/ test/java/org/apache/qpid/server/model/testmodels/...

Copied: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/singleton/TestModel.java (from r1648392, qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodel/TestModel.java)
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/singleton/TestModel.java?p2=qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/singleton/TestModel.java&p1=qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodel/TestModel.java&r1=1648392&r2=1648393&rev=1648393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodel/TestModel.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/singleton/TestModel.java Mon Dec 29 17:08:20 2014
@@ -1,5 +1,4 @@
 /*
- *
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -16,9 +15,8 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
-package org.apache.qpid.server.model.testmodel;
+package org.apache.qpid.server.model.testmodels.singleton;
 
 import java.util.Arrays;
 import java.util.Collection;
@@ -36,8 +34,7 @@ public class TestModel extends Model
     private static final Model INSTANCE = new TestModel();
     private Class<? extends ConfiguredObject>[] _supportedClasses =
             new Class[] {
-                    TestRootCategory.class,
-                    TestChildCategory.class
+                    TestSingleton.class
             };
 
     private final ConfiguredObjectFactory _objectFactory;
@@ -56,13 +53,13 @@ public class TestModel extends Model
             @Override
             public Collection<Class<? extends ConfiguredObject>> getConfiguredObjectClasses()
             {
-                return Arrays.<Class<? extends ConfiguredObject>>asList(TestRootCategoryImpl.class, Test2RootCategoryImpl.class);
+                return Arrays.asList(_supportedClasses);
             }
 
             @Override
             public String getType()
             {
-                return "org.apache.qpid.server.model.testmodel";
+                return "org.apache.qpid.server.model.testmodels.attribute";
             }
         };
         _registry = new ConfiguredObjectTypeRegistry(Arrays.asList(configuredObjectRegistration), getSupportedCategories());
@@ -78,23 +75,19 @@ public class TestModel extends Model
     @Override
     public Collection<Class<? extends ConfiguredObject>> getChildTypes(final Class<? extends ConfiguredObject> parent)
     {
-        return TestRootCategory.class.isAssignableFrom(parent)
-                ? Collections.<Class<? extends ConfiguredObject>>singleton(TestChildCategory.class)
-                : Collections.<Class<? extends ConfiguredObject>>emptySet();
+        return Collections.emptySet();
     }
 
     @Override
     public Class<? extends ConfiguredObject> getRootCategory()
     {
-        return TestRootCategory.class;
+        return TestSingleton.class;
     }
 
     @Override
     public Collection<Class<? extends ConfiguredObject>> getParentTypes(final Class<? extends ConfiguredObject> child)
     {
-        return TestChildCategory.class.isAssignableFrom(child)
-                ? Collections.<Class<? extends ConfiguredObject>>singleton(TestRootCategory.class)
-                : Collections.<Class<? extends ConfiguredObject>>emptySet();
+        return Collections.<Class<? extends ConfiguredObject>>emptySet();
     }
 
     @Override

Copied: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/singleton/TestSingleton.java (from r1648392, qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodel/TestRootCategory.java)
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/singleton/TestSingleton.java?p2=qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/singleton/TestSingleton.java&p1=qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodel/TestRootCategory.java&r1=1648392&r2=1648393&rev=1648393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodel/TestRootCategory.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/singleton/TestSingleton.java Mon Dec 29 17:08:20 2014
@@ -1,5 +1,4 @@
 /*
- *
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -16,31 +15,30 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
-package org.apache.qpid.server.model.testmodel;
+package org.apache.qpid.server.model.testmodels.singleton;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
 import org.apache.qpid.server.model.ConfiguredObject;
+import org.apache.qpid.server.model.DerivedAttribute;
 import org.apache.qpid.server.model.ManagedAttribute;
 import org.apache.qpid.server.model.ManagedContextDefault;
 import org.apache.qpid.server.model.ManagedObject;
 
-@ManagedObject( defaultType = TestRootCategoryImpl.TEST_ROOT_TYPE )
-public interface TestRootCategory<X extends TestRootCategory<X>> extends ConfiguredObject<X>
+@ManagedObject( defaultType = TestSingletonImpl.TEST_SINGLETON_TYPE)
+public interface TestSingleton<X extends TestSingleton<X>> extends ConfiguredObject<X>
 {
     String AUTOMATED_PERSISTED_VALUE = "automatedPersistedValue";
     String AUTOMATED_NONPERSISTED_VALUE = "automatedNonPersistedValue";
+    String DERIVED_VALUE = "derivedValue";
     String DEFAULTED_VALUE = "defaultedValue";
     String STRING_VALUE = "stringValue";
     String MAP_VALUE = "mapValue";
-    String VALID_VALUE = "validValue";
     String ENUM_VALUE = "enumValue";
+    String INT_VALUE = "intValue";
+    String VALID_VALUE = "validValue";
     String ENUMSET_VALUES = "enumSetValues";
 
     String TEST_CONTEXT_DEFAULT = "TEST_CONTEXT_DEFAULT";
@@ -48,7 +46,6 @@ public interface TestRootCategory<X exte
     @ManagedContextDefault(name = TEST_CONTEXT_DEFAULT)
     String testGlobalDefault = "default";
 
-
     @ManagedAttribute
     String getAutomatedPersistedValue();
 
@@ -71,10 +68,16 @@ public interface TestRootCategory<X exte
     @ManagedAttribute
     TestEnum getEnumValue();
 
+    @ManagedAttribute
+    int getIntValue();
+
     @ManagedAttribute(validValues = {VALID_VALUE1, VALID_VALUE2} )
     String getValidValue();
 
     @ManagedAttribute( validValues = {"[\"TEST_ENUM1\"]", "[\"TEST_ENUM2\", \"TEST_ENUM3\"]"})
     Set<TestEnum> getEnumSetValues();
 
+    @DerivedAttribute
+    long getDerivedValue();
+
 }

Copied: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/singleton/TestSingletonImpl.java (from r1648392, qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodel/Test2RootCategoryImpl.java)
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/singleton/TestSingletonImpl.java?p2=qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/singleton/TestSingletonImpl.java&p1=qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodel/Test2RootCategoryImpl.java&r1=1648392&r2=1648393&rev=1648393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodel/Test2RootCategoryImpl.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/singleton/TestSingletonImpl.java Mon Dec 29 17:08:20 2014
@@ -1,5 +1,4 @@
 /*
- *
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -16,12 +15,9 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
-package org.apache.qpid.server.model.testmodel;
+package org.apache.qpid.server.model.testmodels.singleton;
 
-import java.util.Collection;
-import java.util.Collections;
 import java.util.Map;
 import java.util.Set;
 
@@ -32,11 +28,13 @@ import org.apache.qpid.server.model.Mana
 import org.apache.qpid.server.model.ManagedObject;
 import org.apache.qpid.server.model.ManagedObjectFactoryConstructor;
 
-@ManagedObject( category = false , type = Test2RootCategoryImpl.TEST_ROOT_TYPE )
-public class Test2RootCategoryImpl extends AbstractConfiguredObject<Test2RootCategoryImpl>
-        implements Test2RootCategory<Test2RootCategoryImpl>
+@ManagedObject( category = false, type = TestSingletonImpl.TEST_SINGLETON_TYPE)
+public class TestSingletonImpl extends AbstractConfiguredObject<TestSingletonImpl>
+        implements TestSingleton<TestSingletonImpl>
 {
-    public static final String TEST_ROOT_TYPE = "testroot2";
+    public static final String TEST_SINGLETON_TYPE = "testsingleton";
+
+    public static final int DERIVED_VALUE = -100;
 
     @ManagedAttributeField
     private String _automatedPersistedValue;
@@ -51,19 +49,23 @@ public class Test2RootCategoryImpl exten
     private String _stringValue;
 
     @ManagedAttributeField
+    private int _intValue;
+
+    @ManagedAttributeField
     private Map<String,String> _mapValue;
 
     @ManagedAttributeField
     private String _validValue;
 
     @ManagedAttributeField
-    private TestEnum _enumValue;
+    private org.apache.qpid.server.model.testmodels.singleton.TestEnum _enumValue;
 
     @ManagedAttributeField
-    private Set<TestEnum> _enumSetValues;
+    private Set<org.apache.qpid.server.model.testmodels.singleton.TestEnum> _enumSetValues;
+
 
     @ManagedObjectFactoryConstructor
-    public Test2RootCategoryImpl(final Map<String, Object> attributes)
+    public TestSingletonImpl(final Map<String, Object> attributes)
     {
         super(parentsMap(), attributes, newTaskExecutor(), TestModel.getInstance());
     }
@@ -75,12 +77,13 @@ public class Test2RootCategoryImpl exten
         return currentThreadTaskExecutor;
     }
 
-    public Test2RootCategoryImpl(final Map<String, Object> attributes,
-                                 final TaskExecutor taskExecutor)
+    public TestSingletonImpl(final Map<String, Object> attributes,
+                             final TaskExecutor taskExecutor)
     {
         super(parentsMap(), attributes, taskExecutor);
     }
 
+
     @Override
     public String getAutomatedPersistedValue()
     {
@@ -100,18 +103,6 @@ public class Test2RootCategoryImpl exten
     }
 
     @Override
-    public String getValidValue()
-    {
-        return _validValue;
-    }
-
-    @Override
-    public int getDerivedAttribute()
-    {
-        return 0;
-    }
-
-    @Override
     public String getStringValue()
     {
         return _stringValue;
@@ -135,8 +126,21 @@ public class Test2RootCategoryImpl exten
         return _enumSetValues;
     }
 
-    public static Collection<String> functionGeneratedValidValues()
+    @Override
+    public String getValidValue()
+    {
+        return _validValue;
+    }
+
+    @Override
+    public int getIntValue()
+    {
+        return _intValue;
+    }
+
+    @Override
+    public long getDerivedValue()
     {
-        return Collections.singleton("generated");
+        return DERIVED_VALUE;
     }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org