Examples of AggregateBundle


Examples of org.hibernate.validator.resourceloading.AggregateResourceBundleLocator.AggregateBundle

  @Test
  public void aggregateBundleContainsKeysOfAllSourceBundles() {
    ResourceBundle bundle_1 = ResourceBundle.getBundle( BUNDLE_NAME_1 );
    ResourceBundle bundle_2 = ResourceBundle.getBundle( BUNDLE_NAME_2 );

    ResourceBundle aggregateBundle = new AggregateBundle( Arrays.asList( bundle_1, bundle_2 ) );

    Set<String> actualKeys = getAsSet( aggregateBundle.getKeys() );
    Set<String> expectedKeys = new HashSet<String>( Arrays.asList( "key_1", "key_2", "key_3" ) );

    assertEquals( actualKeys, expectedKeys );
  }
View Full Code Here

Examples of org.hibernate.validator.resourceloading.AggregateResourceBundleLocator.AggregateBundle

    assertEquals( actualKeys, expectedKeys );
  }

  @Test
  public void aggregateBundleWithNoSourceBundlesContainsNoKeys() {
    ResourceBundle aggregateBundle = new AggregateBundle( Collections.<ResourceBundle>emptyList() );
    assertTrue( getAsSet( aggregateBundle.getKeys() ).isEmpty() );
  }
View Full Code Here

Examples of org.hibernate.validator.resourceloading.AggregateResourceBundleLocator.AggregateBundle

  @Test
  public void valuesProperlyRetrievedFromAggregateBundle() {
    ResourceBundle bundle_1 = ResourceBundle.getBundle( BUNDLE_NAME_1 );
    ResourceBundle bundle_2 = ResourceBundle.getBundle( BUNDLE_NAME_2 );

    ResourceBundle aggregateBundle = new AggregateBundle( Arrays.asList( bundle_1, bundle_2 ) );

    assertEquals(
        aggregateBundle.getString( "key_1" ),
        "value 1 from bundle 1",
        "Value for key_1 should be retrieved from bundle 1"
    );
    assertEquals(
        aggregateBundle.getString( "key_2" ),
        "value 2 from bundle 1",
        "Value for key_2 should be retrieved from bundle 1"
    );
    assertEquals(
        aggregateBundle.getString( "key_3" ),
        "value 3 from bundle 2",
        "Value for key_3 should be retrieved from bundle 2"
    );
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.