<?xml version="1.0" encoding="utf-8"?>
<ManualTopic ID="/baanerp/tl/onlinemanual/000010" xml:lang="en">
	<Header>
		<Title xmlns:HTML="http://www.w3.org/TR/REC-html40">How to test protected methods for Infor ERP LN </Title>
		<Keyword ContextSensitive="No"><Level1>Business Object Layer (BOL)</Level1>
		</Keyword>
		<Keyword ContextSensitive="No"><Level1>
                                 Infor ERP LN Development Tools
                              </Level1>
		</Keyword>
	</Header>
	<AimSection><Paragraph class="Default">This topic describes how you can test the protected layer of the <Link href="/baanerp/tt/glossary/glossary#100260" role="glossary">BOL</Link> software before you expose the layer to the outside world.</Paragraph>
	</AimSection>
	<GeneralSection><SectionTitle>Introduction</SectionTitle>
		<Paragraph class="Default">Using the <Link href="/baanerp/tt/glossary/glossary#100260" role="glossary">Business Object Layer (BOL)</Link>, ERP LN is open towards other ERP components and other external software. Before you expose the BOL software to the outside world, you must test the code to assure quality. One way to test this code is to write test code that calls the methods. This process, however, is cumbersome and time consuming. Therefore, a tool has been developed that will assist the engineer when performing this task.</Paragraph>
		<Paragraph class="Default">The test utility enables the ERP software engineer to test a protected BOL method by specifying the <Link href="/baanerp/tt/glossary/glossary#100032" role="glossary">Business Object</Link> and method name. The tool analyzes the <Link href="/baanerp/tt/glossary/glossary#100204" role="glossary">BOR</Link> and asks for the value of the input parameters. If you click <GUIRef href="" role="manual">Test</GUIRef>, the method will be executed and the output parameters appear on the screen.</Paragraph>
	</GeneralSection>
	<GeneralSection><SectionTitle>Procedure</SectionTitle>
		<ProcedureList><ListIntro>To test a protected method, take the following steps:</ListIntro>
			<ListItem>Start the BOL Test Tool _ Protected Layer (tlbct2210m000) session. To start this session, on the <GUIRef href="" role="manual">Tools</GUIRef> menu, point to <GUIRef href="" role="manual">Application Development</GUIRef> and click <GUIRef href="" role="manual">Business Object Modeling</GUIRef>.</ListItem>
			<ListItem>Enter the Business Object and method name you want to test in the BOL Test Tool - Launcher. After you click <GUIRef href="" role="manual">Launch</GUIRef>, the actual test program is generated and activated.</ListItem>
			<ListItem>Define the input arguments to be used in the BOL Test Tool – Tester part one. Before you enter the actual values of the input arguments, you must specify the arguments that will be sent to the protected layer.</ListItem>
			<ListItem>Enter the input arguments values in the BOL Test Tool – Tester part two. After you click <GUIRef href="" role="manual">Test</GUIRef>, the method will be executed and the result appears on the screen automatically.</ListItem>
			<ListItem>View the result of the method execution in the BOL Test Tool – Tester part three, which shows the output argument values or the return value and error message.</ListItem>
		</ProcedureList>
		<Paragraph class="Default">For details on these steps, refer to the <Link href="#launcher" role="internal">BOL Test Tool - Launcher</Link> and <Link href="#tester" role="internal">BOL Test Tool – Tester</Link>.</Paragraph>
	</GeneralSection>
	<GeneralSection ID="launcher"><SectionTitle>BOL Test Tool - Launcher</SectionTitle>
		<Paragraph class="Default">For details on the BOL Test Tool - Launcher, click the following link: <Link href="/baanerp/tl/bct/tlbct2210m000" role="session">BOL Test Tool - Protected Layer (tlbct2210m000)</Link>
		</Paragraph>
	</GeneralSection>
	<GeneralSection ID="tester"><SectionTitle>BOL Test Tool – Tester</SectionTitle>
		<Paragraph class="Default">Via the BOL Test Tool Launcher (BOL Test Tool - Protected Layer (tlbct2210m000) session) you have specified which method from which Business Object to test. Based on this information, a specific test program performs the actual test. Three temporary sessions (BOL Test Tool – Tester parts one through three) appear, in which you can specify input arguments and their values and view the results.</Paragraph>
		<List><ListIntro>The screens of these sessions have the following structure:</ListIntro>
			<ListItem>Title bar that contains information about the session, object, and method</ListItem>
			<ListItem>Input / output arguments (output: Read-only)</ListItem>
			<ListItem>Return value and (DAL) error message</ListItem>
		</List>
		<Figure space-and-orientation="indented-estimated"><FigIntro>The following figure shows an example of the first temporary session:</FigIntro>
			<HTML:IMG height="100" width="557" SRC="../images/nt_screen_000010a.gif" path="/enterpriseserver/tools/tl/onlinemanual" btb-count="1" btb-count2="1" btb-image-name="nt_screen_000010a.gif" btb-source-path="C:\SVN\docnl\Technology\EnterpriseServer~8.5\EnterpriseServer" btb-image-path="/enterpriseserver/tools/tl/images/nt_screen_000010a.gif" ID="IDAGUBAC" alt="[...]" xmlns:HTML="http://www.w3.org/TR/REC-html40"/><FigCaption>BOL Test Tool – Tester part one</FigCaption>
		</Figure>
		<Paragraph class="Default">Define the input arguments to be used. Click <GUIRef href="" role="manual">Continue</GUIRef> to go to the next screen.</Paragraph>
		<Figure space-and-orientation="indented-estimated"><FigIntro>The following figure shows an example of the second temporary session:</FigIntro>
			<HTML:IMG height="96" width="574" SRC="../images/nt_screen_000010b.gif" path="/enterpriseserver/tools/tl/onlinemanual" btb-count="1" btb-count2="1" btb-image-name="nt_screen_000010b.gif" btb-source-path="C:\SVN\docnl\Technology\EnterpriseServer~8.5\EnterpriseServer" btb-image-path="/enterpriseserver/tools/tl/images/nt_screen_000010b.gif" ID="IDAPUBAC" alt="[...]" xmlns:HTML="http://www.w3.org/TR/REC-html40"/><FigCaption>BOL Test Tool – Tester part two</FigCaption>
		</Figure>
		<Paragraph class="Default">Enter the input arguments values.</Paragraph>
		<Paragraph class="Default">You only have to enter the input parameters values and click <GUIRef href="" role="manual">Test</GUIRef> to run the method and see the result of the output arguments, return value, and error message.</Paragraph>
		<Figure space-and-orientation="indented-estimated"><FigIntro>The following figure shows an example of the third temporary session:</FigIntro>
			<HTML:IMG height="258" width="657" SRC="../images/nt_screen_000010c.gif" path="/enterpriseserver/tools/tl/onlinemanual" btb-count="1" btb-count2="1" btb-image-name="nt_screen_000010c.gif" btb-source-path="C:\SVN\docnl\Technology\EnterpriseServer~8.5\EnterpriseServer" btb-image-path="/enterpriseserver/tools/tl/images/nt_screen_000010c.gif" ID="IDAYUBAC" alt="[...]" xmlns:HTML="http://www.w3.org/TR/REC-html40"/><FigCaption>BOL Test Tool – Tester part three</FigCaption>
		</Figure>
		<Paragraph class="Default">Click <GUIRef href="" role="manual">Continue</GUIRef> to go back to the first screen.</Paragraph>
		<Note><SectionTitle>
                                 Note
                              </SectionTitle>
			<Paragraph class="Default">Each time you click <GUIRef href="" role="manual">Cancel</GUIRef> (or ESC) followed by <GUIRef href="" role="manual">Launch</GUIRef> again, a complete new test program is generated. For this reason, use <GUIRef href="" role="manual">Continue</GUIRef> whenever possible to reuse the current test object.</Paragraph>
		</Note>
	</GeneralSection>
	<GeneralSection ID="supportedfeatures"><SectionTitle>Supported features</SectionTitle>
		<List><ListItem>Mandatory fields are marked with an asterisk (*).</ListItem>
			<ListItem>Type information is linked to fields ([long], [double], [string], and so on).</ListItem>
			<ListItem>In case of an item field (argument linked to the <GUIRef href="" role="manual">tcitem</GUIRef> domain), you can zoom to the Items - General (tcibd0501m000)session. To enter a field with a blank item segment, you MUST use this zoom session to have a workaround for a known tools issue.</ListItem>
			<ListItem>Transactions are supported. If the return value of the method is not zero (‘0’) the transaction is stopped; in all other cases, a commit is made. If a retry must be made, this will be reported by means of a message.</ListItem>
			<ListItem>Text fields appear in a window of five lines of 60 characters in length (only as output fields; so not as input field). The reason for this is because, in Infor ERP LN, you must work with text numbers.</ListItem>
			<ListItem>If you press ESC or click <GUIRef href="" role="manual">Cancel</GUIRef> in the BOL Test Tool – Tester, you immediately return to the BOL Test Tool – Launcher.</ListItem>
		</List>
	</GeneralSection>
	<GeneralSection ID="companyhandling"><SectionTitle>Company handling</SectionTitle>
		<Paragraph class="Default">The tool must deal with various data sets ( <Link href="/baanerp/tc/glossary/glossary#Company.tc" role="glossary">companies</Link> ) and can cause some confusion when you look at the bottom-right corner of the screen:</Paragraph>
		<Figure space-and-orientation="indented-estimated"><HTML:IMG height="18" width="153" SRC="../images/nt_screen_000010d.gif" path="/enterpriseserver/tools/tl/onlinemanual" btb-count="1" btb-count2="1" btb-image-name="nt_screen_000010d.gif" btb-source-path="C:\SVN\docnl\Technology\EnterpriseServer~8.5\EnterpriseServer" btb-image-path="/enterpriseserver/tools/tl/images/nt_screen_000010d.gif" ID="IDABVBAC" alt="[...]" xmlns:HTML="http://www.w3.org/TR/REC-html40"/></Figure>
		<List><ListIntro>The following datasets are used:</ListIntro>
			<ListItem>Company 000 (Tools company for the tt package). The BOL Test Tool - Launcher (BOL Test Tool - Protected Layer (tlbct2210m000) session) by definition, uses company 000. For the script information, the Function Tree database from the tl package is used.</ListItem>
			<ListItem>Your current company. The generated test program uses this company (BOL Test Tool - Tester) to test the Business Object: for example, when you test the Create method of the Address business object, a new address record is inserted in your current company.</ListItem>
			<ListItem>The company that contains the test related data. This company is specified in the Setup Tools-Addon (tlcom0200m000) session.</ListItem>
		</List>
	</GeneralSection>
	<GeneralSection ID="developersmode"><SectionTitle>Developers mode</SectionTitle>
		<Paragraph class="Default">You can start the test tool in developers mode to control the test script that is run. In developers mode, the test tool provides various extra options, for example, to monitor the program flow, and to edit, compile and run the generated test script manually. Refer to <Link href="/baanerp/tl/bct/tlbct2210m000" role="session">BOL Test Tool - Protected Layer (tlbct2210m000)</Link> for details.</Paragraph>
		<Paragraph class="Default">To start the test tool in developers mode, you must add the following line to the <GUIRef href="" role="manual">Command</GUIRef> field of your BW Configuration file: <Code>-- -set TMODE=1</Code>. Note that you cannot add this line if you use the Infor WebTop interface.</Paragraph>
		<GeneralSection><SectionTitle>Intermediate files</SectionTitle>
			<Paragraph class="Default">The following files are created on the $BSE_TMP directory:</Paragraph>
			<TABLE border="1" borderstyle="default" space-and-orientation="indented-estimated"><THEAD><TR><TD rowspan="1" colspan="1">File</TD>
						<TD rowspan="1" colspan="1">Description</TD>
					</TR>
				</THEAD>
				<TBODY><TR><TD rowspan="1" colspan="1">tmpddddddddd</TD>
						<TD rowspan="1" colspan="1">File generated by the bshell via the function creat.tmp.file$( bse.tmp.dir$() )Example: tmp057080500</TD>
					</TR>
					<TR><TD rowspan="1" colspan="1">tmpddddddddd.obj</TD>
						<TD rowspan="1" colspan="1">Object file generated by the compiler</TD>
					</TR>
					<TR><TD rowspan="1" colspan="1">tmpddddddddd.err</TD>
						<TD rowspan="1" colspan="1">Error file generated by compiler in case of compilation errors or warnings</TD>
					</TR>
				</TBODY>
			</TABLE>
		</GeneralSection>
	</GeneralSection>
	<GeneralSection><SectionTitle>Program Flow</SectionTitle>
		<Figure space-and-orientation="indented-estimated"><HTML:IMG height="726" width="530" SRC="../images/tr_flow_000010.gif" path="/enterpriseserver/tools/tl/onlinemanual" btb-count="1" btb-count2="1" btb-image-name="tr_flow_000010.gif" btb-source-path="C:\SVN\docnl\Technology\EnterpriseServer~8.5\EnterpriseServer" btb-image-path="/enterpriseserver/tools/tl/images/tr_flow_000010.gif" ID="IDA4MCAC" alt="[...]" xmlns:HTML="http://www.w3.org/TR/REC-html40"/></Figure>
	</GeneralSection>
	<RelatedTopics><SectionTitle>Related topics</SectionTitle>
		<RelTopic><Link href="/baanerp/tl/onlinemanual/000020" role="manual">How to test public methods for Infor ERP LN</Link>
		</RelTopic>
		<RelTopic><Link href="/baanerp/tt/onlinemanual/100107" role="manual">To Model a Business Object</Link>
		</RelTopic>
	</RelatedTopics>
</ManualTopic>
