Thursday, October 17, 2013

Spring Interview Questions - Three

Q1: What are types of IoC containers? Explain them.

Ans: There are two types of IoC containers:

  • Bean Factory container: This is the simplest container providing basic support for DI .The BeanFactory is usually preferred where the resources are limited like mobile devices or applet based applications
  • Spring ApplicationContext Container: This container adds more enterprise-specific functionality such as the ability to resolve textual messages from a properties file and the ability to publish application events to interested event listeners.
·     Q2: Give an example of BeanFactory implementation.

·    Ans: The most commonly used BeanFactory implementation is the XmlBeanFactory class. This container reads the configuration metadata from an XML file and uses it to create a fully configured system or application.

·     Q3: What are the common implementations of the ApplicationContext?

·     Ans: The three commonly used implementation of 'Application Context' are:

  • FileSystemXmlApplicationContext: This container loads the definitions of the beans from an XML file. Here you need to provide the full path of the XML bean configuration file to the constructor.
  • ClassPathXmlApplicationContext: This container loads the definitions of the beans from an XML file. Here you do not need to provide the full path of the XML file but you need to set CLASSPATH properly because this container will look bean configuration XML file in CLASSPATH.
  • WebXmlApplicationContext: This container loads the XML file with definitions of all beans from within a web application. 
Q4: What is the difference between Bean Factory and ApplicationContext?

A: Following are some of the differences:
  1. Application contexts provide a means for resolving text messages, including support for i18n of those messages.
  2. Application contexts provide a generic way to load file resources, such as images.
  3. Application contexts can publish events to beans that are registered as listeners.
  4. Certain operations on the container or beans in the container, which have to be handled in a programmatic fashion with a bean factory, can be handled declaratively in an application context.
  5. The application context implements MessageSource, an interface used to obtain localized messages, with the actual implementation being pluggable.

Q5: What are Spring beans?

Ans: The objects that form the backbone of your application and that are managed by the Spring IoC container are called beans. A bean is an object that is instantiated, assembled, and otherwise managed by a Spring IoC container. These beans are created with the configuration metadata that you supply to the container, for example, in the form of XML <bean/> definitions.

Q6: What does a bean definition contain?

Ans: The bean definition contains the information called configuration metadata which is needed for the container to know the followings:
  •          How to create a bean
  •          Bean's lifecycle details
  •          Bean's dependencies

Q7: How do you provide configuration metadata to the Spring Container?

Ans: There are following three important methods to provide configuration metadata to the Spring Container:
  •          XML based configuration file.
  •          Annotation-based configuration
  •          Java-based configuration

Q8: How do add a bean in spring application?

Ans: Check the following example:
<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">

   <bean id="helloWorld" class="com.tutorialspoint.HelloWorld">
       <property name="message" value="Hello World!"/>
   </bean>

</beans>

Q9: How do you define a bean scope?

Ans: When defining a <bean> in Spring, you have the option of declaring a scope for that bean. For example, to force Spring to produce a new bean instance each time one is needed, you should declare the bean's scope attribute to be prototype. Similar way if you want Spring to return the same bean instance each time one is needed, you should declare the bean's scope attribute to besingleton. 

Hibernate Interview Questions - Three

Q1. Should all the mapping files of hibernate have .hbm.xml extension to work properly?
Ans: No, having .hbm.xml extension is a convention and not a requirement for hibernate mapping file names. We can have any extension for these mapping files. But this is the best practice to follow this extension.
Q2. How do we create session factory in hibernate?

