Tabnine Logo
MergedContextConfiguration.hashCode
Code IndexAdd Tabnine to your IDE (free)

How to use
hashCode
method
in
org.springframework.test.context.MergedContextConfiguration

Best Java code snippets using org.springframework.test.context.MergedContextConfiguration.hashCode (Showing top 20 results out of 315)

origin: spring-projects/spring-framework

/**
 * Generate a unique hash code for all properties of this
 * {@code WebMergedContextConfiguration} excluding the
 * {@linkplain #getTestClass() test class}.
 */
@Override
public int hashCode() {
  return super.hashCode() * 31 + this.resourceBasePath.hashCode();
}
origin: spring-projects/spring-framework

/**
 * Generate a unique hash code for all properties of this
 * {@code MergedContextConfiguration} excluding the
 * {@linkplain #getTestClass() test class}.
 */
@Override
public int hashCode() {
  int result = Arrays.hashCode(this.locations);
  result = 31 * result + Arrays.hashCode(this.classes);
  result = 31 * result + this.contextInitializerClasses.hashCode();
  result = 31 * result + Arrays.hashCode(this.activeProfiles);
  result = 31 * result + Arrays.hashCode(this.propertySourceLocations);
  result = 31 * result + Arrays.hashCode(this.propertySourceProperties);
  result = 31 * result + this.contextCustomizers.hashCode();
  result = 31 * result + (this.parent != null ? this.parent.hashCode() : 0);
  result = 31 * result + nullSafeClassName(this.contextLoader).hashCode();
  return result;
}
origin: spring-projects/spring-framework

@Test
public void hashCodeWithSameInitializers() {
  Set<Class<? extends ApplicationContextInitializer<?>>> initializerClasses1 =
      new HashSet<>();
  initializerClasses1.add(FooInitializer.class);
  initializerClasses1.add(BarInitializer.class);
  Set<Class<? extends ApplicationContextInitializer<?>>> initializerClasses2 =
      new HashSet<>();
  initializerClasses2.add(BarInitializer.class);
  initializerClasses2.add(FooInitializer.class);
  MergedContextConfiguration mergedConfig1 = new MergedContextConfiguration(getClass(),
      EMPTY_STRING_ARRAY, EMPTY_CLASS_ARRAY, initializerClasses1, EMPTY_STRING_ARRAY, loader);
  MergedContextConfiguration mergedConfig2 = new MergedContextConfiguration(getClass(),
      EMPTY_STRING_ARRAY, EMPTY_CLASS_ARRAY, initializerClasses2, EMPTY_STRING_ARRAY, loader);
  assertEquals(mergedConfig1.hashCode(), mergedConfig2.hashCode());
}
origin: spring-projects/spring-framework

@Test
public void hashCodeWithNullArrays() {
  MergedContextConfiguration mergedConfig1 = new MergedContextConfiguration(getClass(), null, null, null, loader);
  MergedContextConfiguration mergedConfig2 = new MergedContextConfiguration(getClass(), null, null, null, loader);
  assertEquals(mergedConfig1.hashCode(), mergedConfig2.hashCode());
}
origin: spring-projects/spring-framework

@Test
public void hashCodeWithEmptyArrays() {
  MergedContextConfiguration mergedConfig1 = new MergedContextConfiguration(getClass(),
      EMPTY_STRING_ARRAY, EMPTY_CLASS_ARRAY, EMPTY_STRING_ARRAY, loader);
  MergedContextConfiguration mergedConfig2 = new MergedContextConfiguration(getClass(),
      EMPTY_STRING_ARRAY, EMPTY_CLASS_ARRAY, EMPTY_STRING_ARRAY, loader);
  assertEquals(mergedConfig1.hashCode(), mergedConfig2.hashCode());
}
origin: spring-projects/spring-framework

