$darkmode
DENOPTIM
denoptim.graph.TemplateTest Class Reference

Unit test for DENOPTIMTemplate. More...

Collaboration diagram for denoptim.graph.TemplateTest:
[legend]

Public Member Functions

void testClone () throws Exception
 
void testNestedTemplateCloning ()
 
void testGetAttachmentPoints_returnsAPsWithTemplateAsOwner () throws DENOPTIMException
 
void testGetAttachmentPoints_returnsCorrectNumberOfAPs () throws DENOPTIMException
 
void testSetInnerGraph_throws_on_graph_incompatible_w_requiredAPs () throws DENOPTIMException
 
void testAddAP_after_setInnerGraph_throwsException ()
 
void testGetIAtomContainer () throws Exception
 
void testGetIAtomContainer_DeepVertex () throws Exception
 

Static Public Member Functions

static Template getTestAmideTemplate () throws DENOPTIMException
 Builds a template object meant for tests. More...
 

Package Attributes

final long SEED = 13
 
Random rng = new Random(SEED)
 
File tempDir
 

Static Package Attributes

static IChemObjectBuilder chemBuilder = DefaultChemObjectBuilder.getInstance()
 

Private Member Functions

Template getNestedTemplate () throws DENOPTIMException
 Creating a template that contains another template with the following structure: |--------------------—| | |-----—| | | * - CH_2 - | * - OH | | | |-----—| | |--------------------—| The box containing the 'OH' represents the nested template and the outermost box represents the outermost template. More...
 
Vertex getOHFragment () throws DENOPTIMException
 
void testSameAPClass (Template t, DGraph innerGraph)
 
void testAtLeastSameNumberOfAPs (Template t, int expNumberOfAPs) throws DENOPTIMException
 
Template getTemplateDeepTest () throws DENOPTIMException
 

Static Private Member Functions

static Vertex getCH2Fragment () throws DENOPTIMException
 The coordinates hard coded in this method must not be changed because they are needed to reproduce results in testGetIAtomContainer(). More...
 
static Vertex getAmideFragment () throws DENOPTIMException
 The coordinates hard coded in this method must not be changed because they are needed to reproduce results in testGetIAtomContainer(). More...
 

Private Attributes

final String NL = System.getProperty("line.separator")
 
final String SEP = System.getProperty("file.separator")
 

Detailed Description

Unit test for DENOPTIMTemplate.

Definition at line 55 of file TemplateTest.java.

Member Function Documentation

◆ getAmideFragment()

static Vertex denoptim.graph.TemplateTest.getAmideFragment ( ) throws DENOPTIMException
staticprivate

The coordinates hard coded in this method must not be changed because they are needed to reproduce results in testGetIAtomContainer().

Returns
3D building block C(=O)N with three APs: one on C and two on N.
Exceptions
DENOPTIMException

Definition at line 238 of file TemplateTest.java.

References denoptim.graph.Fragment.addAP(), denoptim.graph.TemplateTest.chemBuilder, denoptim.graph.Vertex.BBType.FRAGMENT, denoptim.utils.GraphUtils.getUniqueVertexIndex(), and denoptim.graph.APClass.make().

Referenced by denoptim.graph.TemplateTest.getTestAmideTemplate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCH2Fragment()

static Vertex denoptim.graph.TemplateTest.getCH2Fragment ( ) throws DENOPTIMException
staticprivate

The coordinates hard coded in this method must not be changed because they are needed to reproduce results in testGetIAtomContainer().

Returns
3D building block CH2 with two APs both on C.
Exceptions
DENOPTIMException

Definition at line 196 of file TemplateTest.java.

References denoptim.graph.Fragment.addAP(), denoptim.graph.TemplateTest.chemBuilder, denoptim.graph.Vertex.BBType.FRAGMENT, denoptim.utils.GraphUtils.getUniqueVertexIndex(), and denoptim.graph.APClass.make().

Referenced by denoptim.graph.TemplateTest.getNestedTemplate(), denoptim.graph.TemplateTest.getTemplateDeepTest(), and denoptim.graph.TemplateTest.getTestAmideTemplate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getNestedTemplate()