Ans: To create a session factory in hibernate, an object of configuration is created first which refers to the path of configuration file and then for that configuration, session factory is created as given in the example below:
Configuration config = new Configuration();
config.addResource(&amp;quot;myinstance/configuration.hbm.xml&amp;quot;);
config.setProperties( System.getProperties() );
SessionFactory sessions = config.buildSessionFactory();
Q3. What is meant by Method chaining?
Ans: Method chaining is a programming technique that is supported by many hibernate interfaces. This is less readable when compared to actual java code. And it is not mandatory to use this format. Look how a SessionFactory is created when we use method chaining.
SessionFactory sessions = new Configuration()
.addResource(“myinstance/MyConfig.hbm.xml”)
.setProperties( System.getProperties() )
.buildSessionFactory();
Q4. What does hibernate.properties file consist of?
Ans: This is a property file that should be placed in application class path. So when the Configuration object is created, hibernate is first initialized. At this moment the application will automatically detect and read this hibernate.properties file.
hibernate.connection.datasource = java:/comp/env/jdbc/AuctionDB
hibernate.transaction.factory_class = net.sf.hibernate.transaction.JTATransactionFactory
hibernate.transaction.manager_lookup_class = net.sf.hibernate.transaction.JBossTransactionManagerLookup
hibernate.dialect = net.sf.hibernate.dialect.PostgreSQLDialect
Q5. What should SessionFactory be placed so that it can be easily accessed?
Ans: As far as it is compared to J2EE environment, if the SessionFactory is placed in JNDI then it can be easily accessed and shared between different threads and various components that are hibernate aware. You can set the SessionFactory to a JNDI by configuring a property hibernate.session_factory_name in the hibernate.properties file.
Q6. What are POJOs and what’s their significance?
Ans: POJO stands for plain old java objects. These are just basic JavaBeans that have defined setter and getter methods for all the properties that are there in that bean. Besides they can also have some business logic related to that property. Hibernate applications works efficiently with POJOs rather than simple java classes. Use of POJOs instead of simple java classes results in an efficient and well-constructed code.
Q7. What is ORM metadata?

Ans: ORM tools require a metadata format for the application to specify the mapping between classes and tables, properties and columns, associations and foreign keys, Java types and SQL types. This information is called the object/relational mapping metadata. It defines the transformation between the different data type systems and relationship representations.

Q8. What’s HQL?

Ans: HQL is the query language used in Hibernate which is an extension of SQL. HQL is very efficient, simple and flexible query language to do various types of operations on relational database without writing complex database queries.

Q9. What are the different types of property and class mappings?

Typical and most common property mapping
<property name=”description” column=”DESCRIPTION” type=”string”/>
Or 

<property name=”description” type=”string”>
<column name=”DESCRIPTION”/>
</property>

Derived properties
<property name=”averageBidAmount” formula=”( select AVG(b.AMOUNT) from BID b
where b.ITEM_ID = ITEM_ID )” type=”big_decimal”/>

Typical and most common property mapping
<property name=”description” column=”DESCRIPTION” type=”string”/>
Controlling inserts and updates
<property name=”name” column=”NAME” type=”string”
insert=”false” update=”false”/>

Saturday, October 12, 2013

IBM RFT-000-842 Dumps - Six

Q1. Which branches under Preferences contain specific settings to enable the ClearCase integration?

A. Workbench and Test
B. Functional Test and Run/Debug
C. Workbench and Team
D. Plug-in Development and Functional Test

Ans: C

Q2. When you set break points, why does the script not stop at the break points and switch over to the debug perspective?

A. This is a known eclipse bug in version 6.1 and has been corrected in the latest release or last interim fix
B. The break point has already been recognized by the JVM and the break point needs to be toggled
C. Either the icon or debug functional tester script was not invoked or the shift + F11 menu option was not invoked
D. The debug perspective is not listed as an available perspective when trying to debug a script

Ans: C

Q3. When you enable web browsers, what is the best way to select the Linux or UNIX web browser?

A. You use the Search button, choose Search All, select the executable, and provide all the needed parameters.
B. Modify the registry to enable Linux or Unix web browser support
C. Modify the Internet Explorer settings to refer to a Linux or Unix web browser
D. You use the Search button, choose Search In, browse to the executable, and provide all the needed parameters

