|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.student.contract.writer.XmlWriter org.kuali.student.contract.writer.JavaClassWriter org.kuali.student.mock.mojo.MockImplServiceWriter org.kuali.student.mock.mojo.ConformanceTestBaseCrudClassServiceWriter
public class ConformanceTestBaseCrudClassServiceWriter
This class will generate the base class that does CRUD tests as part of the Conformance Tests for services. The generated class will need to be extended (and abstract methods filled in) to be complete. This class is meant to be generated again and again, and developers should customize tests in the extended class by extending or overwriting methods of this class as needed.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.kuali.student.mock.mojo.MockImplServiceWriter |
---|
MockImplServiceWriter.MethodType |
Field Summary | |
---|---|
protected static String |
H1_COMMENT_CHAR
|
protected static int |
H1_COMMENT_MARK_LENGTH
|
static String |
ROOT_PACKAGE
|
Fields inherited from class org.kuali.student.mock.mojo.MockImplServiceWriter |
---|
finder, methods, model, servKey |
Constructor Summary | |
---|---|
ConformanceTestBaseCrudClassServiceWriter(ServiceContractModel model,
String directory,
String rootPackage,
String servKey,
List<ServiceMethod> methods,
boolean isR1)
|
|
ConformanceTestBaseCrudClassServiceWriter(ServiceContractModel model,
String directory,
String rootPackage,
String servKey,
List<ServiceMethod> methods,
boolean isR1,
String packageName,
String className)
|
Method Summary | |
---|---|
static String |
calcClassName(String servKey)
Given the service key (name), returns a calculated class name for the conformance tester. |
protected List<String> |
calcNamesOfDTOsWithCrudManagedByService()
Gets a list of all the DTO names that are part of this service. |
static String |
calcPackage(String servKey,
String rootPackage)
|
protected void |
doTestImportsAdd()
Does the importsAdd for all files required for testing |
static List<Service> |
filterServices(ServiceContractModel model,
ServicesFilter filter)
|
protected List<String> |
getDtoObjectNamesWithCrud()
|
void |
indentPrintDecoratedComment(String label)
Writes out a decorated comment. |
void |
indentPrintDecoratedComment(String label,
String decorChar,
int decorLength)
Writes out a decorated comment, with the decoration string passed in. |
protected boolean |
isServiceMethodTestedAsPartofCrudInBaseConformanceTest(ServiceMethod method)
Given a method type, returns true if this method is tested as part of CRUD operations tested by the base test conformance class. |
void |
write()
Write out the entire file |
void |
writeTestCreate(String dtoObjectName,
List<MessageStructure> messageStructures)
Write the 'test create' portion. |
void |
writeTestCrud(String dtoObjectName)
Write the CRUD test methods |
void |
writetestCrudXXX_setDTOFieldsForTestCreate(String dtoObjectName,
List<MessageStructure> messageStructures)
Writes the section to set fields specific to this dto for testCreate section. |
void |
writetestCrudXXX_setDTOFieldsForTestReadAfterUpdate(String dtoObjectName,
List<MessageStructure> messageStructures)
Writes the section to set fields specific to this dto for testReadAfterUpdate sections. |
void |
writetestCrudXXX_setDTOFieldsForTestUpdate(String dtoObjectName,
List<MessageStructure> messageStructures)
Writes the section to set fields specific to this dto for testUpdate sections. |
void |
writetestCrudXXX_testDTOFieldsForTestCreateUpdate(String dtoObjectName,
List<MessageStructure> messageStructures)
Writes the section to test fields specific to this dto for testCreate and testUpdate sections. |
void |
writetestCrudXXX_testDTOFieldsForTestReadAfterUpdate(String dtoObjectName,
List<MessageStructure> messageStructures)
Writes the section to test fields specific to this dto for testReadAfterUpdate sections. |
void |
writeTestDelete(String dtoObjectName,
List<MessageStructure> messageStructures)
Write the 'delete' portion. |
void |
writeTestReadAfterUpdate(String dtoObjectName,
List<MessageStructure> messageStructures)
Write the 'read after update' portion. |
void |
writeTestUpdate(String dtoObjectName,
List<MessageStructure> messageStructures)
Write the 'test update' portion. |
Methods inherited from class org.kuali.student.mock.mojo.MockImplServiceWriter |
---|
calcMethodType, calcObjectName, calcServiceInterfaceClassName, fixServKey, initLower |
Methods inherited from class org.kuali.student.contract.writer.JavaClassWriter |
---|
closeBrace, getBody, getClassName, getDirectory, getFileName, getPackageName, getRootDirectory, importsAdd, indentPrintWrappedComment, openBrace, setPackageName, writeHeader, writeImports, writeJavaClassAndImportsOutToFile |
Methods inherited from class org.kuali.student.contract.writer.XmlWriter |
---|
decrementIndent, escapeXML, getIndent, getOut, incrementIndent, indent, indent, indentPrint, indentPrintln, print, println, setIndent, setOut, writeAttribute, writeComment, writeCommentBox, writeTag, writeTag |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String ROOT_PACKAGE
protected static final String H1_COMMENT_CHAR
protected static final int H1_COMMENT_MARK_LENGTH
Constructor Detail |
---|
public ConformanceTestBaseCrudClassServiceWriter(ServiceContractModel model, String directory, String rootPackage, String servKey, List<ServiceMethod> methods, boolean isR1)
public ConformanceTestBaseCrudClassServiceWriter(ServiceContractModel model, String directory, String rootPackage, String servKey, List<ServiceMethod> methods, boolean isR1, String packageName, String className)
Method Detail |
---|
protected List<String> getDtoObjectNamesWithCrud()
public static String calcPackage(String servKey, String rootPackage)
public static String calcClassName(String servKey)
public static List<Service> filterServices(ServiceContractModel model, ServicesFilter filter)
public void write()
write
in class MockImplServiceWriter
public void writeTestCrud(String dtoObjectName)
public void writeTestCreate(String dtoObjectName, List<MessageStructure> messageStructures)
public void writeTestUpdate(String dtoObjectName, List<MessageStructure> messageStructures)
public void writeTestReadAfterUpdate(String dtoObjectName, List<MessageStructure> messageStructures)
public void writeTestDelete(String dtoObjectName, List<MessageStructure> messageStructures)
public void indentPrintDecoratedComment(String label)
public void indentPrintDecoratedComment(String label, String decorChar, int decorLength)
public void writetestCrudXXX_setDTOFieldsForTestCreate(String dtoObjectName, List<MessageStructure> messageStructures)
public void writetestCrudXXX_testDTOFieldsForTestCreateUpdate(String dtoObjectName, List<MessageStructure> messageStructures)
public void writetestCrudXXX_setDTOFieldsForTestUpdate(String dtoObjectName, List<MessageStructure> messageStructures)
public void writetestCrudXXX_testDTOFieldsForTestReadAfterUpdate(String dtoObjectName, List<MessageStructure> messageStructures)
public void writetestCrudXXX_setDTOFieldsForTestReadAfterUpdate(String dtoObjectName, List<MessageStructure> messageStructures)
protected boolean isServiceMethodTestedAsPartofCrudInBaseConformanceTest(ServiceMethod method)
protected List<String> calcNamesOfDTOsWithCrudManagedByService()
protected void doTestImportsAdd()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |