¡GoConqr estrena diseño! Cuéntanos qué te parece.

Test

Spring certification

Juan Carlos Joya Carvajal 97 preguntas

Hacer el test

Preguntas del test (97)

  1. 1Select which statement(s) is/are true with respect to programming to interfaces with Spring
    1. AA. The use of interfaces allows for reduced coupling between collaborating objects
    2. BB. Spring requires all beans to implement interfaces
    3. CC. Spring requires that parameters in constructors and setters are defined using interface types
    4. DD. Spring requires all beans to have an empty constructor (either default or declared)
  2. 2Consider the following class:
    public class LegacySingleton {
    private LegacySingleton(){}
    public static LegacySingleton getAServiceInstance() {
    return new LegacySingleton();
    }
    }
    How can a bean of type LegacySingleton be created (using XML configuration)? (select one)
    1. AA. It is not possible, the constructor must be public
    2. BB. Use the factory-method attribute on the <bean> tag
    3. CC. Use the init-method attribute on the <bean> tag
    4. DD. Use autowiring
  3. 3Which of the following scenarios requires you to instantiate an ApplicationContext using the `new'
    keyword? (Select one)
    1. AA. Running your Spring application inside a JUnit test (using SpringJUnit4ClassRunner)
    2. BB. Bootstrapping your Spring application within a Java main() method
    3. CC. Deploying your Spring application in an application server, packaged in a WAR file
    4. DD. Both a and b
  4. 4Consider the following code sample which creates an ApplicationContext from a file called "applicationconfig.xml" in the "rewards.internal" package, and a file called test-infra-config.xml in the current folder:
    ApplicationContext context = new
    FileSystemXmlApplicationContext("classpath:rewards.internal.application-config.xml", "file:test- infraconfig.xml");
    Which of those statements is true? (select one)
    1. AA. The use of the "file" prefix is not necessary
    2. BB. The use of the "classpath" prefix is not necessary
    3. CC. The use of the "." separator is correct
    4. DD. Both a and b
  5. 5Which of the following statements is NOT true with respect to Spring's ApplicationContext? (select one)
    1. AA. The ApplicationContext eagerly instantiates all singleton beans by default
    2. BB. There are many different implementation classes which all implement the ApplicationContext interface
    3. CC. When available, the close() method will cause any registered bean destruction code to be invoked
    4. DD. In a JUnit test using Spring support (with @ContextConfiguration annotation), it is necessary to close
      the ApplicationContext manually
  6. 6Select which of the following configuration tasks would be implemented using Spring's XML "context"
    namespace (select one or several answers)
    1. AA. Enabling component-scanning
    2. BB. Enabling the use of the @Transactional annotation
    3. CC. Enabling the use of the @Required, @PreDestroy and @PostConstruct annotations
    4. DD. Enabling the use of the @Around annotation
  7. 7Which of the following statements about the BeanFactoryPostProcessor are true? (select one or several
    answers)
    1. AA. Allows for the transformation of Spring bean definitions before the beans are instantiated
    2. BB. Allows for the transformation of Spring beans after the beans have been instantiated
    3. CC. Detects annotations such as @PostConstruct and @PreDestroy and then invokes appropriate behavior
    4. DD. The <context:property-placeholder /> tag causes a BeanFactoryPostProcessor to be created
  8. 8Identify which statement indicates potential advantages of using Spring's Dependency Injection (select one)
    1. AA. Dependencies between application components can be managed external to the components
      themselves
    2. BB. Configuration can be externalized and centralized in a small set of files
    3. CC. Integration testing is made easier because different components used for testing can easily be injected
    4. DD. All of the above
  9. 9You want to externalize constants from your Spring XML configuration file into a .properties file to your
    Spring beans. Which mechanism could you use? (select one)
    1. AA. Use a PropertyEditor
    2. BB. Use a PropertyPlaceholderConfigurer
    3. CC. Use <util:constant ... />
    4. DD. Use a BeanPostProcessor
  10. 10Which of the following statements about the @PostConstruct annotation is NOT true? (select one)
    1. AA. It is a JSR-250 standard Java annotation
    2. BB. There are no restrictions on method name or visibility of a method which can be annotated with
      @PostConstruct
    3. CC. It can be enabled using the <context:annotation-config /> tag
    4. DD. It is called before setter injection

Información

Descripción
Test sobre Spring certification, creado por Juan Carlos Joya Carvajal el 20/05/2019.
Idioma
English
Visitas
106
Etiquetas
spring
Valoración
Aún sin valoraciones
Valora este test
Valora este test

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?