Package org.jclouds.json.internal.NamingStrategies

Examples of org.jclouds.json.internal.NamingStrategies.ExtractNamed


      assertEquals(strategy.translateName(SimpleTest.class.getDeclaredField("c")), "cat");
      assertEquals(strategy.translateName(SimpleTest.class.getDeclaredField("d")), "dog");
   }

   public void testAnnotationOrNameFieldNamingStrategy() throws Exception {
      FieldNamingStrategy strategy = new AnnotationOrNameFieldNamingStrategy(ImmutableSet.of(new ExtractNamed()));

      assertEquals(strategy.translateName(SimpleTest.class.getDeclaredField("a")), "a");
      assertEquals(strategy.translateName(SimpleTest.class.getDeclaredField("b")), "b");
      assertEquals(strategy.translateName(SimpleTest.class.getDeclaredField("c")), "cat");
      assertEquals(strategy.translateName(SimpleTest.class.getDeclaredField("d")), "dog");
View Full Code Here


      assertEquals(strategy.translateName(SimpleTest.class.getDeclaredField("d")), "dog");
   }

   public void testAnnotationConstructorFieldNamingStrategyCPAndNamed() throws Exception {
      AnnotationConstructorNamingStrategy strategy = new AnnotationConstructorNamingStrategy(
            ImmutableSet.of(ConstructorProperties.class), ImmutableSet.of(new ExtractNamed()));

      Invokable<SimpleTest, SimpleTest> constructor = strategy.getDeserializer(typeToken(SimpleTest.class));
      assertNotNull(constructor);
      assertEquals(constructor.getParameters().size(), 4);
View Full Code Here

      assertEquals(strategy.translateName(constructor, 3), "dog");
   }
  
   public void testAnnotationConstructorFieldNamingStrategyInject() throws Exception {
      AnnotationConstructorNamingStrategy strategy = new AnnotationConstructorNamingStrategy(
            ImmutableSet.of(Inject.class), ImmutableSet.of(new ExtractNamed()));

      Invokable<SimpleTest, SimpleTest> constructor = strategy.getDeserializer(typeToken(SimpleTest.class));
      assertNotNull(constructor);
      assertEquals(constructor.getParameters().size(), 5);
View Full Code Here

TOP

Related Classes of org.jclouds.json.internal.NamingStrategies.ExtractNamed

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.