Template denoptim.graph.TemplateTest.getNestedTemplate ( ) throws DENOPTIMException
private

Creating a template that contains another template with the following structure: |--------------------—| | |-----—| | | * - CH_2 - | * - OH | | | |-----—| | |--------------------—| The box containing the 'OH' represents the nested template and the outermost box represents the outermost template.

Definition at line 168 of file TemplateTest.java.

References denoptim.graph.DGraph.addVertex(), denoptim.graph.DGraph.appendVertexOnAP(), denoptim.graph.Vertex.BBType.FRAGMENT, denoptim.graph.Vertex.getAP(), denoptim.graph.TemplateTest.getCH2Fragment(), denoptim.graph.TemplateTest.getOHFragment(), and denoptim.graph.Template.setInnerGraph().

Referenced by denoptim.graph.TemplateTest.testNestedTemplateCloning().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getOHFragment()

Vertex denoptim.graph.TemplateTest.getOHFragment ( ) throws DENOPTIMException
private
Returns
0D (no 3D coords!) for OH
Exceptions
DENOPTIMException

Definition at line 283 of file TemplateTest.java.

References denoptim.graph.Fragment.addAP(), denoptim.graph.TemplateTest.chemBuilder, denoptim.graph.Vertex.BBType.FRAGMENT, denoptim.utils.GraphUtils.getUniqueVertexIndex(), denoptim.graph.APClass.make(), and denoptim.graph.TemplateTest.rng.

Referenced by denoptim.graph.TemplateTest.getNestedTemplate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTemplateDeepTest()

Template denoptim.graph.TemplateTest.getTemplateDeepTest ( ) throws DENOPTIMException
private

Definition at line 576 of file TemplateTest.java.

References denoptim.graph.DGraph.addVertex(), denoptim.graph.DGraph.appendVertexOnAP(), denoptim.graph.Vertex.getAP(), denoptim.graph.TemplateTest.getCH2Fragment(), denoptim.graph.TemplateTest.getTestAmideTemplate(), denoptim.graph.Template.setInnerGraph(), denoptim.graph.Vertex.setVertexId(), and denoptim.graph.Vertex.BBType.UNDEFINED.

Referenced by denoptim.graph.TemplateTest.testGetIAtomContainer_DeepVertex().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTestAmideTemplate()

static Template denoptim.graph.TemplateTest.getTestAmideTemplate ( ) throws DENOPTIMException
static

Builds a template object meant for tests.

The inner graph has the following structure;

                            -->AP
                           /
AP<--v7<--v5<--v3<--v1-->v9-->AP

Before calling this method from outside its class, you should call TemplateTest#setUp() to prepare the fragment space.

Returns
Exceptions
DENOPTIMException

Definition at line 456 of file TemplateTest.java.

References denoptim.graph.DGraph.addVertex(), denoptim.graph.DGraph.appendVertexOnAP(), denoptim.graph.TemplateTest.getAmideFragment(), denoptim.graph.Vertex.getAP(), denoptim.graph.TemplateTest.getCH2Fragment(), denoptim.graph.Template.setInnerGraph(), and denoptim.graph.Vertex.BBType.UNDEFINED.

Referenced by denoptim.graph.TemplateTest.getTemplateDeepTest(), denoptim.graph.TemplateTest.testGetIAtomContainer(), denoptim.io.DenoptimIOTest.testIOTemplate(), and denoptim.json.DENOPTIMgsonTest.testTemplateSerialization().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ testAddAP_after_setInnerGraph_throwsException()

void denoptim.graph.TemplateTest.testAddAP_after_setInnerGraph_throwsException ( )

Definition at line 431 of file TemplateTest.java.

References denoptim.graph.Template.addRequiredAP(), denoptim.graph.APClass.make(), denoptim.graph.Vertex.BBType.NONE, and denoptim.graph.Template.setInnerGraph().

Here is the call graph for this function:

◆ testAtLeastSameNumberOfAPs()

void denoptim.graph.TemplateTest.testAtLeastSameNumberOfAPs ( Template  t,
int  expNumberOfAPs 
) throws DENOPTIMException
private

Definition at line 415 of file TemplateTest.java.