Ans: D

Q4. In which situation is it best to use the Browser Enablement Diagnostic tool?

A. when the web browser does not launch when invoked through Functional Tester
B. when testers are trying to determine if their web browsers are compatible with Functional Tester
C. when Functional Tester is in the recording process and no HTML objects are being recognized
D. when Functional Tester is not able to launch the viewlet comparator on the HTML log

Ans: C

Q5. You cannot access help file from Rational Functional Tester. You receive an error or the page loads slowly. How can this be fixed?

A. talk to the LAN Administrator to see if there is a problem with the corporate network or if the ISP is having performance issues
B. in Network properties, change the IP configuration to static IP and provide a valid IP address, which can be obtained from the LAN Administrator
C. in the Network Advanced settings for proxies, remove "127.0.0.1; localhost" from the Exceptions if these addresses are listed
D. if your host was configured to use DHCP for IP assignment, make sure that the "Automatically detect settings" checkbox is cleared

Ans: D

Q6. Where do you set the option for switching to Test Debug perspective when debugging?

A. Preferences > Functional Test > Workbench > Advanced
B. Preferences > Java > Debug
C. Preferences > Run/Debug > Console
D. Preferences > Test

Ans: A

Q7. How do you add line numbers within the script editors view?

A. use a third party plug-in because this option is not available within the tools interface
B. download the latest version of the plug-in
C. select the option under the main menu > Window > Preferences > Debug
D. select the option under the main menu > Window > Preferences > Editor

Ans: D

Q8. How many default Java environments can you have within one configuration of Rational Functional Tester?

A. one for each instance of the application under test
B. as many default Java environments as are needed to do testing
C. You can change the java environments dynamically when testing different applications.
D. only one

Ans: D

Q9. What is the best practice when changing object maps that are already assigned to Functional Test projects?

A. highlight the project in the Functional Test projects, right-click, select Properties > Functional Test project and browse to the new object map
B. record a new script, select the new Functional Test project, click next and browse to the new test object map
C. modify the XML file, configurations.rftcfg, locate the object map section, enter the proper object and save the XML file
D. right-click the test object map in the script explorer, choose the Open option and make necessary changes

Ans: A

IBM RFT-000-842 Dumps - Five

Q1. Given the following settings: Maximum acceptable recognition score 10000 Last chance recognition score 20000 Warn if accepted score is greater than 10000 Maximum time to attempt to find Test Object 20. How will RFT behave at runtime if the recognition score of a found object is 10000?

A. It will accept the found object after waiting for 20 seconds for an object with better recognition and write an Ambiguous Recognition Warning to the log.
B. It will accept the found object after waiting for 20 seconds for an object with better recognition and write nothing to the log.
C. It will accept the found object immediately and write an Ambiguous Recognition Warning to the log.
D. It will accept the found object immediately and write nothing to the log.
E. It will immediately throw an ObjectNotFoundException and write an Ambiguous Recognition Failure to the log.
F. It will throw an ObjectNotFoundException after waiting for 20 seconds for an object with better recognition and write an Ambiguous Recognition Failure to the log.

Ans: D

Q2. Which feature is NOT offered by the Object Map interface?

A. the ability to delete test objects that are not referenced by any scripts
B. the ability to delete scripts that do not reference any test objects in the object map
C. the ability to find all test objects not referenced by scripts
D. the ability to merge two test objects

Ans: B

Q3. What is the minimum weight that can be assigned to a recognition property?

A. no value (leave blank)
B. 0
C. 1
D. 10
E. 100

Ans: B

Q4. Which regular expression offers a successful way to ensure the order number is a 1 to 3-digit number in the following format? Your order number is 125.

A. Your order number is [0-9]{3}.
B. Your order number is [0-9]{3}\.
C. Your order number is [0-9]{1,3}.
D. Your order number is [0-9]{1,3}\.

Ans: D

Q5. What are the default values for retry interval and maximum retry time?

A. 2 second retry interval, 20 seconds maximum retry time
B. 5 second retry interval, 30 seconds maximum retry time
C. 1 second retry interval, 5 seconds maximum retry time
D. 3 second retry interval, 15 seconds maximum retry time

Ans: A

Q6. Which objects can be tested with a State verification point?

A. A combo box and a list box
B. A label and a text box
C. A table and a tree view
D. A checkbox and a toggle button

Ans: D

Q7. What is an appropriate use of the command Test Object > Highlight when working with verification points?

A. It is used to highlight the test object at playback (to identify what is being tested).
B. It is used to create a new verification point in the current script
C. It is used to highlight the test object (to verify it is found in the application)
D. It is used to identify all objects in an application which can be tested

Ans: C

Q8. Which statement is true about the "Time Delayed" method when you are creating verification points in your scripts?

A. It introduces a fixed delay after a previous action before the verification point is tested
B. It allows a verification point to keep trying until the time specified has elapsed
C. It gives the tester time to reveal pop-up objects (such as menus) during the creation of a verification point
D. It gives the tester the opportunity to specify a delay after a verification point fails

Ans: C

Q9. Given the following manual verification point: vpManual ("manual1", "The rain in Spain", "The Rain in Spain").performTest(); What are the results?
A. The two strings are the same, and a pass would be generated in the log
B. The two strings are different, and a fail would be generated in the log
C. The syntax is incorrect, so this would not compile
D. This will compile but the parameters are mixed up, and a fail would be recorded in the log. The correct syntax is: vpManual ("The rain in Spain", "The Rain in Spain", "manual1").performTest();

Ans: B

IBM RFT-000-842 Dumps - Four

Q1. Given the following code snippet:
OK().waitForExistence();
Assuming that no changes have been made to the Functional
Tester default playback settings, which two
statements will cause Functional Tester to wait for 60
seconds for the OK button to appear? (Choose two.)

A. setOption(IOptionName.MAXIMUM_FIND_OBJECT_TIME, 60.0)
B. setOption(IOptionName.MAXIMUM_WAIT_FOR_EXISTENCE, 60.0)
C. setOption(IOptionName.TIME_MULTIPLIER, .5)
D. setOption(IOptionName.TIME_MULTIPLIER, 2.0)

Ans: B, C

Q2. Given the following:
A script named BuyCD has been created. A Helper Superclass
named HelperSuper1 has been created. A Helper Superclass
named HelperSuper2 has been created.
Which of the following are valid Functional Tester script
class inheritance hierarchies? (Choose two.)
Note: inherits from is expressed by the symbol ?

A. BuyCD -> BuyCDHelper -> RationalTestScript
B. BuyCD -> HelperSuper1 -> RationalTestScript
C. Helper1 -> RationalTestScript -> BuyCD
D. BuyCD -> HelperSuper1 -> HelperSuper2 -> RationalTestScript

Ans: A, D

Q3. Given the following code snippet in which Customers()
represents an HTML table from which
data needs to be extracted:
Customers().getTestData("contents");
What data type is returned by getTestData("contents")?

A. ITestDataTable
B. String
C. TableData
D. TestData

Ans: A

Q4. Which statement is true about Functional Tester scripts and datapools?

A. All scripts are associated with either a private or shared datapool, and a script cannot exist without a datapool
B. There are three types of datapools: private, shared and global
C. The datapool associated with a script cannot be changed once the association has been made
D. A datapool can be created while in recording mode

Ans: D

Q5. Which Java method advances the datapool cursor to the next row in the datapool?

A. dpMoveNext()
B. dpMoveCursor()
C. dpNext()
D. dpNextRow()

Ans: C

Q6. Which three statements are true about HelperSuper classes? (Choose three.)

