Package nexj.core.meta.ui

Examples of nexj.core.meta.ui.AttributeMeta


{
   public void testContactLastNameLengthPlus1()
   {
      Metadata metadata = Repository.getMetadata();
      Metaclass clazz = metadata.getMetaclass("Contact");
      AttributeMeta attr = clazz.getAttributeMeta("lastNameLengthPlus1");

      // (+ (string-length (@ lastName)) 1)
      assertTrue(attr.isClientCalculable());

      assertNotNull(attr.getValueFunction());
      assertNotNull(attr.getValueDependencyAssociations());

      assertNull(attr.getValueDependencyAssociations().getTail());
      assertEquals(Pair.list("lastName"), attr.getValueDependencyAssociations().getHead());
   }
View Full Code Here


   public void testContactIsHome()
   {
      Metadata metadata = Repository.getMetadata();
      Metaclass clazz = metadata.getMetaclass("Contact");
      AttributeMeta attr = clazz.getAttributeMeta("isHome");

      // (if (null? (@ firstAddress)) #f (@ firstAddress isHome))
      assertTrue(attr.isClientCalculable());
      assertNotNull(attr.getValueDependencyAssociations());

      Object[] deps = Pair.toArray(attr.getValueDependencyAssociations());

      assertEquals(1, deps.length);
      assertEquals(Pair.list("firstAddress", "isHome"), deps[0]);
   }
View Full Code Here

   public void testContactIsHome2()
   {
      Metadata metadata = Repository.getMetadata();
      Metaclass clazz = metadata.getMetaclass("Contact");
      AttributeMeta attr = clazz.getAttributeMeta("isHome2");

      // (if (null? (@ supportGroup)) #f (@ firstAddress isHome))
      assertTrue(attr.isClientCalculable());
      assertNotNull(attr.getValueDependencyAssociations());

      Object[] deps = Pair.toArray(attr.getValueDependencyAssociations());

      assertEquals(2, deps.length);
      assertEquals(Pair.list("firstAddress", "isHome"), deps[0]);
      assertEquals(Pair.list("supportGroup"), deps[1]);
   }
View Full Code Here

   public void testPatientIcon()
   {
      Metadata metadata = Repository.getMetadata();
      Metaclass clazz = metadata.getMetaclass("Patient");
      AttributeMeta attr = clazz.getAttributeMeta("icon");

      assertFalse(attr.isClientCalculable());
   }
View Full Code Here

   public void testContactReadable()
   {
      Metadata metadata = Repository.getMetadata();
      Metaclass clazz = metadata.getMetaclass("Contact");
      AttributeMeta attr = clazz.getAttributeMeta("readable");

      assertFalse(attr.isClientCalculable());
   }
View Full Code Here

   public void testContactFullName2()
   {
      Metadata metadata = Repository.getMetadata();
      Metaclass clazz = metadata.getMetaclass("Contact");
      AttributeMeta attr = clazz.getAttributeMeta("fullName2");

      // (string-affix (@ lastName) ", " (@ firstName))
      assertTrue(attr.isClientCalculable());

      Object[] deps = Pair.toArray(attr.getValueDependencyAssociations());

      assertEquals(2, deps.length);
      assertEquals(Pair.list("firstName"), deps[0]);
      assertEquals(Pair.list("lastName"), deps[1]);
   }
View Full Code Here

   public void testContactFullDetail()
   {
      Metadata metadata = Repository.getMetadata();
      Metaclass clazz = metadata.getMetaclass("Contact");
      AttributeMeta attr = clazz.getAttributeMeta("fullNameDetail");

      // (string-affix (@ fullName2) " " (if (null? (@ firstName)) '()
      // (string-append "(" (@ firstName) ")")))
      assertTrue(attr.isClientCalculable());

      Object[] deps = Pair.toArray(attr.getValueDependencyAssociations());

      assertEquals(2, deps.length);
      assertEquals(Pair.list("firstName"), deps[0]);
      assertEquals(Pair.list("fullName2"), deps[1]);
   }
View Full Code Here

   public void testContactAllowClearPreferred()
   {
      Metadata metadata = Repository.getMetadata();
      Metaclass clazz = metadata.getMetaclass("Contact");
      AttributeMeta attr = clazz.getAttributeMeta("allowClearPreferred");

      // (and (@ tax) (not (null? ((@ supportGroup) (@ note)))))
      // Dynamic selector: ---------------------------^
      assertFalse(attr.isClientCalculable());
   }
View Full Code Here

   public void testContactAlphaGroup()
   {
      Metadata metadata = Repository.getMetadata();
      Metaclass clazz = metadata.getMetaclass("Contact");
      AttributeMeta attr = clazz.getAttributeMeta("alphaGroup");

      // (if (or (null? (@ lastName)) (= 0 (string-length (@ lastName))))
      // "(empty)" (string (string-ref (@ lastName) 0)))
      assertTrue(attr.isClientCalculable());

      Object[] deps = Pair.toArray(attr.getValueDependencyAssociations());

      assertEquals(1, deps.length);
      assertEquals(Pair.list("lastName"), deps[0]);
   }
View Full Code Here

   public void testContactWizardIcon()
   {
      // (if (null? (@ icon)) "32/folder" ((@ icon)'replaceAll "16" "32"))
      Metadata metadata = Repository.getMetadata();
      Metaclass clazz = metadata.getMetaclass("Contact");
      AttributeMeta attr = clazz.getAttributeMeta("wizardIcon");

      assertFalse(attr.isClientCalculable());
   }
View Full Code Here

TOP

Related Classes of nexj.core.meta.ui.AttributeMeta

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.