HadoopHerriot test framework _ Overview

Source: Internet
Author: User
Herriot testing framework is a new testing framework for Hadoop-0.21.0 and later versions. It is mainly used to simulate a real large-scale distributed system as much as possible, and to implement automated testing for the system. Similar to the previous Hadoop testing framework MiniDFSCluster, Herriot also adopted the JUnit framework. In addition, Herriot introduced the cross-section Herriot testing framework, which is a new testing framework for Hadoop-0.21.0 and later versions, it is mainly used to simulate a real large-scale distributed system as much as possible and implement automated testing for the system. Similar to the previous Hadoop testing framework MiniDFSCluster, Herriot also adopted the JUnit framework. In addition, Herriot also introduced the Aspect-oriented programming (AOP) technology-AspectJ to implement code injection and error injection, enrich the test content.

Uses the Herriot framework for Hadoop ClusterIn typical scenarios, we can see that, unlike earlier MiniDFSCluster testing frameworks, each node (NameNode, JobTracker, DataNode, and TaskTracker) in the Herriot framework is in a separate JVM process, this is consistent with the real Hadoop cluster. the test machine uses the local Herriot package to remotely call and inject Herriot code into the target node.

To test the Java system, we need to inject some test-related code into the tested Java system. There are usually three methods: 1. directly add the test code to the code, compile the code into a class bytecode. This method is relatively simple, but the test code is contaminated with the original code and may pose a security risk. 2. After the code is compiled into a class bytecode, add a test method by modifying the class bytecode, that is, generate a new class file (usually called ins ).TrUmentEdClass), this implementation is more complex than the first method, but does not pollute the original code, but the bytecode used for testing is not the same as the class bytecode generated by the original code; 3. Add the test function by modifying the JVM. This method is the most complex, but does not affect the code and bytecode. The AOP technology used by Herriot is the second type, namely, testing function injection by modifying bytecode.

[Content navigation]
Page 1: Overview Page 1: Source Code Analysis
Page 1: Demo instance

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.