A. Scripts can share Helper Superclasses.
B. Scripts cannot share Helper Superclasses.
C. Scripts can inherit from multiple Helper Superclasses.
D. Scripts can inherit from a Helper Superclass that resides in a .jar file

Ans: A, C, D

Q7. A script needs to perform an action on an object. One of the recognition properties of the object is the .url property. The URL is dynamic. At recording time, the URL was http://www-3.ibm.com. However, it can vary every time the script is played back. In particular, the portion of the .url property that is subject to change is the digits that appears after the dash. Which regular expression will match the value of the .url property regardless of the numer of digits between the - and the .? Note: The regular expression should NOT match the .url property if no digits appear after the dash (as in www-.ibm.com).

A. www-*\.ibm\.com
B. www-{num}?\.ibm\.com
C. www-{num}+\.ibm\.com
D. www-[0-9]*\.ibm\.com
E. www-[0-9]\.ibm\.com

Ans: C

Q8. What is the effect the Clear State on Close setting in the Object Map interface when you exit the object map?

A. All new test objects will be accepted by removing the "New" designation from the test object.
B. All new test objects will be accepted by changing the New designation to Accepted for the test object.
C. All unused test objects will be removed from the map.
D. All test objects that have not been accepted will continue to have a designation of "New."

Ans: A

Q9. Click the Exhibit Button A script needs to perform an action on an HTML List object. Figure 6.1 shows the recognition properties of the list object. Figure 6.2 shows the recognition properties of the HTML document. What will be the score of the found test object at runtime if the .text and .id recognition properties in the list object are different and the .url property of the HTML Document object? 
A. 1000
B. 1400
C. 10000

D. 14000

Ans: D

CISCO CCNA Semester Wise Dumps - Six

Q1. Which IPv4 subnetted addresses represent valid host addresses? (Choose three.)
• 172.16.4.127 /26
• 172.16.4.155 /26
• 172.16.4.193 /26

• 172.16.4.95 /27
• 172.16.4.159 /27
• 172.16.4.207 /27
Q2. Which statements are true regarding IP addressing? (Choose two.)
• NAT translates public addresses to private addresses destined for the Internet.
Only one company is allowed to use a specific private network address space.
• Private addresses are blocked from public Internet by router.
• Network 172.32.0.0 is part of the private address space.
• IP address 127.0.0.1 can be used for a host to direct traffic to itself.
Q3. Which process do routers use to determine the subnet network address based upon a given IP address and subnet mask?
• binary adding
• hexadecimal anding
• binary division
• binary multiplication
• binary ANDing
Q4. Refer to the exhibit. Host A is connected to the LAN, but it cannot get access to any resources on the Internet. The configuration of the host is shown in the exhibit. What could be the cause of the problem?
• The host subnet mask is incorrect.
• The default gateway is a network address.
• The default gateway is a broadcast address.
• The default gateway is on a different subnet from the host.

Q5. What subnet mask would a network administrator assign to a network address of 172.30.1.0 if it were possible to have up to 254 hosts?
• 255.255.0.0
• 255.255.255.0
• 255.255.254.0
• 255.255.248.0
Q6. Which three IP addresses are private? (Choose three.)
• 172.168.33.1
• 10.35.66.70
• 192.168.99.5
• 172.18.88.90

• 192.33.55.89
• 172.35.16.5

Q7. Given the IP address and subnet mask of 172.16.134.64 255.255.255.224, which of the following would describe this address?
• This is a useable host address.
• This is a broadcast address.
• This is a network address.
• This is not a valid address.

Q8. A router interface has been assigned an IP address of 172.16.192.166 with a mask of 255.255.255.248. To which subnet does the IP address belong?
• 172.16.0.0
• 172.16.192.0
• 172.16.192.128
• 172.16.192.160
• 172.16.192.168
• 172.16.192.176