References denoptim.graph.EmptyVertex.addAP(), and denoptim.graph.DGraph.addVertex().

Referenced by denoptim.graph.TemplateTest.testSetInnerGraph_throws_on_graph_incompatible_w_requiredAPs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ testClone()

◆ testGetAttachmentPoints_returnsAPsWithTemplateAsOwner()

void denoptim.graph.TemplateTest.testGetAttachmentPoints_returnsAPsWithTemplateAsOwner ( ) throws DENOPTIMException

Definition at line 314 of file TemplateTest.java.

References denoptim.graph.EmptyVertex.addAP(), denoptim.graph.DGraph.addVertex(), denoptim.graph.Vertex.getAttachmentPoints(), and denoptim.graph.Vertex.BBType.NONE.

Here is the call graph for this function:

◆ testGetAttachmentPoints_returnsCorrectNumberOfAPs()

void denoptim.graph.TemplateTest.testGetAttachmentPoints_returnsCorrectNumberOfAPs ( ) throws DENOPTIMException

Definition at line 335 of file TemplateTest.java.

References denoptim.graph.EmptyVertex.addAP(), denoptim.graph.DGraph.addVertex(), denoptim.graph.DGraph.appendVertexOnAP(), denoptim.graph.Vertex.getAP(), and denoptim.graph.Vertex.BBType.NONE.

Here is the call graph for this function:

◆ testGetIAtomContainer()

void denoptim.graph.TemplateTest.testGetIAtomContainer ( ) throws Exception

◆ testGetIAtomContainer_DeepVertex()

void denoptim.graph.TemplateTest.testGetIAtomContainer_DeepVertex ( ) throws Exception

◆ testNestedTemplateCloning()

void denoptim.graph.TemplateTest.testNestedTemplateCloning ( )

Definition at line 144 of file TemplateTest.java.

References denoptim.graph.Template.clone(), denoptim.graph.TemplateTest.getNestedTemplate(), and denoptim.graph.Template.sameAs().

Here is the call graph for this function:

◆ testSameAPClass()

void denoptim.graph.TemplateTest.testSameAPClass ( Template  t,
DGraph  innerGraph 
)
private

Definition at line 399 of file TemplateTest.java.

References denoptim.graph.Vertex.getAP(), denoptim.graph.AttachmentPoint.getAPClass(), denoptim.graph.DGraph.getVertexAtPosition(), denoptim.graph.AttachmentPoint.setAPClass(), and denoptim.graph.Template.setInnerGraph().

Referenced by denoptim.graph.TemplateTest.testSetInnerGraph_throws_on_graph_incompatible_w_requiredAPs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ testSetInnerGraph_throws_on_graph_incompatible_w_requiredAPs()

void denoptim.graph.TemplateTest.testSetInnerGraph_throws_on_graph_incompatible_w_requiredAPs ( ) throws DENOPTIMException

Definition at line 370 of file TemplateTest.java.

References denoptim.graph.EmptyVertex.addAP(), denoptim.graph.DGraph.addVertex(), denoptim.graph.APClass.make(), denoptim.graph.Vertex.BBType.NONE, denoptim.graph.TemplateTest.testAtLeastSameNumberOfAPs(), and denoptim.graph.TemplateTest.testSameAPClass().

Here is the call graph for this function:

Member Data Documentation

◆ chemBuilder

IChemObjectBuilder denoptim.graph.TemplateTest.chemBuilder = DefaultChemObjectBuilder.getInstance()
staticpackage

◆ NL

final String denoptim.graph.TemplateTest.NL = System.getProperty("line.separator")
private

◆ rng

Random denoptim.graph.TemplateTest.rng = new Random(SEED)
package

Definition at line 58 of file TemplateTest.java.

Referenced by denoptim.graph.TemplateTest.getOHFragment().

◆ SEED

final long denoptim.graph.TemplateTest.SEED = 13
package

Definition at line 57 of file TemplateTest.java.

◆ SEP

final String denoptim.graph.TemplateTest.SEP = System.getProperty("file.separator")
private

◆ tempDir

File denoptim.graph.TemplateTest.tempDir
package

The documentation for this class was generated from the following file: