Project

General

Profile

Task #6736

Story #6723: test v2 MN and CN buildouts

determine reuse design / strategy

Added by Rob Nahf over 9 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
Start date:
2015-01-06
Due date:
% Done:

100%

Estimated time:
0.00 h
Milestone:
None
Product Version:
*
Story Points:
Sprint:

Description

developed (with Andrei) CommonCallAdapter and ContextAwareAdapter to allow splitting out of test implementations into separate classes called by the JUnit test methods. CommonCallAdapter is a versionless wrapper that chooses the right NodeFactory for building either a v1.MNode, v2.MNode, v1.CNode, or v2.CNode based on parameters given to the constructor.

The design is to categorize methods into those in common between nodeType and version by API, and have interfaces for each: {API}TestDefinitions, MN{API}TestDefinitions, CN{API}TestDefinitions, V1{API}TestDefinitions, V2{API}TestDefinitions.

Also have implementation classes for each definition class that extend ContextAwareAdapter.

The JUnit IT classes implement the appropriate API test definition classes, and implement non-sharable test implementations.

For example:

CoreTestDefinitions, CoreTestImplementations
MNCoreTestDefinitions, MNCoreTestImplementations
CNCoreTestDefinitions, CNCoreTestImplementations
V1CoreTestDefinitions, V1CoreTestImplementations
V2CoreTestDefinitions, V2CoreTestImplementations

public class MNodeV1CoreIT implements CoreTestDefinitions, MNCoreTestDefinitions, V1CoreTestDefinitions extends ContextAwareTestCaseDataone {

 CoreTestDefinitions coreTests = new CoreTestImplementation(this); 
 MNCoreTestDefinitions mnCoreTests = new MNCoreTestImplementations(this);
 V1CoreTestDefinitions v1CoreTests = new V1CoreTestImplementations(this);


@Test  public void testPing() { coreTests.testPing("v1", getNodeUnderTest()); }

etc...

}

History

#1 Updated by Rob Nahf over 9 years ago

  • Description updated (diff)

#2 Updated by Rob Nahf over 9 years ago

  • Status changed from In Progress to In Review
  • Parent task changed from #6727 to #6723

#3 Updated by Rob Nahf over 9 years ago

  • Status changed from In Review to In Progress

#4 Updated by Rob Nahf over 9 years ago

Thorough authorization tests were already abstracted in version 1 of d1_integration (so we could test authorization against Query solr implementations, so special handling is needed for these classes. These tests abstract out which API method is used to test authorization decisions, so each method implementation doesn't have to be wrapped for version or node type.

In v1, the abstract class extends ContextAwareTestCaseDataone, and it might make sense to continue that, or make the concrete subclasses independent test cases.

#5 Updated by Rob Nahf about 9 years ago

  • Status changed from In Progress to Closed
  • translation missing: en.field_remaining_hours set to 0
  • % Done changed from 80 to 100

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 14.8 MB)