Q9. Refer to the exhibit. The network administrator has assigned the internetwork of LBMISS an address range of 192.168.10.0. This address range has been subnetted using a /29 mask. In order to accommodate a new building, the technician has decided to use the fifth subnet for configuring the new network (subnet zero is the first subnet). By company policies, the router interface is always assigned the first usable host address and the workgroup server is given the last usable host address. Which configuration should be entered into the workgroup server's properties to allow connectivity to the network?
• IP address: 192.168.10.38 subnet mask: 255.255.255.240 default gateway: 192.168.10.39
• IP address: 192.168.10.38 subnet mask: 255.255.255.240 default gateway: 192.168.10.33
• IP address: 192.168.10.38 subnet mask: 255.255.255.248 default gateway: 192.168.10.33
• IP address: 192.168.10.39 subnet mask: 255.255.255.248 default gateway: 192.168.10.31

• IP address: 192.168.10.254 subnet mask: 255.255.255.0 default gateway: 192.168.10.1
Q10. Which of the following network devices are recommended to be assigned static IP addresses? (Choose three.)
• LAN workstations
• servers
• network printers
• routers

• remote workstations• laptops

Q11. hich of the following are features of IPv6? (Choose three.)
• larger address space
• faster routing protocols
• data types and classes of service
• authentication and encryption

• improved host naming conventions
• same addressing scheme as IPv4

Q12. What is the primary reason for development of IPv6?
• security
• header format simplification
• expanded addressing capabilities
• addressing simplification

Q13. What two things will happen if a router receives an ICMP packet which has a TTL value of 1 and the destination host is several hops away? (Choose two.)
• The router will discard the packet.
• The router will decrement the TTL value and forward the packet to the next router on the path to the destination host.
• The router will send a time exceeded message to the source host.
• The router will increment the TTL value and forward the packet to the next router on the path to the destination host.
• The router will send an ICMP Redirect Message to the source host.
Q14. Refer to the exhibit. Why would the response shown be displayed after issuing the command ping 127.0.0.1 on a PC?

• The IP settings are not properly configured on the host.
• Internet Protocol is not properly installed on the host.
• There is a problem at the physical or data link layer.

• The default gateway device is not operating.
• A router on the path to the destination host has gone down.
Q15. How many bits make up an IPv4 address?
• 128
• 64
• 48
• 32

Q16. Refer to the exhibit. A network administrator discovers that host A is having trouble with Internet connectivity, but the server farm has full connectivity. In addition, host A has full connectivity to the server farm. What is a possible cause of this problem?
• The router has an incorrect gateway.
• Host A has an overlapping network address.
• Host A has an incorrect default gateway configured.
• Host A has an incorrect subnet mask.
• NAT is required for the host A network.
Q17. What three facts are true about the network portion of an IPv4 address? (Choose three.)
• identifies an individual device

• is identical for all hosts in a broadcast domain
• is altered as packet is forwarded

• varies in length
• is used to forward packets

• uses flat addressing

Q18. What is a group of hosts called that have identical bit patterns in the high order bits of their addresses?
• an internet
• a network
• an octet
• a radix
• Bottom of Form
• Top of Form
• Bottom of Form

Q19. What is the network address of the host 172.25.67.99 /23 in binary?
• 10101100. 00011001.01000011.00000000
• 10101100. 00011001.01000011.11111111
• 10101100. 00011001.01000010.00000000
• 10101100. 00011001.01000010.01100011
• 10101100. 00010001.01000011. 01100010
• 10101100. 00011001.00000000.00000000

Q20. Refer to the exhibit. A network administrator has to develop an IP addressing scheme that uses the 192.168.1.0 /24 address space. The network that contains the serial link has already been addressed out of a separate range. Each network will be allocated the same number of host addresses. Which network mask will be appropriate to address the remaining networks?
• 255.255.255.248
• 255.255.255.224
• 255.255.255.192
• 255.255.255.240
• 255.255.255.128
• 255.255.255.252

iVTech Pageviews