@Test
public void hashCodeWithDifferentConfigClasses() {
  Class<?>[] classes1 = new Class<?>[] { String.class, Integer.class };
  Class<?>[] classes2 = new Class<?>[] { Boolean.class, Number.class };
  MergedContextConfiguration mergedConfig1 = new MergedContextConfiguration(getClass(),
      EMPTY_STRING_ARRAY, classes1, EMPTY_STRING_ARRAY, loader);
  MergedContextConfiguration mergedConfig2 = new MergedContextConfiguration(getClass(),
      EMPTY_STRING_ARRAY, classes2, EMPTY_STRING_ARRAY, loader);
  assertNotEquals(mergedConfig1.hashCode(), mergedConfig2.hashCode());
}
origin: spring-projects/spring-framework

@Test
public void hashCodeWithDifferentInitializers() {
  Set<Class<? extends ApplicationContextInitializer<?>>> initializerClasses1 =
      new HashSet<>();
  initializerClasses1.add(FooInitializer.class);
  Set<Class<? extends ApplicationContextInitializer<?>>> initializerClasses2 =
      new HashSet<>();
  initializerClasses2.add(BarInitializer.class);
  MergedContextConfiguration mergedConfig1 = new MergedContextConfiguration(getClass(),
      EMPTY_STRING_ARRAY, EMPTY_CLASS_ARRAY, initializerClasses1, EMPTY_STRING_ARRAY, loader);
  MergedContextConfiguration mergedConfig2 = new MergedContextConfiguration(getClass(),
      EMPTY_STRING_ARRAY, EMPTY_CLASS_ARRAY, initializerClasses2, EMPTY_STRING_ARRAY, loader);
  assertNotEquals(mergedConfig1.hashCode(), mergedConfig2.hashCode());
}
origin: spring-projects/spring-framework

@Test
public void hashCodeWithSameLocations() {
  String[] locations = new String[] { "foo", "bar}" };
  MergedContextConfiguration mergedConfig1 = new MergedContextConfiguration(getClass(), locations,
      EMPTY_CLASS_ARRAY, EMPTY_STRING_ARRAY, loader);
  MergedContextConfiguration mergedConfig2 = new MergedContextConfiguration(getClass(), locations,
      EMPTY_CLASS_ARRAY, EMPTY_STRING_ARRAY, loader);
  assertEquals(mergedConfig1.hashCode(), mergedConfig2.hashCode());
}
origin: spring-projects/spring-framework

@Test
public void hashCodeWithDifferentLocations() {
  String[] locations1 = new String[] { "foo", "bar}" };
  String[] locations2 = new String[] { "baz", "quux}" };
  MergedContextConfiguration mergedConfig1 = new MergedContextConfiguration(getClass(), locations1,
      EMPTY_CLASS_ARRAY, EMPTY_STRING_ARRAY, loader);
  MergedContextConfiguration mergedConfig2 = new MergedContextConfiguration(getClass(), locations2,
      EMPTY_CLASS_ARRAY, EMPTY_STRING_ARRAY, loader);
  assertNotEquals(mergedConfig1.hashCode(), mergedConfig2.hashCode());
}
origin: spring-projects/spring-framework

@Test
public void hashCodeWithSameConfigClasses() {
  Class<?>[] classes = new Class<?>[] { String.class, Integer.class };
  MergedContextConfiguration mergedConfig1 = new MergedContextConfiguration(getClass(),
      EMPTY_STRING_ARRAY, classes, EMPTY_STRING_ARRAY, loader);
  MergedContextConfiguration mergedConfig2 = new MergedContextConfiguration(getClass(),
      EMPTY_STRING_ARRAY, classes, EMPTY_STRING_ARRAY, loader);
  assertEquals(mergedConfig1.hashCode(), mergedConfig2.hashCode());
}
origin: spring-projects/spring-framework

@Test
public void hashCodeWithSameProfiles() {
  String[] activeProfiles = new String[] { "catbert", "dogbert" };
  MergedContextConfiguration mergedConfig1 = new MergedContextConfiguration(getClass(),
      EMPTY_STRING_ARRAY, EMPTY_CLASS_ARRAY, activeProfiles, loader);
  MergedContextConfiguration mergedConfig2 = new MergedContextConfiguration(getClass(),
      EMPTY_STRING_ARRAY, EMPTY_CLASS_ARRAY, activeProfiles, loader);
  assertEquals(mergedConfig1.hashCode(), mergedConfig2.hashCode());
}
origin: spring-projects/spring-framework

@Test
public void hashCodeWithSameProfilesReversed() {
  String[] activeProfiles1 = new String[] { "catbert", "dogbert" };
  String[] activeProfiles2 = new String[] { "dogbert", "catbert" };
  MergedContextConfiguration mergedConfig1 = new MergedContextConfiguration(getClass(),
      EMPTY_STRING_ARRAY, EMPTY_CLASS_ARRAY, activeProfiles1, loader);
  MergedContextConfiguration mergedConfig2 = new MergedContextConfiguration(getClass(),
      EMPTY_STRING_ARRAY, EMPTY_CLASS_ARRAY, activeProfiles2, loader);
  assertNotEquals(mergedConfig1.hashCode(), mergedConfig2.hashCode());
}
origin: spring-projects/spring-framework

@Test
public void hashCodeWithSameDuplicateProfiles() {
  String[] activeProfiles1 = new String[] { "catbert", "dogbert" };
  String[] activeProfiles2 = new String[] { "catbert", "dogbert", "catbert", "dogbert", "catbert" };
  MergedContextConfiguration mergedConfig1 = new MergedContextConfiguration(getClass(),
      EMPTY_STRING_ARRAY, EMPTY_CLASS_ARRAY, activeProfiles1, loader);
  MergedContextConfiguration mergedConfig2 = new MergedContextConfiguration(getClass(),
      EMPTY_STRING_ARRAY, EMPTY_CLASS_ARRAY, activeProfiles2, loader);
  assertEquals(mergedConfig1.hashCode(), mergedConfig2.hashCode());
}
origin: spring-projects/spring-framework

@Test
public void hashCodeWithDifferentProfiles() {
  String[] activeProfiles1 = new String[] { "catbert", "dogbert" };
  String[] activeProfiles2 = new String[] { "X", "Y" };
  MergedContextConfiguration mergedConfig1 = new MergedContextConfiguration(getClass(),
      EMPTY_STRING_ARRAY, EMPTY_CLASS_ARRAY, activeProfiles1, loader);
  MergedContextConfiguration mergedConfig2 = new MergedContextConfiguration(getClass(),
      EMPTY_STRING_ARRAY, EMPTY_CLASS_ARRAY, activeProfiles2, loader);
  assertNotEquals(mergedConfig1.hashCode(), mergedConfig2.hashCode());
}
origin: spring-projects/spring-framework

/**
 * @since 3.2.2
 */
@Test
public void hashCodeWithSameParent() {
  MergedContextConfiguration parent = new MergedContextConfiguration(getClass(), new String[] { "foo", "bar}" },
      EMPTY_CLASS_ARRAY, EMPTY_STRING_ARRAY, loader);
  MergedContextConfiguration mergedConfig1 = new MergedContextConfiguration(getClass(),
      EMPTY_STRING_ARRAY, EMPTY_CLASS_ARRAY, null, EMPTY_STRING_ARRAY, loader, null, parent);
  MergedContextConfiguration mergedConfig2 = new MergedContextConfiguration(getClass(), EMPTY_STRING_ARRAY,
      EMPTY_CLASS_ARRAY, null, EMPTY_STRING_ARRAY, loader, null, parent);
  assertEquals(mergedConfig1.hashCode(), mergedConfig2.hashCode());
}
origin: spring-projects/spring-framework

@Test
public void hashCodeWithNulls() {
  MergedContextConfiguration mergedConfig1 = new MergedContextConfiguration(null, null, null, null, null);
  MergedContextConfiguration mergedConfig2 = new MergedContextConfiguration(null, null, null, null, null);
  assertEquals(mergedConfig1.hashCode(), mergedConfig2.hashCode());
}
origin: spring-projects/spring-framework

/**
 * @since 3.2.2
 */
@Test
public void hashCodeWithDifferentParents() {
  MergedContextConfiguration parent1 = new MergedContextConfiguration(getClass(), new String[] { "foo", "bar}" },
      EMPTY_CLASS_ARRAY, EMPTY_STRING_ARRAY, loader);
  MergedContextConfiguration parent2 = new MergedContextConfiguration(getClass(), new String[] { "baz", "quux" },
      EMPTY_CLASS_ARRAY, EMPTY_STRING_ARRAY, loader);
  MergedContextConfiguration mergedConfig1 = new MergedContextConfiguration(getClass(), EMPTY_STRING_ARRAY,
      EMPTY_CLASS_ARRAY, null, EMPTY_STRING_ARRAY, loader, null, parent1);
  MergedContextConfiguration mergedConfig2 = new MergedContextConfiguration(getClass(), EMPTY_STRING_ARRAY,
      EMPTY_CLASS_ARRAY, null, EMPTY_STRING_ARRAY, loader, null, parent2);
  assertNotEquals(mergedConfig1.hashCode(), mergedConfig2.hashCode());
}
origin: spring-projects/spring-framework

@Test
public void hashCodeWithEmptyArraysAndDifferentLoaders() {
  MergedContextConfiguration mergedConfig1 = new MergedContextConfiguration(getClass(),
      EMPTY_STRING_ARRAY, EMPTY_CLASS_ARRAY, EMPTY_STRING_ARRAY, loader);
  MergedContextConfiguration mergedConfig2 = new MergedContextConfiguration(getClass(),
      EMPTY_STRING_ARRAY, EMPTY_CLASS_ARRAY, EMPTY_STRING_ARRAY, new AnnotationConfigContextLoader());
  assertNotEquals(mergedConfig1.hashCode(), mergedConfig2.hashCode());
}
origin: apache/servicemix-bundles

/**
 * Generate a unique hash code for all properties of this
 * {@code WebMergedContextConfiguration} excluding the
 * {@linkplain #getTestClass() test class}.
 */
@Override
public int hashCode() {
  return super.hashCode() * 31 + this.resourceBasePath.hashCode();
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-test

/**
 * Generate a unique hash code for all properties of this
 * {@code WebMergedContextConfiguration} excluding the
 * {@linkplain #getTestClass() test class}.
 */
@Override
public int hashCode() {
  return super.hashCode() * 31 + this.resourceBasePath.hashCode();
}
org.springframework.test.contextMergedContextConfigurationhashCode

Javadoc

Generate a unique hash code for all properties of this MergedContextConfiguration excluding the #getTestClass().

Popular methods of MergedContextConfiguration

  • getLocations
    Get the merged resource locations for ApplicationContextconfiguration files for the #getTestClass().
  • getTestClass
    Get the Class associated with this MergedContextConfiguration.
  • getActiveProfiles
    Get the merged active bean definition profiles for the #getTestClass().
  • getClasses
    Get the merged annotated classes for the #getTestClass().
  • getContextLoader
    Get the resolved ContextLoader for the #getTestClass().
  • <init>
    Create a new MergedContextConfiguration instance by copying all fields from the supplied MergedConte
  • getParent
    Get the MergedContextConfiguration for the parent application context in a context hierarchy.
  • getParentApplicationContext
    Get the parent ApplicationContext for the context defined by this MergedContextConfiguration from th
  • getContextInitializerClasses
    Get the merged ApplicationContextInitializer classes for the #getTestClass().
  • getPropertySourceProperties
    Get the merged test PropertySource properties for the #getTestClass().Properties will be loaded into
  • hasLocations
    Determine if this MergedContextConfiguration instance has path-based context resource locations.
  • getContextCustomizers
    Get the merged ContextCustomizer that will be applied when the application context is loaded.
  • hasLocations,
  • getContextCustomizers,
  • getPropertySourceLocations,
  • hasClasses,
  • equals,
  • nullSafeClassName,
  • processActiveProfiles,
  • processClasses,
  • processContextCustomizers

Popular in Java

  • Reactive rest calls using spring rest template
  • setRequestProperty (URLConnection)
  • getSystemService (Context)
  • putExtra (Intent)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • JTable (javax.swing)
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now