Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 170870 | Differences between
and this patch

Collapse All | Expand All

(-).settings/org.eclipse.core.resources.prefs (-1 / +2 lines)
Lines 1-6 Link Here
1
#Fri Feb 10 10:47:30 EST 2006
1
#Fri Apr 27 03:34:02 IST 2007
2
eclipse.preferences.version=1
2
eclipse.preferences.version=1
3
encoding//src/org/eclipse/hyades/logging/adapter/tests/TestSensorAndExtractorFilter.java=UTF-8
3
encoding//src/org/eclipse/hyades/logging/adapter/tests/TestSensorAndExtractorFilter.java=UTF-8
4
encoding//src/org/eclipse/hyades/logging/adapter/tests/Test_API_tests_Adapter.java=UTF-8
4
encoding//src/org/eclipse/hyades/logging/adapter/tests/Test_runtime_execution_tests.java=UTF-8
5
encoding//src/org/eclipse/hyades/logging/adapter/tests/Test_runtime_execution_tests.java=UTF-8
5
encoding//src/org/eclipse/hyades/logging/adapter/tests/Test_runtime_tests.java=UTF-8
6
encoding//src/org/eclipse/hyades/logging/adapter/tests/Test_runtime_tests.java=UTF-8
6
encoding//src/org/eclipse/hyades/logging/adapter/tests/Test_runtime_tests_CBEGeneration_childEDE.java=UTF-8
7
encoding//src/org/eclipse/hyades/logging/adapter/tests/Test_runtime_tests_CBEGeneration_childEDE.java=UTF-8
(-)META-INF/MANIFEST.MF (+2 lines)
Lines 6-9 Link Here
6
Bundle-Localization: plugin
6
Bundle-Localization: plugin
7
Require-Bundle: org.eclipse.tptp.monitoring.auto.tests.util,
7
Require-Bundle: org.eclipse.tptp.monitoring.auto.tests.util,
8
 org.eclipse.hyades.test.tools.core,
8
 org.eclipse.hyades.test.tools.core,
9
 org.eclipse.hyades.logging.adapter,
10
 org.eclipse.hyades.logging.parsers,
9
 org.junit
11
 org.junit
(-)src/org/eclipse/hyades/logging/adapter/tests/Test_API_tests_Adapter.java (+329 lines)
Added Link Here
1
package org.eclipse.hyades.logging.adapter.tests;
2
3
import junit.framework.Test;
4
5
import org.eclipse.hyades.logging.adapter.tests.utils.APITestJUtils;
6
import org.eclipse.hyades.test.common.junit.DefaultTestArbiter;
7
import org.eclipse.hyades.test.common.junit.HyadesTestCase;
8
import org.eclipse.hyades.test.common.junit.HyadesTestSuite;
9
import org.eclipse.tptp.monitoring.auto.tests.utils.PropertiesWrapper;
10
11
/**
12
 * Generated code for the test suite <b>Test_API_tests_Adapter</b> located at
13
 * <i>/org.eclipse.hyades.logging.adapter.tests/junit/apiTests/adapter/Test_API_tests_Adapter.testsuite</i>.
14
 */
15
public class Test_API_tests_Adapter extends HyadesTestCase {
16
	/**
17
	 * Constructor for Test_API_tests_Adapter.
18
	 * @param name
19
	 */
20
	public Test_API_tests_Adapter(String name) {
21
		super(name);
22
	}
23
24
	/**
25
	 * Returns the JUnit test suite that implements the <b>Test_API_tests_Adapter</b> definition.
26
	 */
27
	public static Test suite() {
28
		HyadesTestSuite test_API_tests_Adapter = new HyadesTestSuite(
29
				"Test_API_tests_Adapter");
30
		test_API_tests_Adapter.setArbiter(DefaultTestArbiter.INSTANCE).setId(
31
				"CB10CF0ADD6E7CCB0B13D6B0F44211DB");
32
		test_API_tests_Adapter.addTest(new Test_API_tests_Adapter(
33
				"testValidSetContextConfigPath").setId(
34
				"CB10CF0ADD6E7CCB09188670F44311DB").setTestInvocationId(
35
				"CB10CF0ADD6E7CCB7360EE00F44311DB"));
36
		test_API_tests_Adapter.addTest(new Test_API_tests_Adapter(
37
				"testInvalidPathSetContextConfigPath").setId(
38
				"CB10CF0ADD6E7CCB25D3B820F44311DB").setTestInvocationId(
39
				"CB10CF0ADD6E7CCB736819F0F44311DB"));
40
		test_API_tests_Adapter.addTest(new Test_API_tests_Adapter(
41
				"testInvalidAdapterSetContextConfigPath").setId(
42
				"CB10CF0ADD6E7CCB56A34B50F44311DB").setTestInvocationId(
43
				"CB10CF0ADD6E7CCB736A63E0F44311DB"));
44
		test_API_tests_Adapter.addTest(new Test_API_tests_Adapter(
45
				"testValidSetComponentConfigPath").setId(
46
				"CB10CF0ADD6E7CCB5DD83F30F44711DB").setTestInvocationId(
47
				"CB10CF0ADD6E7CCB9B549A70F44711DB"));
48
		test_API_tests_Adapter.addTest(new Test_API_tests_Adapter(
49
				"testInvalidPathSetComponentConfigPath").setId(
50
				"CB10CF0ADD6E7CCB7645E8B0F44711DB").setTestInvocationId(
51
				"CB10CF0ADD6E7CCB9B570B70F44711DB"));
52
		test_API_tests_Adapter.addTest(new Test_API_tests_Adapter(
53
				"testInvalidAdapterSetComponentConfigPath").setId(
54
				"CB10CF0ADD6E7CCB85B700E0F44711DB").setTestInvocationId(
55
				"CB10CF0ADD6E7CCB9B5BC660F44711DB"));
56
		test_API_tests_Adapter.addTest(new Test_API_tests_Adapter(
57
				"testValidDiffFileSetContextComponentConfigPathAPI").setId(
58
				"CB10CF0ADD6E7CCB3DFE6790F47711DB").setTestInvocationId(
59
				"CB10CF0ADD6E7CCB4E3EDDB0F47711DB"));
60
		test_API_tests_Adapter.addTest(new Test_API_tests_Adapter(
61
				"testSetLoggingLevelAPI").setId(
62
				"CB10CF0ADD6E7CCBE7726430F47B11DB").setTestInvocationId(
63
				"CB10CF0ADD6E7CCBF2A1B400F47B11DB"));
64
		test_API_tests_Adapter.addTest(new Test_API_tests_Adapter(
65
				"testGetLoggingLevelAPI").setId(
66
				"CB10CF0ADD6E7CCBAD89E8A0F47C11DB").setTestInvocationId(
67
				"CB10CF0ADD6E7CCBC470A400F47C11DB"));
68
		test_API_tests_Adapter.addTest(new Test_API_tests_Adapter(
69
				"testGetLoggingLevelAPIDefaultValue").setId(
70
				"CB10CF0ADD6E7CCBB71106B0F47C11DB").setTestInvocationId(
71
				"CB10CF0ADD6E7CCBC4731500F47C11DB"));
72
		test_API_tests_Adapter.addTest(new Test_API_tests_Adapter(
73
				"testValidGetConfigurationAPI").setId(
74
				"CB10CF0ADD6E7CCB3D024590F47D11DB").setTestInvocationId(
75
				"CB10CF0ADD6E7CCB461481C0F47D11DB"));
76
		test_API_tests_Adapter.addTest(new Test_API_tests_Adapter(
77
				"testInvalidGetConfigurationAPI").setId(
78
				"CB10CF0ADD6E7CCBC66838D0F47D11DB").setTestInvocationId(
79
				"CB10CF0ADD6E7CCBD08A3750F47D11DB"));
80
		test_API_tests_Adapter.addTest(new Test_API_tests_Adapter(
81
				"testInvalidNoPathGetConfigurationAPI").setId(
82
				"CB10CF0ADD6E7CCBDA9DDDF0F47D11DB").setTestInvocationId(
83
				"CB10CF0ADD6E7CCBE37E0DA0F47D11DB"));
84
		test_API_tests_Adapter.addTest(new Test_API_tests_Adapter(
85
				"testSuccessValidateAPI").setId(
86
				"CB10CF0ADD6E7CCBE7252730F47E11DB").setTestInvocationId(
87
				"CB10CF0ADD6E7CCB14CA0750F47F11DB"));
88
		test_API_tests_Adapter.addTest(new Test_API_tests_Adapter(
89
				"testFailedNoPathValidateAPI").setId(
90
				"CB10CF0ADD6E7CCBF5590470F47E11DB").setTestInvocationId(
91
				"CB10CF0ADD6E7CCB14CEC240F47F11DB"));
92
		test_API_tests_Adapter.addTest(new Test_API_tests_Adapter(
93
				"testFailedValidateAPI").setId(
94
				"CB10CF0ADD6E7CCBFEE26C70F47E11DB").setTestInvocationId(
95
				"CB10CF0ADD6E7CCB14D13340F47F11DB"));
96
		test_API_tests_Adapter.addTest(new Test_API_tests_Adapter(
97
				"testStartThreadDeamonModeAPI").setId(
98
				"CB10CF0ADD6E7CCBFACE9C70F47F11DB").setTestInvocationId(
99
				"CB10CF0ADD6E7CCB04EBE000F48011DB"));
100
		test_API_tests_Adapter.addTest(new Test_API_tests_Adapter(
101
				"testStartNonThreadModeAPI").setId(
102
				"CB10CF0ADD6E7CCB7A25A400F48011DB").setTestInvocationId(
103
				"CB10CF0ADD6E7CCB82744210F48011DB"));
104
		test_API_tests_Adapter.addTest(new Test_API_tests_Adapter(
105
				"testStartInvalidAdapterModeAPI").setId(
106
				"CB10CF0ADD6E7CCBCDB2B080F48111DB").setTestInvocationId(
107
				"CB10CF0ADD6E7CCBD7FD1E90F48111DB"));
108
		test_API_tests_Adapter.addTest(new Test_API_tests_Adapter(
109
				"testSetLogOutputterAPI").setId(
110
				"CB10CF0ADD6E7CCB9C99C2D0F48211DB").setTestInvocationId(
111
				"CB10CF0ADD6E7CCBA62574C0F48211DB"));
112
		test_API_tests_Adapter
113
				.addTest(new Test_API_tests_Adapter("testStopAPI")
114
						.setId("CB10CF0ADD6E7CCB2F785530F48311DB")
115
						.setTestInvocationId("CB10CF0ADD6E7CCB3FE3ABE0F48311DB"));
116
		test_API_tests_Adapter.addTest(new Test_API_tests_Adapter(
117
				"testHardStopAPI").setId("CB10CF0ADD6E7CCB35CB2340F48311DB")
118
				.setTestInvocationId("CB10CF0ADD6E7CCB3FE61CE0F48311DB"));
119
		test_API_tests_Adapter.addTest(new Test_API_tests_Adapter(
120
				"testGetStatusAPI").setId("CB10CF0ADD6E7CCBE2A5A040F48311DB")
121
				.setTestInvocationId("CB10CF0ADD6E7CCBE9912BE0F48311DB"));
122
		return test_API_tests_Adapter;
123
	}
124
125
	/**
126
	 * @see junit.framework.TestCase#setUp()
127
	 */
128
	protected void setUp() throws Exception {
129
		PropertiesWrapper.init("org.eclipse.hyades.logging.adapter.tests");
130
	}
131
132
	/**
133
	 * @see junit.framework.TestCase#tearDown()
134
	 */
135
	protected void tearDown() throws Exception {
136
	}
137
138
	/**
139
	 * testValidSetContextConfigPath
140
	 * @throws Exception
141
	 */
142
	public void testValidSetContextConfigPath() throws Exception 
143
	{
144
		APITestJUtils.testValidDiffFileSetContextComponentConfigPathAPI("GenericLogAdapter/config/APITests/Adapter/Valid.adapter","GenericLogAdapter/config/APITests/Adapter/Valid.adapter");
145
	}
146
147
	/**
148
	 * testInvalidPathSetContextConfigPath
149
	 * @throws Exception
150
	 */
151
	public void testInvalidPathSetContextConfigPath() throws Exception 
152
	{
153
		APITestJUtils.testInvalidSetContextConfigPathAPI("GenericLogAdapter/config/APITests/Adapter/Valid.adapter");
154
	}
155
156
	/**
157
	 * testInvalidAdapterSetContextConfigPath
158
	 * @throws Exception
159
	 */
160
	public void testInvalidAdapterSetContextConfigPath() throws Exception {
161
		APITestJUtils.testInvalidAdapterSetContextConfigPathAPI("GenericLogAdapter/config/APITests/Adapter/example.log", "GenericLogAdapter/config/APITests/Adapter/Valid.adapter");
162
	}
163
164
	/**
165
	 * testValidSetComponentConfigPath
166
	 * @throws Exception
167
	 */
168
	public void testValidSetComponentConfigPath() throws Exception 
169
	{
170
		APITestJUtils.testValidDiffFileSetContextComponentConfigPathAPI("GenericLogAdapter/config/APITests/Adapter/Valid.adapter","GenericLogAdapter/config/APITests/Adapter/Valid.adapter");
171
	}
172
173
	/**
174
	 * testInvalidPathSetComponentConfigPath
175
	 * @throws Exception
176
	 */
177
	public void testInvalidPathSetComponentConfigPath() throws Exception 
178
	{
179
		APITestJUtils.testInvalidSetComponentConfigPathAPI("GenericLogAdapter/config/APITests/Adapter/Valid.adapter");
180
	}
181
182
	/**
183
	 * testInvalidAdapterSetComponentConfigPath
184
	 * @throws Exception
185
	 */
186
	public void testInvalidAdapterSetComponentConfigPath() throws Exception 
187
	{
188
		APITestJUtils.testInvalidAdapterSetComponentConfigPathAPI("GenericLogAdapter/config/APITests/Adapter/example.log", "GenericLogAdapter/config/APITests/Adapter/Valid.adapter");
189
	}
190
191
	/**
192
	 * testValidDiffFileSetContextComponentConfigPathAPI
193
	 * @throws Exception
194
	 */
195
	public void testValidDiffFileSetContextComponentConfigPathAPI()
196
			throws Exception {
197
		APITestJUtils.testValidDiffFileSetContextComponentConfigPathAPI("GenericLogAdapter/config/APITests/Adapter/contextConfiguration.xml", "GenericLogAdapter/config/APITests/Adapter/componentConfiguration.xml");
198
	}
199
200
	/**
201
	 * testSetLoggingLevelAPI
202
	 * @throws Exception
203
	 */
204
	public void testSetLoggingLevelAPI() throws Exception 
205
	{
206
		APITestJUtils.testSetLoggingLevelAPI("GenericLogAdapter/config/APITests/Adapter/Valid.adapter");
207
	}
208
209
	/**
210
	 * testGetLoggingLevelAPI
211
	 * @throws Exception
212
	 */
213
	public void testGetLoggingLevelAPI() throws Exception {
214
		APITestJUtils.testGetLoggingLevelAPI("GenericLogAdapter/config/APITests/Adapter/Valid.adapter");
215
	}
216
217
	/**
218
	 * testGetLoggingLevelAPIDefaultValue
219
	 * @throws Exception
220
	 */
221
	public void testGetLoggingLevelAPIDefaultValue() throws Exception {
222
		APITestJUtils.testGetLoggingLevelAPIDefaultValue("GenericLogAdapter/config/APITests/Adapter/Valid.adapter");
223
	}
224
225
	/**
226
	 * testValidGetConfigurationAPI
227
	 * @throws Exception
228
	 */
229
	public void testValidGetConfigurationAPI() throws Exception {
230
		APITestJUtils.testValidGetConfigurationAPI("GenericLogAdapter/config/APITests/Adapter/Valid.adapter");
231
	}
232
233
	/**
234
	 * testInvalidGetConfigurationAPI
235
	 * @throws Exception
236
	 */
237
	public void testInvalidGetConfigurationAPI() throws Exception {
238
		APITestJUtils.testInvalidGetConfigurationAPI("GenericLogAdapter/config/APITests/Adapter/invalidConfiguration.adapter");
239
	}
240
241
	/**
242
	 * testInvalidNoPathGetConfigurationAPI
243
	 * @throws Exception
244
	 */
245
	public void testInvalidNoPathGetConfigurationAPI() throws Exception {
246
		APITestJUtils.testInvalidNoPathGetConfigurationAPI();
247
	}
248
249
	/**
250
	 * testSuccessValidateAPI
251
	 * @throws Exception
252
	 */
253
	public void testSuccessValidateAPI() throws Exception {
254
		APITestJUtils.testSuccessValidateAPI("GenericLogAdapter/config/APITests/Adapter/Valid.adapter");
255
	}
256
257
	/**
258
	 * testFailedNoPathValidateAPI
259
	 * @throws Exception
260
	 */
261
	public void testFailedNoPathValidateAPI() throws Exception {
262
		APITestJUtils.testFailedNoPathValidateAPI();
263
	}
264
265
	/**
266
	 * testFailedValidateAPI
267
	 * @throws Exception
268
	 */
269
	public void testFailedValidateAPI() throws Exception {
270
		APITestJUtils.testFailedValidateAPI("GenericLogAdapter/config/APITests/Adapter/example.log");
271
	}
272
273
	/**
274
	 * testStartThreadDeamonModeAPI
275
	 * @throws Exception
276
	 */
277
	public void testStartThreadDeamonModeAPI() throws Exception {
278
		APITestJUtils.testStartThreadDeamonModeAPI("GenericLogAdapter/config/APITests/Adapter/Valid.adapter");
279
	}
280
281
	/**
282
	 * testStartNonThreadModeAPI
283
	 * @throws Exception
284
	 */
285
	public void testStartNonThreadModeAPI() throws Exception {
286
		APITestJUtils.testStartNonThreadModeAPI("GenericLogAdapter/config/APITests/Adapter/Valid.adapter");
287
	}
288
289
	/**
290
	 * testStartInvalidAdapterModeAPI
291
	 * @throws Exception
292
	 */
293
	public void testStartInvalidAdapterModeAPI() throws Exception {
294
		APITestJUtils.testStartInvalidAdapterModeAPI();
295
	}
296
297
	/**
298
	 * testSetLogOutputterAPI
299
	 * @throws Exception
300
	 */
301
	public void testSetLogOutputterAPI() throws Exception {
302
		APITestJUtils.testSetLogOutputterAPI("GenericLogAdapter/config/APITests/Adapter/Valid.adapter");
303
	}
304
305
	/**
306
	 * testStopAPI
307
	 * @throws Exception
308
	 */
309
	public void testStopAPI() throws Exception {
310
		APITestJUtils.testStopAPI("GenericLogAdapter/config/APITests/Adapter/Valid.adapter");
311
	}
312
313
	/**
314
	 * testHardStopAPI
315
	 * @throws Exception
316
	 */
317
	public void testHardStopAPI() throws Exception {
318
		APITestJUtils.testHardStopAPI("GenericLogAdapter/config/APITests/Adapter/Valid.adapter");
319
	}
320
321
	/**
322
	 * testGetStatusAPI
323
	 * @throws Exception
324
	 */
325
	public void testGetStatusAPI() throws Exception {
326
		APITestJUtils.testGetStatusAPI("GenericLogAdapter/config/APITests/Adapter/Valid.adapter");
327
	}
328
329
}
(-)testFiles/GenericLogAdapter/config/APITests/Adapter/componentConfiguration.xml (+154 lines)
Added Link Here
1
<adapter:Adapter xmlns:adapter="http://www.eclipse.org/hyades/schema/Adapter.xsd" xmlns:cc="http://www.eclipse.org/hyades/schema/ComponentConfiguration.xsd" xmlns:ex="http://www.eclipse.org/hyades/schema/Extractor.xsd" xmlns:fmt="http://www.eclipse.org/hyades/schema/Formatter.xsd" xmlns:hga="http://www.eclipse.org/hyades/schema/Context.xsd" xmlns:op="http://www.eclipse.org/hyades/schema/Outputter.xsd" xmlns:parser="http://www.eclipse.org/hyades/schema/Parser.xsd" xmlns:pu="http://www.eclipse.org/hyades/schema/ProcessUnit.xsd" xmlns:sensor="http://www.eclipse.org/hyades/schema/Sensor.xsd">
2
  <cc:Configuration description="The component level configurations for this adapter" uniqueID="N35B6D900F8511D88000A31D7605087A">
3
    <cc:ContextInstance charset="" continuousOperation="true" description="Context Instance for the current component" isoCountryCode="US" isoLanguageCode="en" maximumIdleTime="50000" pauseInterval="10" uniqueID="N35B6D910F8511D88000A31D7605087A">
4
      <cc:Sensor description="A single file sensor" uniqueID="N3604F900F8511D88000A31D7605087A" confidenceBufferSize="512" fileFooterSize="0" maximumBlocking="10" type="SingleFileSensor">
5
        <pu:Property propertyName="directory" propertyValue="."/>
6
        <pu:Property propertyName="fileName" propertyValue="example.log"/>
7
        <sensor:SingleFileSensor directory="." fileName="example.log"/>
8
      </cc:Sensor>
9
      <ex:Extractor description="This extractor uses regular expression  patterns to identify record delimiters" uniqueID="N36299800F8511D88000A31D7605087A" containsLineBreaks="true" endPattern="$" includeEndPattern="false" includeStartPattern="true" lineBreakSymbol="" replaceLineBreaks="false" startPattern="^(\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3})|(\S+)"/>
10
      <cc:Parser separatorToken="\s+" uniqueID="N3650A800F8511D88000A31D7605087A">
11
        <parser:RuleElement index="N3650A810F8511D88000A31D7605087A" name="CommonBaseEvent">
12
          <parser:RuleElement index="N8CA7C54002A11D88000C6FD28070181" name="sourceComponentId">
13
            <parser:RuleAttribute defaultValue="Apache HTTP Server" index="ND66C0C1002A11D88000C6FD28070181" name="component" usePreviousMatchSubstitutionAsDefault="false"/>
14
            <parser:RuleAttribute defaultValue="Unknown" index="N77CD869002A11D88000C6FD28070181" name="subComponent" usePreviousMatchSubstitutionAsDefault="false"/>
15
            <parser:RuleAttribute defaultValue="ProductName" index="N12069D2002A11D88000C6FD28070181" name="componentIdType" usePreviousMatchSubstitutionAsDefault="false"/>
16
            <parser:RuleAttribute index="N3AB0CD6010F11D88000873B061CB0B3" name="location" usePreviousMatchSubstitutionAsDefault="false">
17
              <SubstitutionRule substitute="" useBuiltInFunction="true"/>
18
            </parser:RuleAttribute>
19
            <parser:RuleAttribute index="NCD2CCD7010F11D88000873B061CB0B3" name="locationType" usePreviousMatchSubstitutionAsDefault="false">
20
              <SubstitutionRule substitute="" useBuiltInFunction="true"/>
21
            </parser:RuleAttribute>
22
            <parser:RuleAttribute defaultValue="HTTPServer" index="NDE661030DAB11D88000930FA6625271" name="componentType" usePreviousMatchSubstitutionAsDefault="false"/>
23
          </parser:RuleElement>
24
          <parser:RuleElement index="N8273E56002C11D88000C6FD28070181" isChildChoice="true" name="situation">
25
            <parser:RuleElement index="NF8AFFE9002F11D88000C6FD28070181" name="RequestSituation">
26
              <parser:RuleAttribute index="N2815562002F11D88000C6FD28070181" isRequiredByParent="true" name="successDisposition" usePreviousMatchSubstitutionAsDefault="false">
27
                <SubstitutionRule match="(2\d{2}|3\d{2}|1\d{2})" positions="8" substitute="SUCCESSFUL"/>
28
                <SubstitutionRule match="(2\d{2}|3\d{2}|1\d{2})" positions="9" substitute="SUCCESSFUL"/>
29
                <SubstitutionRule match="(4\d{2}|5\d{2})" positions="8" substitute="UNSUCCESSFUL"/>
30
                <SubstitutionRule match="(4\d{2}|5\d{2})" positions="9" substitute="UNSUCCESSFUL" useBuiltInFunction="false"/>
31
                <SubstitutionRule match="(\&quot;\-\&quot;)@@(2\d{2}|3\d{2}|1\d{2})" positions="6@@7" substitute="SUCCESSFUL" useBuiltInFunction="false"/>
32
                <SubstitutionRule match="(\&quot;\-\&quot;)@@(4\d{2}|5\d{2})" positions="6@@7" substitute="UNSUCCESSFUL" useBuiltInFunction="false"/>
33
              </parser:RuleAttribute>
34
              <parser:RuleAttribute defaultValue="REQUEST COMPLETED" index="N30BA5C1002F11D88000C6FD28070181" name="situationQualifier" usePreviousMatchSubstitutionAsDefault="false">
35
                <SubstitutionRule match="(202|3\d{2}|1\d{2}|4\d{2}|5\d{2})" positions="8" substitute="REQUEST INITIATED"/>
36
                <SubstitutionRule match="(202|3\d{2}|1\d{2}|4\d{2}|5\d{2})" positions="9" substitute="REQUEST INITIATED"/>
37
                <SubstitutionRule match="(\&quot;\-\&quot;)@@(202|3\d{2}|1\d{2}|4\d{2}|5\d{2})" positions="6@@7" substitute="REQUEST INITIATED" useBuiltInFunction="false"/>
38
              </parser:RuleAttribute>
39
              <parser:RuleAttribute defaultValue="EXTERNAL" index="NCCBFC40002F11D88000C6FD28070181" name="reasoningScope" usePreviousMatchSubstitutionAsDefault="false"/>
40
            </parser:RuleElement>
41
            <parser:RuleElement index="N224169A084711D8800091856AF4A65C" name="ReportSituation">
42
              <parser:RuleAttribute defaultValue="INTERNAL" index="N224169B084711D8800091856AF4A65C" name="reasoningScope" usePreviousMatchSubstitutionAsDefault="false"/>
43
              <parser:RuleAttribute defaultValue="LOG" index="N224169C084711D8800091856AF4A65C" name="reportCategory" usePreviousMatchSubstitutionAsDefault="false"/>
44
            </parser:RuleElement>
45
          </parser:RuleElement>
46
          <parser:RuleElement index="NF4E4C51002C11D88000C6FD28070181" name="extendedDataElements">
47
            <parser:RuleElement index="NEA78170002C11D88000C6FD28070181" isRequiredByParent="true" name="values">
48
              <parser:RuleAttribute index="N0060000002D11D88000C6FD28070181" name="values" usePreviousMatchSubstitutionAsDefault="false">
49
                <SubstitutionRule match="(\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3})" positions="1" substitute="$1"/>
50
              </parser:RuleAttribute>
51
            </parser:RuleElement>
52
            <parser:RuleAttribute defaultValue="Client" index="N2CA0593002C11D88000C6FD28070181" name="name" usePreviousMatchSubstitutionAsDefault="false"/>
53
            <parser:RuleAttribute defaultValue="string" index="NE6BC644002C11D88000C6FD28070181" name="type" usePreviousMatchSubstitutionAsDefault="false"/>
54
          </parser:RuleElement>
55
          <parser:RuleElement index="N9A75941002D11D88000C6FD28070181" name="extendedDataElements">
56
            <parser:RuleElement index="NE1B1FE0002D11D88000C6FD28070181" isRequiredByParent="true" name="values">
57
              <parser:RuleAttribute index="NF0BE880002D11D88000C6FD28070181" name="values" usePreviousMatchSubstitutionAsDefault="false">
58
                <SubstitutionRule match="(\d{3})" positions="8" substitute="$1"/>
59
                <SubstitutionRule match="(\d{3})" positions="9" substitute="$1"/>
60
                <SubstitutionRule match="\&quot;\S+\&quot;@@(\d{3})" positions="6@@7" substitute="$1" useBuiltInFunction="false"/>
61
              </parser:RuleAttribute>
62
            </parser:RuleElement>
63
            <parser:RuleAttribute defaultValue="return_code" index="NAE6B713002D11D88000C6FD28070181" name="name" usePreviousMatchSubstitutionAsDefault="false"/>
64
            <parser:RuleAttribute defaultValue="short" index="NA82DDF4002D11D88000C6FD28070181" name="type" usePreviousMatchSubstitutionAsDefault="false"/>
65
          </parser:RuleElement>
66
          <parser:RuleElement index="N704BAD1002D11D88000C6FD28070181" isRequiredByParent="false" name="extendedDataElements">
67
            <parser:RuleElement index="NED77220002D11D88000C6FD28070181" isRequiredByParent="true" name="values">
68
              <parser:RuleAttribute index="N0206CE0002D11D88000C6FD28070181" name="values" usePreviousMatchSubstitutionAsDefault="false">
69
                <SubstitutionRule match="\&quot;\S+@@(.*)" positions="6@@7" substitute="$1" useBuiltInFunction="false"/>
70
              </parser:RuleAttribute>
71
            </parser:RuleElement>
72
            <parser:RuleAttribute defaultValue="string" index="N84689A4002D11D88000C6FD28070181" name="type" usePreviousMatchSubstitutionAsDefault="false"/>
73
            <parser:RuleAttribute defaultValue="File" index="NC265BE1002D11D88000C6FD28070181" name="name" usePreviousMatchSubstitutionAsDefault="false"/>
74
          </parser:RuleElement>
75
          <parser:RuleElement index="N7F86201003311D88000C6FD28070181" name="extendedDataElements">
76
            <parser:RuleElement index="NB59C730003311D88000C6FD28070181" isRequiredByParent="true" name="values">
77
              <parser:RuleAttribute index="NC6013A0003311D88000C6FD28070181" name="values" usePreviousMatchSubstitutionAsDefault="false">
78
                <SubstitutionRule match="\&quot;(\w+)\&quot;" positions="6" substitute="$1"/>
79
                <SubstitutionRule match="\&quot;(\w+)" positions="6" substitute="$1"/>
80
                <SubstitutionRule match="\&quot;(\S+)\&quot;" positions="6" substitute="$1"/>
81
              </parser:RuleAttribute>
82
            </parser:RuleElement>
83
            <parser:RuleAttribute defaultValue="string" index="NF34CCC4003311D88000C6FD28070181" name="type" usePreviousMatchSubstitutionAsDefault="false"/>
84
            <parser:RuleAttribute defaultValue="method" index="N4B83CE3003311D88000C6FD28070181" name="name" usePreviousMatchSubstitutionAsDefault="false"/>
85
          </parser:RuleElement>
86
          <parser:RuleElement index="ND054C63078911D880008B85FEE72030" name="extendedDataElements">
87
            <parser:RuleElement index="NE249F10078911D880008B85FEE72030" isRequiredByParent="true" name="values">
88
              <parser:RuleAttribute index="N0E370F0078911D880008B85FEE72030" name="values" usePreviousMatchSubstitutionAsDefault="false">
89
                <SubstitutionRule match="\&quot;(\S+)\&quot;" positions="11" substitute="$1" useBuiltInFunction="false"/>
90
                <SubstitutionRule match="\&quot;(\S+)\&quot;" positions="10" substitute="$1" useBuiltInFunction="false"/>
91
              </parser:RuleAttribute>
92
            </parser:RuleElement>
93
            <parser:RuleAttribute defaultValue="Referer" index="ND054C64078911D880008B85FEE72030" name="name" usePreviousMatchSubstitutionAsDefault="false"/>
94
            <parser:RuleAttribute defaultValue="string" index="ND054C65078911D880008B85FEE72030" name="type" usePreviousMatchSubstitutionAsDefault="false"/>
95
          </parser:RuleElement>
96
          <parser:RuleElement index="N143DCE3078911D880008B85FEE72030" name="extendedDataElements">
97
            <parser:RuleElement index="N281B410078911D880008B85FEE72030" isRequiredByParent="true" name="values">
98
              <parser:RuleAttribute index="N52E3670078911D880008B85FEE72030" name="values" usePreviousMatchSubstitutionAsDefault="false">
99
                <SubstitutionRule match="^.*\[.*\]\s\&quot;\w+\s+.*\&quot;\s+\S+\s+\S+\s+\&quot;\S+\&quot;\s+\&quot;(.*)\&quot;" positions="" substitute="$1" useBuiltInFunction="false"/>
100
              </parser:RuleAttribute>
101
            </parser:RuleElement>
102
            <parser:RuleAttribute defaultValue="User-agent" index="N143DCE4078911D880008B85FEE72030" name="name" usePreviousMatchSubstitutionAsDefault="false"/>
103
            <parser:RuleAttribute defaultValue="string" index="N143DCE5078911D880008B85FEE72030" name="type" usePreviousMatchSubstitutionAsDefault="false"/>
104
          </parser:RuleElement>
105
          <parser:RuleElement index="NA3A7573083F11D8800091856AF4A65C" name="extendedDataElements">
106
            <parser:RuleElement index="N1AF0730083F11D8800091856AF4A65C" isRequiredByParent="true" name="values">
107
              <parser:RuleAttribute index="N2BEF090083F11D8800091856AF4A65C" name="values" usePreviousMatchSubstitutionAsDefault="false">
108
                <SubstitutionRule match="^([^0-9][^0-9\.][^0-9\.].*)" substitute="$1" useBuiltInFunction="false"/>
109
              </parser:RuleAttribute>
110
            </parser:RuleElement>
111
            <parser:RuleAttribute defaultValue="CGI Debugging Output" index="NA3A7574083F11D8800091856AF4A65C" name="name" usePreviousMatchSubstitutionAsDefault="false"/>
112
            <parser:RuleAttribute defaultValue="string" index="NA3A7575083F11D8800091856AF4A65C" name="type" usePreviousMatchSubstitutionAsDefault="false"/>
113
          </parser:RuleElement>
114
          <parser:RuleElement index="ND88BDA309FD11D88000B70A90A10773" name="extendedDataElements">
115
            <parser:RuleElement index="NFA8B77009FD11D88000B70A90A10773" isRequiredByParent="true" name="values">
116
              <parser:RuleAttribute index="N18A21A009FE11D88000B70A90A10773" name="values" usePreviousMatchSubstitutionAsDefault="false">
117
                <SubstitutionRule match="HTTP/.*\&quot;@@(.+)" positions="8@@10" substitute="$1" useBuiltInFunction="false"/>
118
                <SubstitutionRule match=".*\&quot;@@(\d+)" positions="7@@9" substitute="$1" useBuiltInFunction="false"/>
119
              </parser:RuleAttribute>
120
            </parser:RuleElement>
121
            <parser:RuleAttribute defaultValue="file_size" index="ND88BDA409FD11D88000B70A90A10773" name="name" usePreviousMatchSubstitutionAsDefault="false"/>
122
            <parser:RuleAttribute defaultValue="string" index="ND88BDA509FD11D88000B70A90A10773" name="type" usePreviousMatchSubstitutionAsDefault="false">
123
              <SubstitutionRule match="(HTTP/.*\&quot;)@@(.+)" positions="8@@10" substitute="string" useBuiltInFunction="false"/>
124
              <SubstitutionRule match="(.*\&quot;)@@(\d+)" positions="7@@9" substitute="int" useBuiltInFunction="false"/>
125
            </parser:RuleAttribute>
126
          </parser:RuleElement>
127
          <parser:RuleAttribute defaultValue="0001-01-01T00:00:00.000000+00:00" index="N3650A820F8511D88000A31D7605087A" name="creationTime" usePreviousMatchSubstitutionAsDefault="true">
128
            <SubstitutionRule match="(.*)" positions="4@@5" substitute="$1" timeFormat="[dd/MMM/yyyy:HH:mm:ss@@z]" useBuiltInFunction="false"/>
129
          </parser:RuleAttribute>
130
          <parser:RuleAttribute index="N024368D002B11D88000C6FD28070181" name="msg" usePreviousMatchSubstitutionAsDefault="false">
131
            <SubstitutionRule match="^[^&quot;]+(\&quot;.*)" substitute="$1"/>
132
            <SubstitutionRule match="^([^\d{1,3}][^\.][^\d{1,3}].*)" substitute="$1" useBuiltInFunction="false"/>
133
          </parser:RuleAttribute>
134
          <parser:RuleAttribute defaultValue="10" index="N230EBD1002C11D88000C6FD28070181" name="severity" usePreviousMatchSubstitutionAsDefault="false">
135
            <SubstitutionRule match="5\d{2}" positions="8" substitute="60" useBuiltInFunction="false"/>
136
            <SubstitutionRule match="5\d{2}" positions="9" substitute="60" useBuiltInFunction="false"/>
137
            <SubstitutionRule match="4\d{2}" positions="8" substitute="40" useBuiltInFunction="false"/>
138
            <SubstitutionRule match="4\d{2}" positions="9" substitute="40" useBuiltInFunction="false"/>
139
            <SubstitutionRule match="\&quot;\S+\&quot;@@5\d{2}" positions="6@@7" substitute="60" useBuiltInFunction="false"/>
140
            <SubstitutionRule match="\&quot;\S+\&quot;@@4\d{2}" positions="6@@7" substitute="40" useBuiltInFunction="false"/>
141
            <SubstitutionRule match="[^\&quot;]+\&quot;[\S\s\&quot;]+\&quot;\s+5\d{2}\s+\d+.*" positions="" substitute="60" useBuiltInFunction="false"/>
142
            <SubstitutionRule match="[^\&quot;]+\&quot;[\S\s\&quot;]+\&quot;\s+4\d{2}\s+\d+.*" positions="" substitute="40" useBuiltInFunction="false"/>
143
          </parser:RuleAttribute>
144
        </parser:RuleElement>
145
      </cc:Parser>
146
      <fmt:Formatter description="CBE Formatter" uniqueID="N36C36700F8511D88000A31D7605087A"/>
147
      <cc:Outputter description="Default Logging Agent" uniqueID="N36E80600F8511D88000A31D7605087A" type="SingleFileOutputter">
148
        <pu:Property propertyName="directory" propertyValue="."/>
149
        <pu:Property propertyName="fileName" propertyValue="example.out"/>
150
        <op:SingleFileOutputterType directory="." fileName="example.out"/>
151
      </cc:Outputter>
152
    </cc:ContextInstance>
153
  </cc:Configuration>
154
</adapter:Adapter>
(-)testFiles/GenericLogAdapter/config/APITests/Adapter/invalidConfiguration.adapter (+175 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!--
3
	Copyright (c) 2005,2007 IBM Corporation and others.
4
	All rights reserved. This program and the accompanying materials
5
	are made available under the terms of the Eclipse Public License v1.0
6
	which accompanies this distribution, and is available at
7
	http://www.eclipse.org/legal/epl-v10.html
8
	$Id: regex_example.adapter,v 1.9 2007/03/11 06:35:05 dnsmith Exp $
9
	
10
	Contributors:
11
	IBM - Initial API and implementation
12
-->
13
<adapter:Adapteqr xmlns:adapter="http://www.eclipse.org/hyades/schema/Adapter.xsd" xmlns:cc="http://www.eclipse.org/hyades/schema/ComponentConfiguration.xsd" xmlns:ex="http://www.eclipse.org/hyades/schema/Extractor.xsd" xmlns:fmt="http://www.eclipse.org/hyades/schema/Formatter.xsd" xmlns:hga="http://www.eclipse.org/hyades/schema/Context.xsd" xmlns:op="http://www.eclipse.org/hyades/schema/Outputter.xsd" xmlns:parser="http://www.eclipse.org/hyades/schema/Parser.xsd" xmlns:pu="http://www.eclipse.org/hyades/schema/ProcessUnit.xsd" xmlns:sensor="http://www.eclipse.org/hyades/schema/Sensor.xsd">
14
  <hga:Contexts>
15
    <hga:Context description="Context Instance for the current component" executableClass="org.eclipse.hyades.logging.adapter.impl.BasicContext" implementationCreationDate="2003-10-07T12:00:00" implementationVersion="1.0.0" loggingLevel="50" namae="Basic Context Implementation" role="context" roleCreationDate="2003-10-07T12:00:00" roleVersion="1.0.0" uniqueID1="N35B6D910F8511D88000A31D7605087A">
16
      <hga:Component description="Operating System file sensor" executableClass="org.eclipse.hyades.logging.adapter.sensors.SingleOSFileSensor" implementationCreationDate="2003-10-07T12:00:00" implementationVersion="1.0.0" loggingLevel="50" name="OS File Sensor" role="sensor" roleCreationDate="2003-10-07T12:00:00" roleVersion="1.0.0" uniqueID="N3604F900F8511D88000A31D7605087A"/>
17
      <hga:Component description="This extractor uses regular expression  patterns to identify record delimiters" executableClass="org.eclipse.hyades.logging.adapter.extractors.RegularExpressionExtractor" implementationCreationDate="2003-10-07T12:00:00" implementationVersion="1.0.0" loggingLevel="50" name="Regular Expression Extractor" role="messageExtractor" roleCreationDate="2003-10-07T12:00:00" roleVersion="1.0.0" uniqueID="N36299800F8511D88000A31D7605087A"/>
18
      <hga:Component description="Regular expression parser" executableClass="org.eclipse.hyades.logging.adapter.parsers.Parser" implementationCreationDate="2003-10-07T12:00:00" implementationVersion="1.0.0" loggingLevel="50" name="Generic Parser" role="parser" roleCreationDate="2003-10-07T12:00:00" roleVersion="1.0.0" uniqueID="N3650A800F8511D88000Aaa31D7605087A"/>
19
      <hga:Component description="CBE Formatter" executableClass="org.eclipse.hyades.logging.adapter.formatters.CBEFormatter" implementationCreationDate="2003-10-07T12:00:00" implementationVersion="1.0.0" loggingLevel="50" name="CBE Formatter" role="formatter" roleCreationDate="2003-10-07T12:00:00" roleVersion="1.0.0" uniqueID="N36C36700F8511D88000A31D7605087A"/>
20
      <hga:Component description="CBE File Outputter" executableClass="org.eclipse.hyades.logging.adapter.outputters.CBEFileOutputter" implementationCreationDate="2003-10-07T12:00:00" implementationVersion="1.0.0" implementationVersionDescription="" loggingLevel="50" name="CBEFileOutputter" role="outputter" roleCreationDate="2003-10-07T12:00:00" roleVersion="1.0.0" uniqueID="N36E80600F8511D88000A31D7605087A"/>
21
    </hga:Context>
22
  </hga:Contexts>
23
  <cc:Configuration description="The component level configurations for this adapter" uniqueID="N35B6D900F8511D88000A31D7605087A">
24
    <cc:ContextInstance charset="" continuousOperation="false" description="Context Instance for the current component" isoCountryCode="US" isoLanguageCode="en" maximumIdleTime="20000" pauseInterval="10" uniqueID="N35B6D910F8511D88000A31D7605087A">
25
      <cc:Sensor description="A single file sensor" uniqueID="N3604F900F8511D88000A31D7605087A" confidenceBufferSize="512" fileFooterSize="0" maximumBlocking="10" type="SingleFileSensor">
26
        <pu:Property propertyName="directory" propertyValue="."/>
27
        <pu:Property propertyName="fileName" propertyValue="example.log"/>
28
        <sensor:SingleFileSensor directory="." fileName="example.log"/>
29
      </cc:Sensor>
30
      <ex:Extractor description="This extractor uses regular expression  patterns to identify record delimiters" uniqueID="N36299800F8511D88000A31D7605087A" containsLineBreaks="true" endPattern="$" includeEndPattern="false" includeStartPattern="true" lineBreakSymbol="" replaceLineBreaks="false" startPattern="^(\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3})|(\S+)"/>
31
      <cc:Parser separatorToken="\s+" uniqueID="N3650A800F8511D88000A31D7605087A">
32
        <parser:RuleElement index="N3650A810F8511D88000A31D7605087A" name="CommonBaseEvent">
33
          <parser:RuleElement index="N8CA7C54002A11D88000C6FD28070181" name="sourceComponentId">
34
            <parser:RuleAttribute defaultValue="Apache HTTP Server" index="ND66C0C1002A11D88000C6FD28070181" name="component" usePreviousMatchSubstitutionAsDefault="false"/>
35
            <parser:RuleAttribute defaultValue="Unknown" index="N77CD869002A11D88000C6FD28070181" name="subComponent" usePreviousMatchSubstitutionAsDefault="false"/>
36
            <parser:RuleAttribute defaultValue="ProductName" index="N12069D2002A11D88000C6FD28070181" name="componentIdType" usePreviousMatchSubstitutionAsDefault="false"/>
37
            <parser:RuleAttribute index="N3AB0CD6010F11D88000873B061CB0B3" name="location" usePreviousMatchSubstitutionAsDefault="false">
38
              <SubstitutionRule substitute="" useBuiltInFunction="true"/>
39
            </parser:RuleAttribute>
40
            <parser:RuleAttribute index="NCD2CCD7010F11D88000873B061CB0B3" name="locationType" usePreviousMatchSubstitutionAsDefault="false">
41
              <SubstitutionRule substitute="" useBuiltInFunction="true"/>
42
            </parser:RuleAttribute>
43
            <parser:RuleAttribute defaultValue="HTTPServer" index="NDE661030DAB11D88000930FA6625271" name="componentType" usePreviousMatchSubstitutionAsDefault="false"/>
44
          </parser:RuleElement>
45
          <parser:RuleElement index="N8273E56002C11D88000C6FD28070181" isChildChoice="true" name="situation">
46
            <parser:RuleElement index="NF8AFFE9002F11D88000C6FD28070181" name="RequestSituation">
47
              <parser:RuleAttribute index="N2815562002F11D88000C6FD28070181" isRequiredByParent="true" name="successDisposition" usePreviousMatchSubstitutionAsDefault="false">
48
                <SubstitutionRule match="(2\d{2}|3\d{2}|1\d{2})" positions="8" substitute="SUCCESSFUL"/>
49
                <SubstitutionRule match="(2\d{2}|3\d{2}|1\d{2})" positions="9" substitute="SUCCESSFUL"/>
50
                <SubstitutionRule match="(4\d{2}|5\d{2})" positions="8" substitute="UNSUCCESSFUL"/>
51
                <SubstitutionRule match="(4\d{2}|5\d{2})" positions="9" substitute="UNSUCCESSFUL" useBuiltInFunction="false"/>
52
                <SubstitutionRule match="(\&quot;\-\&quot;)@@(2\d{2}|3\d{2}|1\d{2})" positions="6@@7" substitute="SUCCESSFUL" useBuiltInFunction="false"/>
53
                <SubstitutionRule match="(\&quot;\-\&quot;)@@(4\d{2}|5\d{2})" positions="6@@7" substitute="UNSUCCESSFUL" useBuiltInFunction="false"/>
54
              </parser:RuleAttribute>
55
              <parser:RuleAttribute defaultValue="REQUEST COMPLETED" index="N30BA5C1002F11D88000C6FD28070181" name="situationQualifier" usePreviousMatchSubstitutionAsDefault="false">
56
                <SubstitutionRule match="(202|3\d{2}|1\d{2}|4\d{2}|5\d{2})" positions="8" substitute="REQUEST INITIATED"/>
57
                <SubstitutionRule match="(202|3\d{2}|1\d{2}|4\d{2}|5\d{2})" positions="9" substitute="REQUEST INITIATED"/>
58
                <SubstitutionRule match="(\&quot;\-\&quot;)@@(202|3\d{2}|1\d{2}|4\d{2}|5\d{2})" positions="6@@7" substitute="REQUEST INITIATED" useBuiltInFunction="false"/>
59
              </parser:RuleAttribute>
60
              <parser:RuleAttribute defaultValue="EXTERNAL" index="NCCBFC40002F11D88000C6FD28070181" name="reasoningScope" usePreviousMatchSubstitutionAsDefault="false"/>
61
            </parser:RuleElement>
62
            <parser:RuleElement index="N224169A084711D8800091856AF4A65C" name="ReportSituation">
63
              <parser:RuleAttribute defaultValue="INTERNAL" index="N224169B084711D8800091856AF4A65C" name="reasoningScope" usePreviousMatchSubstitutionAsDefault="false"/>
64
              <parser:RuleAttribute defaultValue="LOG" index="N224169C084711D8800091856AF4A65C" name="reportCategory" usePreviousMatchSubstitutionAsDefault="false"/>
65
            </parser:RuleElement>
66
          </parser:RuleElement>
67
          <parser:RuleElement index="NF4E4C51002C11D88000C6FD28070181" name="extendedDataElements">
68
            <parser:RuleElement index="NEA78170002C11D88000C6FD28070181" isRequiredByParent="true" name="values">
69
              <parser:RuleAttribute index="N0060000002D11D88000C6FD28070181" name="values" usePreviousMatchSubstitutionAsDefault="false">
70
                <SubstitutionRule match="(\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3})" positions="1" substitute="$1"/>
71
              </parser:RuleAttribute>
72
            </parser:RuleElement>
73
            <parser:RuleAttribute defaultValue="Client" index="N2CA0593002C11D88000C6FD28070181" name="name" usePreviousMatchSubstitutionAsDefault="false"/>
74
            <parser:RuleAttribute defaultValue="string" index="NE6BC644002C11D88000C6FD28070181" name="type" usePreviousMatchSubstitutionAsDefault="false"/>
75
          </parser:RuleElement>
76
          <parser:RuleElement index="N9A75941002D11D88000C6FD28070181" name="extendedDataElements">
77
            <parser:RuleElement index="NE1B1FE0002D11D88000C6FD28070181" isRequiredByParent="true" name="values">
78
              <parser:RuleAttribute index="NF0BE880002D11D88000C6FD28070181" name="values" usePreviousMatchSubstitutionAsDefault="false">
79
                <SubstitutionRule match="(\d{3})" positions="8" substitute="$1"/>
80
                <SubstitutionRule match="(\d{3})" positions="9" substitute="$1"/>
81
                <SubstitutionRule match="\&quot;\S+\&quot;@@(\d{3})" positions="6@@7" substitute="$1" useBuiltInFunction="false"/>
82
              </parser:RuleAttribute>
83
            </parser:RuleElement>
84
            <parser:RuleAttribute defaultValue="return_code" index="NAE6B713002D11D88000C6FD28070181" name="name" usePreviousMatchSubstitutionAsDefault="false"/>
85
            <parser:RuleAttribute defaultValue="short" index="NA82DDF4002D11D88000C6FD28070181" name="type" usePreviousMatchSubstitutionAsDefault="false"/>
86
          </parser:RuleElement>
87
          <parser:RuleElement index="N704BAD1002D11D88000C6FD28070181" isRequiredByParent="false" name="extendedDataElements">
88
            <parser:RuleElement index="NED77220002D11D88000C6FD28070181" isRequiredByParent="true" name="values">
89
              <parser:RuleAttribute index="N0206CE0002D11D88000C6FD28070181" name="values" usePreviousMatchSubstitutionAsDefault="false">
90
                <SubstitutionRule match="\&quot;\S+@@(.*)" positions="6@@7" substitute="$1" useBuiltInFunction="false"/>
91
              </parser:RuleAttribute>
92
            </parser:RuleElement>
93
            <parser:RuleAttribute defaultValue="string" index="N84689A4002D11D88000C6FD28070181" name="type" usePreviousMatchSubstitutionAsDefault="false"/>
94
            <parser:RuleAttribute defaultValue="File" index="NC265BE1002D11D88000C6FD28070181" name="name" usePreviousMatchSubstitutionAsDefault="false"/>
95
          </parser:RuleElement>
96
          <parser:RuleElement index="N7F86201003311D88000C6FD28070181" name="extendedDataElements">
97
            <parser:RuleElement index="NB59C730003311D88000C6FD28070181" isRequiredByParent="true" name="values">
98
              <parser:RuleAttribute index="NC6013A0003311D88000C6FD28070181" name="values" usePreviousMatchSubstitutionAsDefault="false">
99
                <SubstitutionRule match="\&quot;(\w+)\&quot;" positions="6" substitute="$1"/>
100
                <SubstitutionRule match="\&quot;(\w+)" positions="6" substitute="$1"/>
101
                <SubstitutionRule match="\&quot;(\S+)\&quot;" positions="6" substitute="$1"/>
102
              </parser:RuleAttribute>
103
            </parser:RuleElement>
104
            <parser:RuleAttribute defaultValue="string" index="NF34CCC4003311D88000C6FD28070181" name="type" usePreviousMatchSubstitutionAsDefault="false"/>
105
            <parser:RuleAttribute defaultValue="method" index="N4B83CE3003311D88000C6FD28070181" name="name" usePreviousMatchSubstitutionAsDefault="false"/>
106
          </parser:RuleElement>
107
          <parser:RuleElement index="ND054C63078911D880008B85FEE72030" name="extendedDataElements">
108
            <parser:RuleElement index="NE249F10078911D880008B85FEE72030" isRequiredByParent="true" name="values">
109
              <parser:RuleAttribute index="N0E370F0078911D880008B85FEE72030" name="values" usePreviousMatchSubstitutionAsDefault="false">
110
                <SubstitutionRule match="\&quot;(\S+)\&quot;" positions="11" substitute="$1" useBuiltInFunction="false"/>
111
                <SubstitutionRule match="\&quot;(\S+)\&quot;" positions="10" substitute="$1" useBuiltInFunction="false"/>
112
              </parser:RuleAttribute>
113
            </parser:RuleElement>
114
            <parser:RuleAttribute defaultValue="Referer" index="ND054C64078911D880008B85FEE72030" name="name" usePreviousMatchSubstitutionAsDefault="false"/>
115
            <parser:RuleAttribute defaultValue="string" index="ND054C65078911D880008B85FEE72030" name="type" usePreviousMatchSubstitutionAsDefault="false"/>
116
          </parser:RuleElement>
117
          <parser:RuleElement index="N143DCE3078911D880008B85FEE72030" name="extendedDataElements">
118
            <parser:RuleElement index="N281B410078911D880008B85FEE72030" isRequiredByParent="true" name="values">
119
              <parser:RuleAttribute index="N52E3670078911D880008B85FEE72030" name="values" usePreviousMatchSubstitutionAsDefault="false">
120
                <SubstitutionRule match="^.*\[.*\]\s\&quot;\w+\s+.*\&quot;\s+\S+\s+\S+\s+\&quot;\S+\&quot;\s+\&quot;(.*)\&quot;" positions="" substitute="$1" useBuiltInFunction="false"/>
121
              </parser:RuleAttribute>
122
            </parser:RuleElement>
123
            <parser:RuleAttribute defaultValue="User-agent" index="N143DCE4078911D880008B85FEE72030" name="name" usePreviousMatchSubstitutionAsDefault="false"/>
124
            <parser:RuleAttribute defaultValue="string" index="N143DCE5078911D880008B85FEE72030" name="type" usePreviousMatchSubstitutionAsDefault="false"/>
125
          </parser:RuleElement>
126
          <parser:RuleElement index="NA3A7573083F11D8800091856AF4A65C" name="extendedDataElements">
127
            <parser:RuleElement index="N1AF0730083F11D8800091856AF4A65C" isRequiredByParent="true" name="values">
128
              <parser:RuleAttribute index="N2BEF090083F11D8800091856AF4A65C" name="values" usePreviousMatchSubstitutionAsDefault="false">
129
                <SubstitutionRule match="^([^0-9][^0-9\.][^0-9\.].*)" substitute="$1" useBuiltInFunction="false"/>
130
              </parser:RuleAttribute>
131
            </parser:RuleElement>
132
            <parser:RuleAttribute defaultValue="CGI Debugging Output" index="NA3A7574083F11D8800091856AF4A65C" name="name" usePreviousMatchSubstitutionAsDefault="false"/>
133
            <parser:RuleAttribute defaultValue="string" index="NA3A7575083F11D8800091856AF4A65C" name="type" usePreviousMatchSubstitutionAsDefault="false"/>
134
          </parser:RuleElement>
135
          <parser:RuleElement index="ND88BDA309FD11D88000B70A90A10773" name="extendedDataElements">
136
            <parser:RuleElement index="NFA8B77009FD11D88000B70A90A10773" isRequiredByParent="true" name="values">
137
              <parser:RuleAttribute index="N18A21A009FE11D88000B70A90A10773" name="values" usePreviousMatchSubstitutionAsDefault="false">
138
                <SubstitutionRule match="HTTP/.*\&quot;@@(.+)" positions="8@@10" substitute="$1" useBuiltInFunction="false"/>
139
                <SubstitutionRule match=".*\&quot;@@(\d+)" positions="7@@9" substitute="$1" useBuiltInFunction="false"/>
140
              </parser:RuleAttribute>
141
            </parser:RuleElement>
142
            <parser:RuleAttribute defaultValue="file_size" index="ND88BDA409FD11D88000B70A90A10773" name="name" usePreviousMatchSubstitutionAsDefault="false"/>
143
            <parser:RuleAttribute defaultValue="string" index="ND88BDA509FD11D88000B70A90A10773" name="type" usePreviousMatchSubstitutionAsDefault="false">
144
              <SubstitutionRule match="(HTTP/.*\&quot;)@@(.+)" positions="8@@10" substitute="string" useBuiltInFunction="false"/>
145
              <SubstitutionRule match="(.*\&quot;)@@(\d+)" positions="7@@9" substitute="int" useBuiltInFunction="false"/>
146
            </parser:RuleAttribute>
147
          </parser:RuleElement>
148
          <parser:RuleAttribute defaultValue="0001-01-01T00:00:00.000000+00:00" index="N3650A820F8511D88000A31D7605087A" name="creationTime" usePreviousMatchSubstitutionAsDefault="true">
149
            <SubstitutionRule match="(.*)" positions="4@@5" substitute="$1" timeFormat="[dd/MMM/yyyy:HH:mm:ss@@z]" useBuiltInFunction="false"/>
150
          </parser:RuleAttribute>
151
          <parser:RuleAttribute index="N024368D002B11D88000C6FD28070181" name="msg" usePreviousMatchSubstitutionAsDefault="false">
152
            <SubstitutionRule match="^[^&quot;]+(\&quot;.*)" substitute="$1"/>
153
            <SubstitutionRule match="^([^\d{1,3}][^\.][^\d{1,3}].*)" substitute="$1" useBuiltInFunction="false"/>
154
          </parser:RuleAttribute>
155
          <parser:RuleAttribute defaultValue="10" index="N230EBD1002C11D88000C6FD28070181" name="severity" usePreviousMatchSubstitutionAsDefault="false">
156
            <SubstitutionRule match="5\d{2}" positions="8" substitute="60" useBuiltInFunction="false"/>
157
            <SubstitutionRule match="5\d{2}" positions="9" substitute="60" useBuiltInFunction="false"/>
158
            <SubstitutionRule match="4\d{2}" positions="8" substitute="40" useBuiltInFunction="false"/>
159
            <SubstitutionRule match="4\d{2}" positions="9" substitute="40" useBuiltInFunction="false"/>
160
            <SubstitutionRule match="\&quot;\S+\&quot;@@5\d{2}" positions="6@@7" substitute="60" useBuiltInFunction="false"/>
161
            <SubstitutionRule match="\&quot;\S+\&quot;@@4\d{2}" positions="6@@7" substitute="40" useBuiltInFunction="false"/>
162
            <SubstitutionRule match="[^\&quot;]+\&quot;[\S\s\&quot;]+\&quot;\s+5\d{2}\s+\d+.*" positions="" substitute="60" useBuiltInFunction="false"/>
163
            <SubstitutionRule match="[^\&quot;]+\&quot;[\S\s\&quot;]+\&quot;\s+4\d{2}\s+\d+.*" positions="" substitute="40" useBuiltInFunction="false"/>
164
          </parser:RuleAttribute>
165
        </parser:RuleElement>
166
      </cc:Parser>
167
      <fmt:Formatter description="CBE Formatter" uniqueID="N36C36700F8511D88000A31D7605087A"/>
168
      <cc:Outputter description="Default Logging Agent" uniqueID="N36E80600F8511D88000A31D7605087A" type="SingleFileOutputter">
169
        <pu:Property propertyName="directory" propertyValue="."/>
170
        <pu:Property propertyName="fileName" propertyValue="example.out"/>
171
        <op:SingleFileOutputterType directory="." fileName="example.out"/>
172
      </cc:Outputter>
173
    </cc:ContextInstance>
174
  </cc:Configuration>
175
</adapter:Adapter>
(-)testFiles/GenericLogAdapter/config/APITests/Adapter/contextConfiguration.xml (+11 lines)
Added Link Here
1
<adapter:Adapter xmlns:adapter="http://www.eclipse.org/hyades/schema/Adapter.xsd" xmlns:cc="http://www.eclipse.org/hyades/schema/ComponentConfiguration.xsd" xmlns:ex="http://www.eclipse.org/hyades/schema/Extractor.xsd" xmlns:fmt="http://www.eclipse.org/hyades/schema/Formatter.xsd" xmlns:hga="http://www.eclipse.org/hyades/schema/Context.xsd" xmlns:op="http://www.eclipse.org/hyades/schema/Outputter.xsd" xmlns:parser="http://www.eclipse.org/hyades/schema/Parser.xsd" xmlns:pu="http://www.eclipse.org/hyades/schema/ProcessUnit.xsd" xmlns:sensor="http://www.eclipse.org/hyades/schema/Sensor.xsd">
2
  <hga:Contexts>
3
    <hga:Context description="Context Instance for the current component" executableClass="org.eclipse.hyades.logging.adapter.impl.BasicContext" implementationCreationDate="2003-10-07T12:00:00" implementationVersion="1.0.0" loggingLevel="50" name="Basic Context Implementation" role="context" roleCreationDate="2003-10-07T12:00:00" roleVersion="1.0.0" uniqueID="N35B6D910F8511D88000A31D7605087A">
4
      <hga:Component description="Operating System file sensor" executableClass="org.eclipse.hyades.logging.adapter.sensors.SingleOSFileSensor" implementationCreationDate="2003-10-07T12:00:00" implementationVersion="1.0.0" loggingLevel="50" name="OS File Sensor" role="sensor" roleCreationDate="2003-10-07T12:00:00" roleVersion="1.0.0" uniqueID="N3604F900F8511D88000A31D7605087A"/>
5
      <hga:Component description="This extractor uses regular expression  patterns to identify record delimiters" executableClass="org.eclipse.hyades.logging.adapter.extractors.RegularExpressionExtractor" implementationCreationDate="2003-10-07T12:00:00" implementationVersion="1.0.0" loggingLevel="50" name="Regular Expression Extractor" role="messageExtractor" roleCreationDate="2003-10-07T12:00:00" roleVersion="1.0.0" uniqueID="N36299800F8511D88000A31D7605087A"/>
6
      <hga:Component description="Regular expression parser" executableClass="org.eclipse.hyades.logging.adapter.parsers.Parser" implementationCreationDate="2003-10-07T12:00:00" implementationVersion="1.0.0" loggingLevel="50" name="Generic Parser" role="parser" roleCreationDate="2003-10-07T12:00:00" roleVersion="1.0.0" uniqueID="N3650A800F8511D88000A31D7605087A"/>
7
      <hga:Component description="CBE Formatter" executableClass="org.eclipse.hyades.logging.adapter.formatters.CBEFormatter" implementationCreationDate="2003-10-07T12:00:00" implementationVersion="1.0.0" loggingLevel="50" name="CBE Formatter" role="formatter" roleCreationDate="2003-10-07T12:00:00" roleVersion="1.0.0" uniqueID="N36C36700F8511D88000A31D7605087A"/>
8
      <hga:Component description="CBE File Outputter" executableClass="org.eclipse.hyades.logging.adapter.outputters.CBEFileOutputter" implementationCreationDate="2003-10-07T12:00:00" implementationVersion="1.0.0" implementationVersionDescription="" loggingLevel="50" name="CBEFileOutputter" role="outputter" roleCreationDate="2003-10-07T12:00:00" roleVersion="1.0.0" uniqueID="N36E80600F8511D88000A31D7605087A"/>
9
    </hga:Context>
10
  </hga:Contexts>
11
</adapter:Adapter>
(-)testFiles/GenericLogAdapter/config/APITests/Adapter/example.log (+186 lines)
Added Link Here
1
9.26.157.44 - - [16/Jan/2003:21:22:59 -0500] "GET /WSsamples HTTP/1.1" 301 315
2
9.26.157.44 - - [16/Jan/2003:21:22:59 -0500] "GET /WSsamples/ HTTP/1.1" 200 1576
3
9.26.157.44 - - [16/Jan/2003:21:22:59 -0500] "GET /WSsamples/Master.css HTTP/1.1" 200 185
4
9.26.157.44 - - [16/Jan/2003:21:22:59 -0500] "GET /WSsamples/Menu/Cube.html HTTP/1.1" 200 425
5
9.26.157.44 - - [16/Jan/2003:21:22:59 -0500] "GET /WSsamples/Menu/Logo.html HTTP/1.1" 200 517
6
9.26.157.44 - - [16/Jan/2003:21:22:59 -0500] "GET /WSsamples/Menu/Title.html HTTP/1.1" 200 421
7
9.26.157.44 - - [16/Jan/2003:21:22:59 -0500] "GET /WSsamples/Menu/Menu.html HTTP/1.1" 200 3778
8
9.26.157.44 - - [16/Jan/2003:21:22:59 -0500] "GET /WSsamples/Menu/Curve.html HTTP/1.1" 200 391
9
9.26.157.44 - - [16/Jan/2003:21:22:59 -0500] "GET /WSsamples/Menu/SamplesIntro.html HTTP/1.1" 200 30362
10
9.26.157.44 - - [16/Jan/2003:21:22:59 -0500] "GET /WSsamples/images/globecube.jpg HTTP/1.1" 200 4343
11
9.26.157.44 - - [16/Jan/2003:21:22:59 -0500] "GET /WSsamples/images/server.jpg HTTP/1.1" 200 24762
12
9.26.157.44 - - [16/Jan/2003:21:22:59 -0500] "GET /WSsamples/images/bluebackdark.jpg HTTP/1.1" 200 4450
13
9.26.157.44 - - [16/Jan/2003:21:22:59 -0500] "GET /WSsamples/images/ibm_logo_sm_fff.gif HTTP/1.1" 200 138
14
9.26.157.44 - - [16/Jan/2003:21:22:59 -0500] "GET /WSsamples/SamplesMaster.css HTTP/1.1" 200 1951
15
9.26.157.44 - - [16/Jan/2003:21:22:59 -0500] "GET /WSsamples/images/curve.jpg HTTP/1.1" 200 5579
16
9.26.157.44 - - [16/Jan/2003:21:22:59 -0500] "GET /WSsamples/images/stripes_repeat.jpg HTTP/1.1" 200 5798
17
9.26.157.44 - - [16/Jan/2003:21:22:59 -0500] "GET /WSsamples/images/clearPixel.gif HTTP/1.1" 200 43
18
9.26.157.44 - - [16/Jan/2003:21:23:06 -0500] "GET /WSsamples/Configuration/Database/DBConfig.html HTTP/1.1" 200 3811
19
9.26.157.44 - - [16/Jan/2003:21:23:06 -0500] "GET /WSsamples/images/takeNote.gif HTTP/1.1" 200 96
20
9.26.157.44 - - [16/Jan/2003:21:23:10 -0500] "GET /WebSphereSamples/YourCoDocs/YourCoIntro.html HTTP/1.1" 200 3203
21
9.26.157.44 - - [16/Jan/2003:21:23:10 -0500] "GET /theme/Master.css HTTP/1.1" 200 197
22
9.26.157.44 - - [16/Jan/2003:21:23:10 -0500] "GET /theme/SamplesMaster.css HTTP/1.1" 200 1963
23
9.26.157.44 - - [16/Jan/2003:21:23:10 -0500] "GET /theme/run.jpg HTTP/1.1" 200 6137
24
9.26.157.44 - - [16/Jan/2003:21:23:10 -0500] "GET /theme/technotes.jpg HTTP/1.1" 200 6241
25
9.26.157.44 - - [16/Jan/2003:21:23:10 -0500] "GET /WebSphereSamples/YourCoDocs/YourCoSample.jpg HTTP/1.1" 200 86317
26
9.26.157.44 - - [16/Jan/2003:21:23:17 -0500] "GET /WebSphereSamples/YourCo/index.jsp HTTP/1.1" 200 4684
27
9.26.157.44 - - [16/Jan/2003:21:23:17 -0500] "GET /theme/YourCo.css HTTP/1.1" 200 92
28
9.26.157.44 - - [16/Jan/2003:21:23:17 -0500] "GET /theme/topBanner.gif HTTP/1.1" 200 7427
29
9.26.157.44 - - [16/Jan/2003:21:23:17 -0500] "GET /theme/bg.gif HTTP/1.1" 200 379
30
9.26.157.44 - - [16/Jan/2003:21:23:17 -0500] "GET /theme/buttonDWN.gif HTTP/1.1" 200 555
31
9.26.157.44 - - [16/Jan/2003:21:23:17 -0500] "GET /theme/button.gif HTTP/1.1" 200 1015
32
9.26.157.44 - - [16/Jan/2003:21:23:17 -0500] "GET /theme/circleLine.gif HTTP/1.1" 200 213
33
9.26.157.44 - - [16/Jan/2003:21:23:17 -0500] "GET /theme/horzLine.gif HTTP/1.1" 200 361
34
9.26.157.44 - - [16/Jan/2003:21:23:17 -0500] "GET /theme/photo01.jpg HTTP/1.1" 200 21960
35
9.26.157.44 - - [16/Jan/2003:21:23:19 -0500] "GET /WebSphereSamples/YourCo/WhitePages/frameset.html HTTP/1.1" 200 1098
36
9.26.157.44 - - [16/Jan/2003:21:23:19 -0500] "GET /WebSphereSamples/YourCo/WhitePages/blank.html HTTP/1.1" 200 780
37
9.26.157.44 - - [16/Jan/2003:21:23:20 -0500] "GET /WebSphereSamples/servlet/WebSphereSamples.YourCo.WhitePages.SelectNames HTTP/1.1" 200 8121
38
9.26.157.44 - - [16/Jan/2003:21:23:24 -0500] "POST /WebSphereSamples/servlet/WebSphereSamples.YourCo.WhitePages.ByName HTTP/1.1" 200 1110
39
9.26.157.44 - - [16/Jan/2003:21:23:28 -0500] "POST /WebSphereSamples/servlet/WebSphereSamples.YourCo.WhitePages.ByName HTTP/1.1" 200 1108
40
9.26.157.44 - - [16/Jan/2003:21:23:32 -0500] "POST /WebSphereSamples/servlet/WebSphereSamples.YourCo.WhitePages.ByName HTTP/1.1" 200 1101
41
9.26.157.44 - - [16/Jan/2003:21:24:34 -0500] "POST /WebSphereSamples/servlet/WebSphereSamples.YourCo.WhitePages.ByName HTTP/1.1" 200 1108
42
9.26.157.44 - - [16/Jan/2003:21:24:38 -0500] "POST /WebSphereSamples/servlet/WebSphereSamples.YourCo.WhitePages.ByName HTTP/1.1" 200 1110
43
9.26.157.44 - - [16/Jan/2003:21:24:41 -0500] "POST /WebSphereSamples/servlet/WebSphereSamples.YourCo.WhitePages.ByName HTTP/1.1" 200 1109
44
9.26.157.44 - - [16/Jan/2003:21:24:43 -0500] "GET /WebSphereSamples/YourCo/WhitePages/directory.pdf HTTP/1.1" 200 134218
45
9.26.157.44 - - [16/Jan/2003:21:24:53 -0500] "POST /WebSphereSamples/servlet/WebSphereSamples.YourCo.WhitePages.ByJob HTTP/1.1" 200 1210
46
9.26.157.44 - - [16/Jan/2003:21:24:57 -0500] "GET /WebSphereSamples/servlet/WebSphereSamples.YourCo.News.NewsServlet HTTP/1.1" 200 4633
47
9.26.157.44 - - [16/Jan/2003:21:24:57 -0500] "GET /theme/YourCo.css HTTP/1.1" 304 0
48
9.26.157.44 - - [16/Jan/2003:21:24:57 -0500] "GET /theme/bg.gif HTTP/1.1" 304 0
49
9.26.157.44 - - [16/Jan/2003:21:24:57 -0500] "GET /theme/topBanner.gif HTTP/1.1" 304 0
50
9.26.157.44 - - [16/Jan/2003:21:24:57 -0500] "GET /theme/buttonDWN.gif HTTP/1.1" 304 0
51
9.26.157.44 - - [16/Jan/2003:21:24:57 -0500] "GET /theme/circleLine.gif HTTP/1.1" 304 0
52
9.26.157.44 - - [16/Jan/2003:21:24:57 -0500] "GET /theme/photo01.jpg HTTP/1.1" 304 0
53
9.26.157.44 - - [16/Jan/2003:21:24:57 -0500] "GET /theme/button.gif HTTP/1.1" 304 0
54
9.26.157.44 - - [16/Jan/2003:21:24:57 -0500] "GET /theme/horzLine.gif HTTP/1.1" 304 0
55
9.26.157.44 - - [16/Jan/2003:21:25:00 -0500] "GET /WebSphereSamples/YourCo/index.jsp HTTP/1.1" 200 4684
56
9.26.157.44 - - [16/Jan/2003:21:25:01 -0500] "GET /WebSphereSamples/YourCo/main.html HTTP/1.1" 200 819
57
9.26.157.44 - - [16/Jan/2003:21:25:01 -0500] "GET /WebSphereSamples/YourCo/top.html HTTP/1.1" 200 2033
58
9.26.157.44 - - [16/Jan/2003:21:25:01 -0500] "GET /WebSphereSamples/YourCo/nav.jsp HTTP/1.1" 200 675
59
9.26.157.44 - - [16/Jan/2003:21:25:01 -0500] "GET /WebSphereSamples/servlet/WebSphereSamples.YourCo.Customization.Center HTTP/1.1" 200 3448
60
9.26.157.44 - - [16/Jan/2003:21:25:05 -0500] "GET /WebSphereSamples/servlet/WebSphereSamples.YourCo.News.NewsServlet HTTP/1.1" 200 4633
61
9.26.157.44 - - [16/Jan/2003:21:25:05 -0500] "GET /WebSphereSamples/YourCo/WhitePages/frameset.html HTTP/1.1" 304 0
62
9.26.157.44 - - [16/Jan/2003:21:25:06 -0500] "GET /WebSphereSamples/servlet/WebSphereSamples.YourCo.WhitePages.SelectNames HTTP/1.1" 200 8121
63
9.26.157.44 - - [16/Jan/2003:21:25:10 -0500] "GET /WebSphereSamples/YourCo/WhitePages/blank.html HTTP/1.1" 304 0
64
9.26.157.44 - - [16/Jan/2003:21:25:33 -0500] "GET /WebSphereSamples/servlet/WebSphereSamples.YourCo.News.NewsServlet/TheExpiringHTMLServlet HTTP/1.1" 200 4633
65
9.131.0.90 - - [16/Jan/2003:22:49:00 -0500] "GET /scripts/root.exe?/c+dir HTTP/1.0" 404 279
66
9.131.0.90 - - [16/Jan/2003:22:49:01 -0500] "GET /MSADC/root.exe?/c+dir HTTP/1.0" 404 277
67
9.131.0.90 - - [16/Jan/2003:22:49:01 -0500] "GET /c/winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 287
68
9.131.0.90 - - [16/Jan/2003:22:49:02 -0500] "GET /d/winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 287
69
9.131.0.90 - - [16/Jan/2003:22:49:03 -0500] "GET /scripts/..%255c../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 301
70
9.131.0.90 - - [16/Jan/2003:22:49:03 -0500] "GET /_vti_bin/..%255c../..%255c../..%255c../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 318
71
9.131.0.90 - - [16/Jan/2003:22:49:04 -0500] "GET /_mem_bin/..%255c../..%255c../..%255c../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 318
72
9.131.0.90 - - [16/Jan/2003:22:49:04 -0500] "GET /msadc/..%255c../..%255c../..%255c/..%c1%1c../..%c1%1c../..%c1%1c../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 334
73
9.131.0.90 - - [16/Jan/2003:22:49:05 -0500] "GET /scripts/..%c1%1c../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 300
74
9.131.0.90 - - [16/Jan/2003:22:49:05 -0500] "GET /scripts/..%c0%2f../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 300
75
9.131.0.90 - - [16/Jan/2003:22:49:06 -0500] "GET /scripts/..%c0%af../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 300
76
9.131.0.90 - - [16/Jan/2003:22:49:07 -0500] "GET /scripts/..%c1%9c../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 300
77
9.131.0.90 - - [16/Jan/2003:22:49:07 -0500] "GET /scripts/..%%35%63../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 400 284
78
9.131.0.90 - - [16/Jan/2003:22:49:08 -0500] "GET /scripts/..%%35c../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 400 284
79
9.131.0.90 - - [16/Jan/2003:22:49:08 -0500] "GET /scripts/..%25%35%63../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 301
80
9.131.0.90 - - [16/Jan/2003:22:49:09 -0500] "GET /scripts/..%252f../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 301
81
9.26.157.44 - - [17/Jan/2003:11:09:45 -0500] "GET /WebSphereSamples/SingleSamples/SamplesDocs/BeanScripting/BeanScriptingIntro.html HTTP/1.1" 200 2411
82
9.26.157.44 - - [17/Jan/2003:11:09:45 -0500] "GET /WebSphereSamples/SingleSamples/SamplesDocs/BeanScripting/BeanScripting.gif HTTP/1.1" 200 26640
83
9.26.157.44 - - [17/Jan/2003:11:09:50 -0500] "GET /WebSphereSamples/SingleSamples/BeanScripting/BeanScripting_java.jsp HTTP/1.1" 200 1781
84
9.26.157.44 - - [17/Jan/2003:11:09:56 -0500] "GET /WebSphereSamples/SingleSamples/SamplesDocs/StockQuote/StockQuoteIntro.html HTTP/1.1" 200 2668
85
9.26.157.44 - - [17/Jan/2003:11:09:56 -0500] "GET /WebSphereSamples/SingleSamples/SamplesDocs/StockQuote/StockQuote.gif HTTP/1.1" 200 21575
86
9.26.157.44 - - [17/Jan/2003:11:09:59 -0500] "GET /WebSphereSamples/SingleSamples/servlet/WebSphereSamples.StockQuote.StockQuoteServlet HTTP/1.1" 200 1814
87
9.26.157.44 - - [17/Jan/2003:11:10:10 -0500] "POST /WebSphereSamples/SingleSamples/StockQuoteServlet HTTP/1.1" 200 884
88
9.26.157.44 - - [17/Jan/2003:11:10:29 -0500] "GET /WebSphereSamples/SingleSamples/SamplesDocs/Xml/XMLIntro.html HTTP/1.1" 200 2684
89
9.26.157.44 - - [17/Jan/2003:11:10:29 -0500] "GET /WebSphereSamples/SingleSamples/SamplesDocs/Xml/XML.gif HTTP/1.1" 200 28055
90
9.26.103.101 - - [17/Jan/2003:11:10:33 -0500] "GET /WebSphereSamples/SingleSamples/XML/catalog.xml HTTP/1.1" 200 1112
91
9.26.103.101 - - [17/Jan/2003:11:10:33 -0500] "GET /WebSphereSamples/SingleSamples/XML/catalog.xml HTTP/1.1" 200 1112
92
9.26.103.101 - - [17/Jan/2003:11:10:34 -0500] "GET /WebSphereSamples/SingleSamples/XML/booklist1.xsl HTTP/1.1" 200 1161
93
9.26.157.44 - - [17/Jan/2003:11:10:36 -0500] "GET /WebSphereSamples/SingleSamples/servlet/WebSphereSamples.Xml.ApplyXSLT?URL=/WebSphereSamples/SingleSamples/XML/catalog.xml&xslURL=/WebSphereSamples/SingleSamples/XML/booklist1.xsl HTTP/1.1" 200 277
94
9.26.157.44 - - [17/Jan/2003:11:15:54 -0500] "GET /WebSphereSamples/YourCo/index.jsp HTTP/1.1" 200 4684
95
9.26.157.44 - - [17/Jan/2003:11:15:54 -0500] "GET /theme/YourCo.css HTTP/1.1" 304 0
96
9.26.157.44 - - [17/Jan/2003:11:15:54 -0500] "GET /theme/bg.gif HTTP/1.1" 304 0
97
9.26.157.44 - - [17/Jan/2003:11:15:55 -0500] "GET /theme/topBanner.gif HTTP/1.1" 304 0
98
9.26.157.44 - - [17/Jan/2003:11:15:55 -0500] "GET /theme/buttonDWN.gif HTTP/1.1" 304 0
99
9.26.157.44 - - [17/Jan/2003:11:15:55 -0500] "GET /theme/button.gif HTTP/1.1" 304 0
100
9.26.157.44 - - [17/Jan/2003:11:15:55 -0500] "GET /theme/horzLine.gif HTTP/1.1" 304 0
101
9.26.157.44 - - [17/Jan/2003:11:15:55 -0500] "GET /theme/circleLine.gif HTTP/1.1" 304 0
102
9.26.157.44 - - [17/Jan/2003:11:15:55 -0500] "GET /theme/photo01.jpg HTTP/1.1" 304 0
103
9.26.157.44 - - [17/Jan/2003:11:15:56 -0500] "GET /WebSphereSamples/servlet/WebSphereSamples.YourCo.News.NewsServlet/TheExpiringHTMLServlet HTTP/1.1" 200 4715
104
9.26.157.44 - - [17/Jan/2003:11:15:57 -0500] "GET /WebSphereSamples/YourCo/index.jsp HTTP/1.1" 200 4684
105
9.26.157.44 - - [17/Jan/2003:11:16:08 -0500] "GET /WSsamples/TradeIntro/TradeSampleIntro.html HTTP/1.1" 200 2520
106
9.26.157.44 - - [17/Jan/2003:11:16:08 -0500] "GET /WSsamples/TradeIntro/TradeSample.gif HTTP/1.1" 200 12317
107
9.26.157.44 - - [17/Jan/2003:11:16:08 -0500] "GET /WSsamples/images/run.jpg HTTP/1.1" 200 6124
108
9.26.157.44 - - [17/Jan/2003:11:16:12 -0500] "GET /WSsamples/Configuration/Trade/Setup.html HTTP/1.1" 200 2526
109
9.26.157.44 - - [17/Jan/2003:11:16:13 -0500] "GET /WSsamples/images/clearPixel.gif HTTP/1.1" 304 -
110
9.26.157.44 - - [17/Jan/2003:11:16:16 -0500] "GET /WSsamples/Configuration/Trade/DB2/task1.html HTTP/1.1" 200 4324
111
9.26.157.44 - - [17/Jan/2003:11:16:16 -0500] "GET /WSsamples/images/takeNote.gif HTTP/1.1" 304 -
112
9.26.157.44 - - [17/Jan/2003:11:16:16 -0500] "GET /WSsamples/images/arrow.gif HTTP/1.1" 200 91
113
9.26.157.44 - - [17/Jan/2003:11:16:20 -0500] "GET /WebSphereSamples/SingleSamples/SamplesDocs/HelloEJB/HelloEJBIntro.html HTTP/1.1" 200 1612
114
9.26.157.44 - - [17/Jan/2003:11:16:20 -0500] "GET /theme/Master.css HTTP/1.1" 304 0
115
9.26.157.44 - - [17/Jan/2003:11:16:20 -0500] "GET /theme/SamplesMaster.css HTTP/1.1" 304 0
116
9.26.157.44 - - [17/Jan/2003:11:16:20 -0500] "GET /WebSphereSamples/SingleSamples/SamplesDocs/HelloEJB/HelloEJB.gif HTTP/1.1" 200 27794
117
9.26.157.44 - - [17/Jan/2003:11:16:20 -0500] "GET /theme/run.jpg HTTP/1.1" 304 0
118
9.26.157.44 - - [17/Jan/2003:11:16:20 -0500] "GET /theme/technotes.jpg HTTP/1.1" 304 0
119
9.26.157.44 - - [17/Jan/2003:11:16:24 -0500] "GET /WebSphereSamples/SingleSamples/HelloEJB/HelloEJB.jsp HTTP/1.1" 200 620
120
9.26.157.44 - - [17/Jan/2003:11:16:55 -0500] "GET /WebSphereSamples/SingleSamples/SamplesDocs/Increment/IncrementIntro.html HTTP/1.1" 200 1747
121
9.26.157.44 - - [17/Jan/2003:11:16:55 -0500] "GET /WebSphereSamples/SingleSamples/SamplesDocs/Increment/Increment.gif HTTP/1.1" 200 44263
122
9.26.157.44 - - [17/Jan/2003:11:17:00 -0500] "GET /WebSphereSamples/SingleSamples/Increment/increment.html HTTP/1.1" 200 1077
123
9.26.157.44 - - [17/Jan/2003:11:17:04 -0500] "GET /WebSphereSamples/SingleSamples/servlet/WebSphereSamples.Increment.VisitIncrementSite?submit=Visit HTTP/1.1" 200 559
124
9.26.157.44 - - [17/Jan/2003:11:17:05 -0500] "GET /WebSphereSamples/SingleSamples/servlet/WebSphereSamples.Increment.VisitIncrementSite?submit=Visit+Again HTTP/1.1" 200 559
125
9.26.157.44 - - [17/Jan/2003:11:17:06 -0500] "GET /WebSphereSamples/SingleSamples/servlet/WebSphereSamples.Increment.VisitIncrementSite?submit=Visit+Again HTTP/1.1" 200 559
126
9.26.157.44 - - [17/Jan/2003:11:17:07 -0500] "GET /WebSphereSamples/SingleSamples/servlet/WebSphereSamples.Increment.VisitIncrementSite?submit=Visit+Again HTTP/1.1" 200 559
127
9.26.157.44 - - [17/Jan/2003:11:17:08 -0500] "GET /WebSphereSamples/SingleSamples/servlet/WebSphereSamples.Increment.VisitIncrementSite?submit=Visit+Again HTTP/1.1" 200 559
128
9.26.157.44 - - [17/Jan/2003:11:17:08 -0500] "GET /WebSphereSamples/SingleSamples/servlet/WebSphereSamples.Increment.VisitIncrementSite?submit=Visit+Again HTTP/1.1" 200 559
129
9.26.157.44 - - [17/Jan/2003:11:17:09 -0500] "GET /WebSphereSamples/SingleSamples/servlet/WebSphereSamples.Increment.VisitIncrementSite?submit=Visit+Again HTTP/1.1" 200 559
130
9.26.157.44 - - [17/Jan/2003:11:17:10 -0500] "GET /WebSphereSamples/SingleSamples/servlet/WebSphereSamples.Increment.VisitIncrementSite?submit=Visit+Again HTTP/1.1" 200 559
131
9.26.157.44 - - [17/Jan/2003:11:17:11 -0500] "GET /WebSphereSamples/SingleSamples/servlet/WebSphereSamples.Increment.VisitIncrementSite?submit=Visit+Again HTTP/1.1" 200 559
132
9.26.157.44 - - [17/Jan/2003:11:17:13 -0500] "GET /WebSphereSamples/SingleSamples/servlet/WebSphereSamples.Increment.VisitIncrementSite?submit=Visit HTTP/1.1" 200 560
133
9.26.157.44 - - [17/Jan/2003:11:17:17 -0500] "GET /WebSphereSamples/YourCoDocs/YourCoIntro.html HTTP/1.1" 304 0
134
9.26.157.44 - - [17/Jan/2003:11:17:17 -0500] "GET /WebSphereSamples/YourCoDocs/YourCoSample.jpg HTTP/1.1" 304 0
135
9.26.157.44 - - [17/Jan/2003:11:17:21 -0500] "GET /WebSphereSamples/YourCo/index.jsp HTTP/1.1" 200 4684
136
9.26.157.44 - - [17/Jan/2003:11:17:21 -0500] "GET /theme/YourCo.css HTTP/1.1" 304 0
137
9.26.157.44 - - [17/Jan/2003:11:17:21 -0500] "GET /theme/topBanner.gif HTTP/1.1" 304 0
138
9.26.157.44 - - [17/Jan/2003:11:17:21 -0500] "GET /theme/buttonDWN.gif HTTP/1.1" 304 0
139
9.26.157.44 - - [17/Jan/2003:11:17:21 -0500] "GET /theme/bg.gif HTTP/1.1" 304 0
140
9.26.157.44 - - [17/Jan/2003:11:17:21 -0500] "GET /theme/circleLine.gif HTTP/1.1" 304 0
141
9.26.157.44 - - [17/Jan/2003:11:17:21 -0500] "GET /theme/photo01.jpg HTTP/1.1" 304 0
142
9.26.157.44 - - [17/Jan/2003:11:17:21 -0500] "GET /theme/button.gif HTTP/1.1" 304 0
143
9.26.157.44 - - [17/Jan/2003:11:17:21 -0500] "GET /theme/horzLine.gif HTTP/1.1" 304 0
144
9.26.157.44 - - [17/Jan/2003:11:17:23 -0500] "GET /WebSphereSamples/YourCo/WhitePages/frameset.html HTTP/1.1" 304 0
145
9.26.157.44 - - [17/Jan/2003:11:17:23 -0500] "GET /WebSphereSamples/YourCo/WhitePages/blank.html HTTP/1.1" 304 0
146
9.26.157.44 - - [17/Jan/2003:11:17:23 -0500] "GET /WebSphereSamples/servlet/WebSphereSamples.YourCo.WhitePages.SelectNames HTTP/1.1" 200 8121
147
9.26.157.44 - - [17/Jan/2003:11:17:27 -0500] "POST /WebSphereSamples/servlet/WebSphereSamples.YourCo.WhitePages.ByName HTTP/1.1" 200 1108
148
9.26.157.44 - - [17/Jan/2003:11:32:18 -0500] "POST /WebSphereSamples/servlet/WebSphereSamples.YourCo.WhitePages.ByName HTTP/1.1" 500 605
149
9.26.157.44 - - [17/Jan/2003:11:32:27 -0500] "POST /WebSphereSamples/servlet/WebSphereSamples.YourCo.WhitePages.ByName HTTP/1.1" 500 605
150
9.26.157.44 - - [17/Jan/2003:11:32:42 -0500] "GET /WSsamples/en/index.html HTTP/1.1" 404 298
151
9.26.157.44 - - [17/Jan/2003:11:32:45 -0500] "GET /WSsamples HTTP/1.1" 301 315
152
9.26.157.44 - - [17/Jan/2003:11:32:45 -0500] "GET /WSsamples/ HTTP/1.1" 304 -
153
9.26.157.44 - - [17/Jan/2003:11:32:45 -0500] "GET /WSsamples/Master.css HTTP/1.1" 304 -
154
9.26.157.44 - - [17/Jan/2003:11:32:45 -0500] "GET /WSsamples/Menu/Cube.html HTTP/1.1" 304 -
155
9.26.157.44 - - [17/Jan/2003:11:32:45 -0500] "GET /WSsamples/Menu/Logo.html HTTP/1.1" 304 -
156
9.26.157.44 - - [17/Jan/2003:11:32:45 -0500] "GET /WSsamples/Menu/Title.html HTTP/1.1" 304 -
157
9.26.157.44 - - [17/Jan/2003:11:32:45 -0500] "GET /WSsamples/Menu/Menu.html HTTP/1.1" 304 -
158
9.26.157.44 - - [17/Jan/2003:11:32:45 -0500] "GET /WSsamples/Menu/Curve.html HTTP/1.1" 304 -
159
9.26.157.44 - - [17/Jan/2003:11:32:45 -0500] "GET /WSsamples/Menu/SamplesIntro.html HTTP/1.1" 304 -
160
9.26.157.44 - - [17/Jan/2003:11:32:45 -0500] "GET /WSsamples/images/globecube.jpg HTTP/1.1" 304 -
161
9.26.157.44 - - [17/Jan/2003:11:32:45 -0500] "GET /WSsamples/images/bluebackdark.jpg HTTP/1.1" 304 -
162
9.26.157.44 - - [17/Jan/2003:11:32:45 -0500] "GET /WSsamples/images/ibm_logo_sm_fff.gif HTTP/1.1" 304 -
163
9.26.157.44 - - [17/Jan/2003:11:32:45 -0500] "GET /WSsamples/images/server.jpg HTTP/1.1" 304 -
164
9.26.157.44 - - [17/Jan/2003:11:32:45 -0500] "GET /WSsamples/SamplesMaster.css HTTP/1.1" 304 -
165
9.26.157.44 - - [17/Jan/2003:11:32:45 -0500] "GET /WSsamples/images/curve.jpg HTTP/1.1" 304 -
166
9.26.157.44 - - [17/Jan/2003:11:32:45 -0500] "GET /WSsamples/images/clearPixel.gif HTTP/1.1" 304 -
167
9.26.157.44 - - [17/Jan/2003:11:32:46 -0500] "GET /WSsamples/images/stripes_repeat.jpg HTTP/1.1" 304 -
168
9.26.157.44 - - [17/Jan/2003:11:36:35 -0500] "GET /WebSphereSamples/YourCoDocs/YourCoIntro.html HTTP/1.1" 304 0
169
9.26.157.44 - - [17/Jan/2003:11:36:35 -0500] "GET /theme/Master.css HTTP/1.1" 304 0
170
9.26.157.44 - - [17/Jan/2003:11:36:35 -0500] "GET /theme/SamplesMaster.css HTTP/1.1" 304 0
171
9.26.157.44 - - [17/Jan/2003:11:36:36 -0500] "GET /theme/run.jpg HTTP/1.1" 304 0
172
9.26.157.44 - - [17/Jan/2003:11:36:36 -0500] "GET /WebSphereSamples/YourCoDocs/YourCoSample.jpg HTTP/1.1" 304 0
173
9.26.157.44 - - [17/Jan/2003:11:36:36 -0500] "GET /theme/technotes.jpg HTTP/1.1" 304 0
174
9.26.157.44 - - [17/Jan/2003:11:36:40 -0500] "GET /WebSphereSamples/YourCo/index.jsp HTTP/1.1" 200 4684
175
9.26.157.44 - - [17/Jan/2003:11:36:45 -0500] "GET /WebSphereSamples/servlet/WebSphereSamples.YourCo.News.NewsServlet HTTP/1.1" 200 4771
176
9.26.157.44 - - [17/Jan/2003:11:36:51 -0500] "GET /WebSphereSamples/servlet/WebSphereSamples.YourCo.WhitePages.SelectNames HTTP/1.1" 200 8121
177
9.26.157.44 - - [17/Jan/2003:11:36:53 -0500] "POST /WebSphereSamples/servlet/WebSphereSamples.YourCo.WhitePages.ByName HTTP/1.1" 200 1110
178
9.26.157.44 - - [17/Jan/2003:11:36:58 -0500] "POST /WebSphereSamples/servlet/WebSphereSamples.YourCo.WhitePages.ByName HTTP/1.1" 200 1108
179
9.26.64.68 - - [17/Jan/2003:11:36:58 -0500] "GET /cgi-bin/htsearch?Exclude="%60/etc/passwd%60" HTTP/1.0" 404 210 "-" "Network-Services-Auditor/1.3.1"
180
9.26.64.68 - - [17/Jan/2003:11:36:58 -0500] "GET /cgi-bin/webdist.cgi?distloc=";cat%20/etc/passwd" HTTP/1.0" 404 213 "-" "Network-Services-Auditor/1.3.1"
181
9.26.64.68 - - [17/Jan/2003:11:37:01 -0500] "GET /scripts/nc.exe?/c"-h" HTTP/1.0" 404 208 "-" "Network-Services-Auditor/1.3.1"
182
9.26.64.68 - - [17/Jan/2003:11:37:11 -0500] "GET /ibmlink?request="><script>alert(document.domain)</script> HTTP/1.0" 404 201 "-" "Network-Services-Auditor/1.3.1"
183
9.26.64.68 - - [17/Jan/2003:11:51:52 -0500] "GET /cgi-bin/bizdb1-search.cgi?template=bizdb-summary&dbname=id;cat /etc/passwd|&f6=^a.*&action=searchdbdisplay HTTP/1.0" 404 219 "http://host.blah.com/cgi-bin/bizdb1-search.cgi?bizdb-search" "Network-Services-Auditor/1.3.1"
184
9.26.64.68 - - [17/Jan/2003:11:52:10 -0500] "GET /level/16/exec/show                   0onf HTTP/1.0" 404 212 "-" "Network-Services-Auditor/1.3.1"
185
9.26.64.68 - - [17/Jan/2003:11:52:10 -0500] "GET /level/17/exec/show                    onf HTTP/1.0" 404 212 "-" "Network-Services-Auditor/1.3.1"
186
9.26.64.68 - - [17/Jan/2003:11:55:43 -0500] "GET /level/63/exec/show                    onf HTTP/1.0" 404 212 "-" "Network-Services-Auditor/1.3.1"
(-)testFiles/GenericLogAdapter/config/APITests/Adapter/Valid.adapter (+175 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!--
3
	Copyright (c) 2005,2007 IBM Corporation and others.
4
	All rights reserved. This program and the accompanying materials
5
	are made available under the terms of the Eclipse Public License v1.0
6
	which accompanies this distribution, and is available at
7
	http://www.eclipse.org/legal/epl-v10.html
8
	$Id: regex_example.adapter,v 1.9 2007/03/11 06:35:05 dnsmith Exp $
9
	
10
	Contributors:
11
	IBM - Initial API and implementation
12
-->
13
<adapter:Adapter xmlns:adapter="http://www.eclipse.org/hyades/schema/Adapter.xsd" xmlns:cc="http://www.eclipse.org/hyades/schema/ComponentConfiguration.xsd" xmlns:ex="http://www.eclipse.org/hyades/schema/Extractor.xsd" xmlns:fmt="http://www.eclipse.org/hyades/schema/Formatter.xsd" xmlns:hga="http://www.eclipse.org/hyades/schema/Context.xsd" xmlns:op="http://www.eclipse.org/hyades/schema/Outputter.xsd" xmlns:parser="http://www.eclipse.org/hyades/schema/Parser.xsd" xmlns:pu="http://www.eclipse.org/hyades/schema/ProcessUnit.xsd" xmlns:sensor="http://www.eclipse.org/hyades/schema/Sensor.xsd">
14
  <hga:Contexts>
15
    <hga:Context description="Context Instance for the current component" executableClass="org.eclipse.hyades.logging.adapter.impl.BasicContext" implementationCreationDate="2003-10-07T12:00:00" implementationVersion="1.0.0" loggingLevel="50" name="Basic Context Implementation" role="context" roleCreationDate="2003-10-07T12:00:00" roleVersion="1.0.0" uniqueID="N35B6D910F8511D88000A31D7605087A">
16
      <hga:Component description="Operating System file sensor" executableClass="org.eclipse.hyades.logging.adapter.sensors.SingleOSFileSensor" implementationCreationDate="2003-10-07T12:00:00" implementationVersion="1.0.0" loggingLevel="50" name="OS File Sensor" role="sensor" roleCreationDate="2003-10-07T12:00:00" roleVersion="1.0.0" uniqueID="N3604F900F8511D88000A31D7605087A"/>
17
      <hga:Component description="This extractor uses regular expression  patterns to identify record delimiters" executableClass="org.eclipse.hyades.logging.adapter.extractors.RegularExpressionExtractor" implementationCreationDate="2003-10-07T12:00:00" implementationVersion="1.0.0" loggingLevel="50" name="Regular Expression Extractor" role="messageExtractor" roleCreationDate="2003-10-07T12:00:00" roleVersion="1.0.0" uniqueID="N36299800F8511D88000A31D7605087A"/>
18
      <hga:Component description="Regular expression parser" executableClass="org.eclipse.hyades.logging.adapter.parsers.Parser" implementationCreationDate="2003-10-07T12:00:00" implementationVersion="1.0.0" loggingLevel="50" name="Generic Parser" role="parser" roleCreationDate="2003-10-07T12:00:00" roleVersion="1.0.0" uniqueID="N3650A800F8511D88000A31D7605087A"/>
19
      <hga:Component description="CBE Formatter" executableClass="org.eclipse.hyades.logging.adapter.formatters.CBEFormatter" implementationCreationDate="2003-10-07T12:00:00" implementationVersion="1.0.0" loggingLevel="50" name="CBE Formatter" role="formatter" roleCreationDate="2003-10-07T12:00:00" roleVersion="1.0.0" uniqueID="N36C36700F8511D88000A31D7605087A"/>
20
      <hga:Component description="CBE File Outputter" executableClass="org.eclipse.hyades.logging.adapter.outputters.CBEFileOutputter" implementationCreationDate="2003-10-07T12:00:00" implementationVersion="1.0.0" implementationVersionDescription="" loggingLevel="50" name="CBEFileOutputter" role="outputter" roleCreationDate="2003-10-07T12:00:00" roleVersion="1.0.0" uniqueID="N36E80600F8511D88000A31D7605087A"/>
21
    </hga:Context>
22
  </hga:Contexts>
23
  <cc:Configuration description="The component level configurations for this adapter" uniqueID="N35B6D900F8511D88000A31D7605087A">
24
    <cc:ContextInstance charset="" continuousOperation="true" description="Context Instance for the current component" isoCountryCode="US" isoLanguageCode="en" maximumIdleTime="50000" pauseInterval="10" uniqueID="N35B6D910F8511D88000A31D7605087A">
25
      <cc:Sensor description="A single file sensor" uniqueID="N3604F900F8511D88000A31D7605087A" confidenceBufferSize="512" fileFooterSize="0" maximumBlocking="10" type="SingleFileSensor">
26
        <pu:Property propertyName="directory" propertyValue="."/>
27
        <pu:Property propertyName="fileName" propertyValue="example.log"/>
28
        <sensor:SingleFileSensor directory="." fileName="example.log"/>
29
      </cc:Sensor>
30
      <ex:Extractor description="This extractor uses regular expression  patterns to identify record delimiters" uniqueID="N36299800F8511D88000A31D7605087A" containsLineBreaks="true" endPattern="$" includeEndPattern="false" includeStartPattern="true" lineBreakSymbol="" replaceLineBreaks="false" startPattern="^(\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3})|(\S+)"/>
31
      <cc:Parser separatorToken="\s+" uniqueID="N3650A800F8511D88000A31D7605087A">
32
        <parser:RuleElement index="N3650A810F8511D88000A31D7605087A" name="CommonBaseEvent">
33
          <parser:RuleElement index="N8CA7C54002A11D88000C6FD28070181" name="sourceComponentId">
34
            <parser:RuleAttribute defaultValue="Apache HTTP Server" index="ND66C0C1002A11D88000C6FD28070181" name="component" usePreviousMatchSubstitutionAsDefault="false"/>
35
            <parser:RuleAttribute defaultValue="Unknown" index="N77CD869002A11D88000C6FD28070181" name="subComponent" usePreviousMatchSubstitutionAsDefault="false"/>
36
            <parser:RuleAttribute defaultValue="ProductName" index="N12069D2002A11D88000C6FD28070181" name="componentIdType" usePreviousMatchSubstitutionAsDefault="false"/>
37
            <parser:RuleAttribute index="N3AB0CD6010F11D88000873B061CB0B3" name="location" usePreviousMatchSubstitutionAsDefault="false">
38
              <SubstitutionRule substitute="" useBuiltInFunction="true"/>
39
            </parser:RuleAttribute>
40
            <parser:RuleAttribute index="NCD2CCD7010F11D88000873B061CB0B3" name="locationType" usePreviousMatchSubstitutionAsDefault="false">
41
              <SubstitutionRule substitute="" useBuiltInFunction="true"/>
42
            </parser:RuleAttribute>
43
            <parser:RuleAttribute defaultValue="HTTPServer" index="NDE661030DAB11D88000930FA6625271" name="componentType" usePreviousMatchSubstitutionAsDefault="false"/>
44
          </parser:RuleElement>
45
          <parser:RuleElement index="N8273E56002C11D88000C6FD28070181" isChildChoice="true" name="situation">
46
            <parser:RuleElement index="NF8AFFE9002F11D88000C6FD28070181" name="RequestSituation">
47
              <parser:RuleAttribute index="N2815562002F11D88000C6FD28070181" isRequiredByParent="true" name="successDisposition" usePreviousMatchSubstitutionAsDefault="false">
48
                <SubstitutionRule match="(2\d{2}|3\d{2}|1\d{2})" positions="8" substitute="SUCCESSFUL"/>
49
                <SubstitutionRule match="(2\d{2}|3\d{2}|1\d{2})" positions="9" substitute="SUCCESSFUL"/>
50
                <SubstitutionRule match="(4\d{2}|5\d{2})" positions="8" substitute="UNSUCCESSFUL"/>
51
                <SubstitutionRule match="(4\d{2}|5\d{2})" positions="9" substitute="UNSUCCESSFUL" useBuiltInFunction="false"/>
52
                <SubstitutionRule match="(\&quot;\-\&quot;)@@(2\d{2}|3\d{2}|1\d{2})" positions="6@@7" substitute="SUCCESSFUL" useBuiltInFunction="false"/>
53
                <SubstitutionRule match="(\&quot;\-\&quot;)@@(4\d{2}|5\d{2})" positions="6@@7" substitute="UNSUCCESSFUL" useBuiltInFunction="false"/>
54
              </parser:RuleAttribute>
55
              <parser:RuleAttribute defaultValue="REQUEST COMPLETED" index="N30BA5C1002F11D88000C6FD28070181" name="situationQualifier" usePreviousMatchSubstitutionAsDefault="false">
56
                <SubstitutionRule match="(202|3\d{2}|1\d{2}|4\d{2}|5\d{2})" positions="8" substitute="REQUEST INITIATED"/>
57
                <SubstitutionRule match="(202|3\d{2}|1\d{2}|4\d{2}|5\d{2})" positions="9" substitute="REQUEST INITIATED"/>
58
                <SubstitutionRule match="(\&quot;\-\&quot;)@@(202|3\d{2}|1\d{2}|4\d{2}|5\d{2})" positions="6@@7" substitute="REQUEST INITIATED" useBuiltInFunction="false"/>
59
              </parser:RuleAttribute>
60
              <parser:RuleAttribute defaultValue="EXTERNAL" index="NCCBFC40002F11D88000C6FD28070181" name="reasoningScope" usePreviousMatchSubstitutionAsDefault="false"/>
61
            </parser:RuleElement>
62
            <parser:RuleElement index="N224169A084711D8800091856AF4A65C" name="ReportSituation">
63
              <parser:RuleAttribute defaultValue="INTERNAL" index="N224169B084711D8800091856AF4A65C" name="reasoningScope" usePreviousMatchSubstitutionAsDefault="false"/>
64
              <parser:RuleAttribute defaultValue="LOG" index="N224169C084711D8800091856AF4A65C" name="reportCategory" usePreviousMatchSubstitutionAsDefault="false"/>
65
            </parser:RuleElement>
66
          </parser:RuleElement>
67
          <parser:RuleElement index="NF4E4C51002C11D88000C6FD28070181" name="extendedDataElements">
68
            <parser:RuleElement index="NEA78170002C11D88000C6FD28070181" isRequiredByParent="true" name="values">
69
              <parser:RuleAttribute index="N0060000002D11D88000C6FD28070181" name="values" usePreviousMatchSubstitutionAsDefault="false">
70
                <SubstitutionRule match="(\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3})" positions="1" substitute="$1"/>
71
              </parser:RuleAttribute>
72
            </parser:RuleElement>
73
            <parser:RuleAttribute defaultValue="Client" index="N2CA0593002C11D88000C6FD28070181" name="name" usePreviousMatchSubstitutionAsDefault="false"/>
74
            <parser:RuleAttribute defaultValue="string" index="NE6BC644002C11D88000C6FD28070181" name="type" usePreviousMatchSubstitutionAsDefault="false"/>
75
          </parser:RuleElement>
76
          <parser:RuleElement index="N9A75941002D11D88000C6FD28070181" name="extendedDataElements">
77
            <parser:RuleElement index="NE1B1FE0002D11D88000C6FD28070181" isRequiredByParent="true" name="values">
78
              <parser:RuleAttribute index="NF0BE880002D11D88000C6FD28070181" name="values" usePreviousMatchSubstitutionAsDefault="false">
79
                <SubstitutionRule match="(\d{3})" positions="8" substitute="$1"/>
80
                <SubstitutionRule match="(\d{3})" positions="9" substitute="$1"/>
81
                <SubstitutionRule match="\&quot;\S+\&quot;@@(\d{3})" positions="6@@7" substitute="$1" useBuiltInFunction="false"/>
82
              </parser:RuleAttribute>
83
            </parser:RuleElement>
84
            <parser:RuleAttribute defaultValue="return_code" index="NAE6B713002D11D88000C6FD28070181" name="name" usePreviousMatchSubstitutionAsDefault="false"/>
85
            <parser:RuleAttribute defaultValue="short" index="NA82DDF4002D11D88000C6FD28070181" name="type" usePreviousMatchSubstitutionAsDefault="false"/>
86
          </parser:RuleElement>
87
          <parser:RuleElement index="N704BAD1002D11D88000C6FD28070181" isRequiredByParent="false" name="extendedDataElements">
88
            <parser:RuleElement index="NED77220002D11D88000C6FD28070181" isRequiredByParent="true" name="values">
89
              <parser:RuleAttribute index="N0206CE0002D11D88000C6FD28070181" name="values" usePreviousMatchSubstitutionAsDefault="false">
90
                <SubstitutionRule match="\&quot;\S+@@(.*)" positions="6@@7" substitute="$1" useBuiltInFunction="false"/>
91
              </parser:RuleAttribute>
92
            </parser:RuleElement>
93
            <parser:RuleAttribute defaultValue="string" index="N84689A4002D11D88000C6FD28070181" name="type" usePreviousMatchSubstitutionAsDefault="false"/>
94
            <parser:RuleAttribute defaultValue="File" index="NC265BE1002D11D88000C6FD28070181" name="name" usePreviousMatchSubstitutionAsDefault="false"/>
95
          </parser:RuleElement>
96
          <parser:RuleElement index="N7F86201003311D88000C6FD28070181" name="extendedDataElements">
97
            <parser:RuleElement index="NB59C730003311D88000C6FD28070181" isRequiredByParent="true" name="values">
98
              <parser:RuleAttribute index="NC6013A0003311D88000C6FD28070181" name="values" usePreviousMatchSubstitutionAsDefault="false">
99
                <SubstitutionRule match="\&quot;(\w+)\&quot;" positions="6" substitute="$1"/>
100
                <SubstitutionRule match="\&quot;(\w+)" positions="6" substitute="$1"/>
101
                <SubstitutionRule match="\&quot;(\S+)\&quot;" positions="6" substitute="$1"/>
102
              </parser:RuleAttribute>
103
            </parser:RuleElement>
104
            <parser:RuleAttribute defaultValue="string" index="NF34CCC4003311D88000C6FD28070181" name="type" usePreviousMatchSubstitutionAsDefault="false"/>
105
            <parser:RuleAttribute defaultValue="method" index="N4B83CE3003311D88000C6FD28070181" name="name" usePreviousMatchSubstitutionAsDefault="false"/>
106
          </parser:RuleElement>
107
          <parser:RuleElement index="ND054C63078911D880008B85FEE72030" name="extendedDataElements">
108
            <parser:RuleElement index="NE249F10078911D880008B85FEE72030" isRequiredByParent="true" name="values">
109
              <parser:RuleAttribute index="N0E370F0078911D880008B85FEE72030" name="values" usePreviousMatchSubstitutionAsDefault="false">
110
                <SubstitutionRule match="\&quot;(\S+)\&quot;" positions="11" substitute="$1" useBuiltInFunction="false"/>
111
                <SubstitutionRule match="\&quot;(\S+)\&quot;" positions="10" substitute="$1" useBuiltInFunction="false"/>
112
              </parser:RuleAttribute>
113
            </parser:RuleElement>
114
            <parser:RuleAttribute defaultValue="Referer" index="ND054C64078911D880008B85FEE72030" name="name" usePreviousMatchSubstitutionAsDefault="false"/>
115
            <parser:RuleAttribute defaultValue="string" index="ND054C65078911D880008B85FEE72030" name="type" usePreviousMatchSubstitutionAsDefault="false"/>
116
          </parser:RuleElement>
117
          <parser:RuleElement index="N143DCE3078911D880008B85FEE72030" name="extendedDataElements">
118
            <parser:RuleElement index="N281B410078911D880008B85FEE72030" isRequiredByParent="true" name="values">
119
              <parser:RuleAttribute index="N52E3670078911D880008B85FEE72030" name="values" usePreviousMatchSubstitutionAsDefault="false">
120
                <SubstitutionRule match="^.*\[.*\]\s\&quot;\w+\s+.*\&quot;\s+\S+\s+\S+\s+\&quot;\S+\&quot;\s+\&quot;(.*)\&quot;" positions="" substitute="$1" useBuiltInFunction="false"/>
121
              </parser:RuleAttribute>
122
            </parser:RuleElement>
123
            <parser:RuleAttribute defaultValue="User-agent" index="N143DCE4078911D880008B85FEE72030" name="name" usePreviousMatchSubstitutionAsDefault="false"/>
124
            <parser:RuleAttribute defaultValue="string" index="N143DCE5078911D880008B85FEE72030" name="type" usePreviousMatchSubstitutionAsDefault="false"/>
125
          </parser:RuleElement>
126
          <parser:RuleElement index="NA3A7573083F11D8800091856AF4A65C" name="extendedDataElements">
127
            <parser:RuleElement index="N1AF0730083F11D8800091856AF4A65C" isRequiredByParent="true" name="values">
128
              <parser:RuleAttribute index="N2BEF090083F11D8800091856AF4A65C" name="values" usePreviousMatchSubstitutionAsDefault="false">
129
                <SubstitutionRule match="^([^0-9][^0-9\.][^0-9\.].*)" substitute="$1" useBuiltInFunction="false"/>
130
              </parser:RuleAttribute>
131
            </parser:RuleElement>
132
            <parser:RuleAttribute defaultValue="CGI Debugging Output" index="NA3A7574083F11D8800091856AF4A65C" name="name" usePreviousMatchSubstitutionAsDefault="false"/>
133
            <parser:RuleAttribute defaultValue="string" index="NA3A7575083F11D8800091856AF4A65C" name="type" usePreviousMatchSubstitutionAsDefault="false"/>
134
          </parser:RuleElement>
135
          <parser:RuleElement index="ND88BDA309FD11D88000B70A90A10773" name="extendedDataElements">
136
            <parser:RuleElement index="NFA8B77009FD11D88000B70A90A10773" isRequiredByParent="true" name="values">
137
              <parser:RuleAttribute index="N18A21A009FE11D88000B70A90A10773" name="values" usePreviousMatchSubstitutionAsDefault="false">
138
                <SubstitutionRule match="HTTP/.*\&quot;@@(.+)" positions="8@@10" substitute="$1" useBuiltInFunction="false"/>
139
                <SubstitutionRule match=".*\&quot;@@(\d+)" positions="7@@9" substitute="$1" useBuiltInFunction="false"/>
140
              </parser:RuleAttribute>
141
            </parser:RuleElement>
142
            <parser:RuleAttribute defaultValue="file_size" index="ND88BDA409FD11D88000B70A90A10773" name="name" usePreviousMatchSubstitutionAsDefault="false"/>
143
            <parser:RuleAttribute defaultValue="string" index="ND88BDA509FD11D88000B70A90A10773" name="type" usePreviousMatchSubstitutionAsDefault="false">
144
              <SubstitutionRule match="(HTTP/.*\&quot;)@@(.+)" positions="8@@10" substitute="string" useBuiltInFunction="false"/>
145
              <SubstitutionRule match="(.*\&quot;)@@(\d+)" positions="7@@9" substitute="int" useBuiltInFunction="false"/>
146
            </parser:RuleAttribute>
147
          </parser:RuleElement>
148
          <parser:RuleAttribute defaultValue="0001-01-01T00:00:00.000000+00:00" index="N3650A820F8511D88000A31D7605087A" name="creationTime" usePreviousMatchSubstitutionAsDefault="true">
149
            <SubstitutionRule match="(.*)" positions="4@@5" substitute="$1" timeFormat="[dd/MMM/yyyy:HH:mm:ss@@z]" useBuiltInFunction="false"/>
150
          </parser:RuleAttribute>
151
          <parser:RuleAttribute index="N024368D002B11D88000C6FD28070181" name="msg" usePreviousMatchSubstitutionAsDefault="false">
152
            <SubstitutionRule match="^[^&quot;]+(\&quot;.*)" substitute="$1"/>
153
            <SubstitutionRule match="^([^\d{1,3}][^\.][^\d{1,3}].*)" substitute="$1" useBuiltInFunction="false"/>
154
          </parser:RuleAttribute>
155
          <parser:RuleAttribute defaultValue="10" index="N230EBD1002C11D88000C6FD28070181" name="severity" usePreviousMatchSubstitutionAsDefault="false">
156
            <SubstitutionRule match="5\d{2}" positions="8" substitute="60" useBuiltInFunction="false"/>
157
            <SubstitutionRule match="5\d{2}" positions="9" substitute="60" useBuiltInFunction="false"/>
158
            <SubstitutionRule match="4\d{2}" positions="8" substitute="40" useBuiltInFunction="false"/>
159
            <SubstitutionRule match="4\d{2}" positions="9" substitute="40" useBuiltInFunction="false"/>
160
            <SubstitutionRule match="\&quot;\S+\&quot;@@5\d{2}" positions="6@@7" substitute="60" useBuiltInFunction="false"/>
161
            <SubstitutionRule match="\&quot;\S+\&quot;@@4\d{2}" positions="6@@7" substitute="40" useBuiltInFunction="false"/>
162
            <SubstitutionRule match="[^\&quot;]+\&quot;[\S\s\&quot;]+\&quot;\s+5\d{2}\s+\d+.*" positions="" substitute="60" useBuiltInFunction="false"/>
163
            <SubstitutionRule match="[^\&quot;]+\&quot;[\S\s\&quot;]+\&quot;\s+4\d{2}\s+\d+.*" positions="" substitute="40" useBuiltInFunction="false"/>
164
          </parser:RuleAttribute>
165
        </parser:RuleElement>
166
      </cc:Parser>
167
      <fmt:Formatter description="CBE Formatter" uniqueID="N36C36700F8511D88000A31D7605087A"/>
168
      <cc:Outputter description="Default Logging Agent" uniqueID="N36E80600F8511D88000A31D7605087A" type="SingleFileOutputter">
169
        <pu:Property propertyName="directory" propertyValue="."/>
170
        <pu:Property propertyName="fileName" propertyValue="example.out"/>
171
        <op:SingleFileOutputterType directory="." fileName="example.out"/>
172
      </cc:Outputter>
173
    </cc:ContextInstance>
174
  </cc:Configuration>
175
</adapter:Adapter>
(-)src/org/eclipse/hyades/logging/adapter/tests/utils/APITestJUtils.java (+689 lines)
Added Link Here
1
package org.eclipse.hyades.logging.adapter.tests.utils;
2
/**********************************************************************
3
 * Copyright (c) 2006, 2007 IBM Corporation and others.
4
 * All rights reserved.   This program and the accompanying materials
5
 * are made available under the terms of the Eclipse Public License v1.0
6
 * which accompanies this distribution, and is available at
7
 * http://www.eclipse.org/legal/epl-v10.html
8
 * $Id: TestJUtils.java,v 1.6 2007/03/27 22:31:36 dnsmith Exp $
9
 * 
10
 * Contributors: 
11
 * IBM - Initial API and implementation
12
 **********************************************************************/
13
14
import java.io.File;
15
16
import org.eclipse.hyades.logging.adapter.Adapter;
17
import org.eclipse.hyades.logging.adapter.AdapterException;
18
import org.eclipse.hyades.logging.adapter.IComponent;
19
import org.eclipse.hyades.logging.adapter.IContext;
20
import org.eclipse.hyades.logging.adapter.IStatus;
21
import org.eclipse.hyades.logging.adapter.outputters.CBEFileOutputter;
22
import org.eclipse.hyades.logging.adapter.sensors.SingleOSFileSensor;
23
24
import org.eclipse.hyades.test.common.junit.HyadesTestCase;
25
import org.eclipse.tptp.monitoring.auto.tests.utils.PropertiesWrapper;
26
27
/**
28
 * This is the main class to run GLA API tests and check the results 
29
 *
30
 */
31
32
public class APITestJUtils extends HyadesTestCase
33
{
34
	public APITestJUtils(String arg0) 
35
	{
36
		super(arg0);
37
	}
38
	
39
	private static String getActualFile(String relativeFile)
40
	{
41
		return PropertiesWrapper.DEPLOYMENT_HOME + "/" + relativeFile;
42
	}
43
	
44
45
	
46
	public static void testInvalidSetContextConfigPathAPI(String adapterConfigFile)
47
	{
48
		adapterConfigFile = getActualFile(adapterConfigFile);
49
		Adapter adapter = new Adapter();
50
		adapter.setContextConfigPath("c:\\dummy.adapter"); //does not exist
51
		adapter.setComponentConfigPath(adapterConfigFile);
52
		/* Get the adapter configuration */
53
54
		try {
55
        	adapter.getConfiguration();
56
        }
57
        catch (AdapterException e) {
58
        	return;
59
        }
60
        catch(Throwable e)
61
        {
62
        	// Fail since we are supposed to get an AdapterException
63
        	fail("Expected AdapterException - Error: " + e);
64
        }
65
        fail("AdapterException was not thrown due to invalid path");
66
	}
67
	
68
	public static void testInvalidAdapterSetContextConfigPathAPI(String invalidAdapterFile,String adapterConfigFile)
69
	{
70
		invalidAdapterFile = getActualFile(invalidAdapterFile);
71
		adapterConfigFile = getActualFile(adapterConfigFile);
72
		Adapter adapter = new Adapter();
73
		adapter.setContextConfigPath(invalidAdapterFile); //invalid content
74
		adapter.setComponentConfigPath(adapterConfigFile);
75
		/* Get the adapter configuration */
76
77
		try {
78
        	adapter.getConfiguration();
79
        }
80
        catch (AdapterException e) {
81
        	return;
82
        }
83
        catch(Throwable e)
84
        {
85
        	// Fail since we are supposed to get an AdapterException
86
        	fail("Expected AdapterException - Error: " + e);
87
        }
88
89
        fail("AdapterException was not thrown due to invalid adapter content");
90
	}
91
	
92
	public static void testInvalidSetComponentConfigPathAPI(String adapterConfigFile)
93
	{
94
		adapterConfigFile = getActualFile(adapterConfigFile);
95
		Adapter adapter = new Adapter();
96
		adapter.setContextConfigPath(adapterConfigFile); //does not exist
97
		adapter.setComponentConfigPath("c:\\dummy.adapter");
98
		/* Get the adapter configuration */
99
100
		try {
101
        	adapter.getConfiguration();
102
        }
103
        catch (AdapterException e) {
104
        	return;
105
        }
106
        catch(Throwable e)
107
        {
108
        	// Fail since we are supposed to get an AdapterException
109
        	fail("Expected AdapterException - Error: " + e);
110
        }
111
112
        fail("AdapterException was not thrown due to invalid path");
113
	}
114
	
115
	public static void testInvalidAdapterSetComponentConfigPathAPI(String invalidAdapterFile,String adapterConfigFile)
116
	{
117
		invalidAdapterFile = getActualFile(invalidAdapterFile);
118
		adapterConfigFile = getActualFile(adapterConfigFile);
119
		Adapter adapter = new Adapter();
120
		adapter.setContextConfigPath(adapterConfigFile); //does not exist
121
		adapter.setComponentConfigPath(invalidAdapterFile);
122
		/* Get the adapter configuration */
123
124
		try {
125
        	adapter.getConfiguration();
126
        }
127
        catch (AdapterException e) {
128
        	return;
129
        }
130
        catch(Throwable e)
131
        {
132
        	// Fail since we are supposed to get an AdapterException
133
        	fail("Expected AdapterException - Error: " + e);
134
        }
135
136
        fail("AdapterException was not thrown due to invalid adapter content");
137
	}
138
	
139
	public static void testValidDiffFileSetContextComponentConfigPathAPI(String contextConfigFile,String componentConfigFile)
140
	{
141
		contextConfigFile = getActualFile(contextConfigFile);
142
		componentConfigFile = getActualFile(componentConfigFile);
143
		Adapter adapter = new Adapter();
144
		adapter.setContextConfigPath(contextConfigFile);
145
		adapter.setComponentConfigPath(componentConfigFile);
146
		/* Get the adapter configuration */
147
        IContext [] contexts = null;
148
149
		try {
150
        	contexts = adapter.getConfiguration();
151
        	assertNotNull(contexts);
152
        }
153
        catch (AdapterException e) {
154
        	fail(e.getMessage());
155
        }
156
        catch(Throwable e)
157
        {
158
        	// Fail since we are supposed to get an AdapterException
159
        	fail("Expected AdapterException - Error: " + e);
160
        }
161
	}
162
	
163
	public static void testSetLoggingLevelAPI(String adapterConfigFile)
164
	{
165
		adapterConfigFile = getActualFile(adapterConfigFile);
166
		Adapter adapter = new Adapter();
167
		adapter.setContextConfigPath(adapterConfigFile);
168
		adapter.setComponentConfigPath(adapterConfigFile);
169
		
170
		adapter.setLoggingLevel((short)0);
171
		/* Get the adapter configuration */
172
        IContext [] contexts = null;
173
 
174
		try 
175
		{
176
        	contexts = adapter.getConfiguration();
177
            /* Get the sensor and update the directory and file name of the log to parse */
178
            SingleOSFileSensor sensor = (SingleOSFileSensor)contexts[0].getComponents()[0];
179
            
180
            sensor.setDirectory(new File(adapterConfigFile).getParent());
181
            sensor.setFileName("example.log");
182
            assertNotSame(adapter.getLoggingLevel(), contexts[0].getLoggingLevel());
183
        	adapter.start(true, true);
184
        	assertNotNull(contexts);
185
        }
186
        catch (AdapterException e) {
187
        	adapter.stop();
188
        	fail(e.getMessage());
189
        }
190
        catch(Throwable e)
191
        {
192
        	adapter.stop();
193
        	// Fail since we are supposed to get an AdapterException
194
        	fail("Expected AdapterException - Error: " + e);
195
        }
196
197
        try {
198
            Thread.sleep(3000);
199
        }
200
        catch (InterruptedException e) {}
201
        adapter.stop();
202
        assertEquals(adapter.getLoggingLevel(), contexts[0].getLoggingLevel());
203
	}
204
	
205
	public static void testGetLoggingLevelAPI(String adapterConfigFile)
206
	{
207
		adapterConfigFile = getActualFile(adapterConfigFile);
208
		Adapter adapter = new Adapter();
209
		adapter.setContextConfigPath(adapterConfigFile);
210
		adapter.setComponentConfigPath(adapterConfigFile);
211
		
212
		adapter.setLoggingLevel((short)10);
213
		assertEquals(adapter.getLoggingLevel(), 10);
214
	}
215
	
216
	public static void testGetLoggingLevelAPIDefaultValue(String adapterConfigFile)
217
	{
218
		adapterConfigFile = getActualFile(adapterConfigFile);
219
		Adapter adapter = new Adapter();
220
		adapter.setContextConfigPath(adapterConfigFile);
221
		adapter.setComponentConfigPath(adapterConfigFile);
222
223
		assertEquals(adapter.getLoggingLevel(), -1);
224
	}
225
	
226
	public static void testValidGetConfigurationAPI(String adapterConfigFile)
227
	{
228
		adapterConfigFile = getActualFile(adapterConfigFile);
229
		Adapter adapter = new Adapter();
230
		adapter.setContextConfigPath(adapterConfigFile); //does not exist
231
		adapter.setComponentConfigPath(adapterConfigFile);
232
        
233
		try 
234
		{
235
			IContext [] contexts = adapter.getConfiguration();
236
        	assertNotNull(contexts);
237
        }
238
        catch (AdapterException e) {
239
        	fail(e.getMessage());
240
        }
241
        catch(Throwable e)
242
        {
243
        	// Fail since we are supposed to get an AdapterException
244
        	fail("Expected AdapterException - Error: " + e);
245
        }
246
	}
247
	
248
	public static void testInvalidGetConfigurationAPI(String adapterConfigFile)
249
	{
250
		adapterConfigFile = getActualFile(adapterConfigFile);
251
		Adapter adapter = new Adapter();
252
		adapter.setContextConfigPath(adapterConfigFile); 
253
		adapter.setComponentConfigPath(adapterConfigFile);
254
255
		try 
256
		{
257
        	adapter.getConfiguration();
258
        }
259
        catch (AdapterException e) {
260
        	return;
261
        }
262
        catch(Throwable e)
263
        {
264
        	// Fail since we are supposed to get an AdapterException
265
        	fail("Expected AdapterException - Error: " + e);
266
        }
267
        fail("Invalid configuration did not throw any errors");
268
	}
269
	
270
	public static void testInvalidNoPathGetConfigurationAPI()
271
	{
272
		Adapter adapter = new Adapter();
273
		try 
274
		{
275
        	adapter.getConfiguration();
276
        }
277
        catch (AdapterException e) {
278
        	return;
279
        }
280
        catch(Throwable e)
281
        {
282
        	// Fail since we are supposed to get an AdapterException
283
        	fail("Expected AdapterException - Error: " + e);
284
        }
285
        fail("Invalid configuration did not throw any errors");
286
	}
287
	
288
	
289
	
290
	public static void testSuccessValidateAPI(String adapterConfigFile)
291
	{
292
		adapterConfigFile = getActualFile(adapterConfigFile);
293
		Adapter adapter = new Adapter();
294
		adapter.setContextConfigPath(adapterConfigFile);
295
		adapter.setComponentConfigPath(adapterConfigFile);
296
		
297
		adapter.setLoggingLevel((short)0);
298
		/* Get the adapter configuration */
299
        IContext [] contexts = null;
300
 
301
		try 
302
		{
303
        	contexts = adapter.getConfiguration();
304
            /* Get the sensor and update the directory and file name of the log to parse */
305
            SingleOSFileSensor sensor = (SingleOSFileSensor)contexts[0].getComponents()[0];
306
            
307
            sensor.setDirectory(new File(adapterConfigFile).getParent());
308
            sensor.setFileName("example.log");
309
        	adapter.validate();
310
        }
311
        catch (AdapterException e) {
312
        	fail(e.getMessage());
313
        }
314
        catch(Throwable e)
315
        {
316
        	// Fail since we are supposed to get an AdapterException
317
        	fail("Expected AdapterException - Error: " + e);
318
        }
319
	}
320
	
321
	
322
	public static void testFailedNoPathValidateAPI()
323
	{
324
		Adapter adapter = new Adapter();
325
		try 
326
		{
327
        	adapter.validate();
328
        }
329
        catch (AdapterException e) {
330
        	return;
331
        }
332
        catch(Throwable e)
333
        {
334
        	// Fail since we are supposed to get an AdapterException
335
        	fail(e.getMessage());
336
        }
337
        fail("Invalid configuration in the adapter did not throw any exception during validate()");
338
	}
339
	
340
	public static void testFailedValidateAPI(String adapterConfigFile)
341
	{
342
		adapterConfigFile = getActualFile(adapterConfigFile);
343
		Adapter adapter = new Adapter();
344
		adapter.setContextConfigPath(adapterConfigFile);
345
		adapter.setComponentConfigPath(adapterConfigFile);
346
		
347
		/* Get the adapter configuration */
348
		try 
349
		{
350
        	adapter.validate();
351
        }
352
        catch (AdapterException e) {
353
        	return;
354
        }
355
        catch(Throwable e)
356
        {
357
        	// Fail since we are supposed to get an AdapterException
358
        	fail("Expected AdapterException - Error: " + e);
359
        }
360
        fail("Invalid configuration in the adapter did not throw any exception during validate()");
361
	}
362
	
363
	
364
	public static void testStartThreadDeamonModeAPI(String adapterConfigFile)
365
	{
366
		adapterConfigFile = getActualFile(adapterConfigFile);
367
		Adapter adapter = new Adapter();
368
		adapter.setContextConfigPath(adapterConfigFile);
369
		adapter.setComponentConfigPath(adapterConfigFile);
370
 
371
		try 
372
		{
373
			IContext [] contexts = adapter.getConfiguration();
374
        	IComponent[] components = contexts[0].getComponents();
375
            /* Get the sensor and update the directory and file name of the log to parse */
376
            SingleOSFileSensor sensor = (SingleOSFileSensor)components[0];
377
            sensor.setDirectory(new File(adapterConfigFile).getParent());
378
            sensor.setFileName("example.log");
379
            
380
            /* Get the outputter and update the directory and file name of the output file */
381
            CBEFileOutputter outputter = (CBEFileOutputter)components[components.length-1];
382
            outputter.setFileName("startTest1.out");
383
            outputter.setDirectory(new File(adapterConfigFile).getParent());
384
385
        	adapter.start(true, true);
386
        }
387
        catch (AdapterException e) {
388
        	adapter.stop();
389
        	fail(e.getMessage());
390
        }
391
        catch(Throwable e)
392
        {
393
        	adapter.stop();
394
        	// Fail since we are supposed to get an AdapterException
395
        	fail("Expected AdapterException - Error: " + e);
396
        }
397
398
        try {
399
            Thread.sleep(3000);
400
        }
401
        catch (InterruptedException e) {}
402
        adapter.stop();
403
        assertTrue("Out file was not generated", (new File(new File(adapterConfigFile).getParent() + "/startTest1.out")).exists());
404
	}
405
	
406
	
407
	
408
	public static void testStartNonThreadModeAPI(String adapterConfigFile)
409
	{
410
		adapterConfigFile = getActualFile(adapterConfigFile);
411
		Adapter adapter = new Adapter();
412
		adapter.setContextConfigPath(adapterConfigFile);
413
		adapter.setComponentConfigPath(adapterConfigFile);
414
		
415
		adapter.setLoggingLevel((short)0);
416
 
417
		try 
418
		{
419
			IContext [] contexts = adapter.getConfiguration();
420
        	IComponent[] components = contexts[0].getComponents();
421
            /* Get the sensor and update the directory and file name of the log to parse */
422
            SingleOSFileSensor sensor = (SingleOSFileSensor)components[0];
423
            sensor.setDirectory(new File(adapterConfigFile).getParent());
424
            sensor.setFileName("example.log");
425
            
426
            /* Get the outputter and update the directory and file name of the output file */
427
            CBEFileOutputter outputter = (CBEFileOutputter)components[components.length-1];
428
            outputter.setFileName("startTest2.out");
429
            outputter.setDirectory(new File(adapterConfigFile).getParent());
430
431
        	adapter.start(false, false);
432
        }
433
        catch (AdapterException e) {
434
        	adapter.stop();
435
        	fail(e.getMessage());
436
        }
437
        catch(Throwable e)
438
        {
439
        	adapter.stop();
440
        	// Fail since we are supposed to get an AdapterException
441
        	fail("Expected AdapterException - Error: " + e);
442
        }
443
444
        try {
445
            Thread.sleep(3000);
446
        }
447
        catch (InterruptedException e) {}
448
        adapter.stop();
449
        assertTrue("Out file was not generated", (new File(new File(adapterConfigFile).getParent() + "/startTest2.out")).exists());
450
	}
451
	
452
	public static void testStartInvalidAdapterModeAPI()
453
	{		 
454
		Adapter adapter = new Adapter();
455
		try 
456
		{
457
        	adapter.start(true, true);
458
        }
459
        catch (AdapterException e) {
460
        	adapter.stop();
461
        	return;
462
        }
463
        catch(Throwable e)
464
        {
465
        	adapter.stop();
466
        	// Fail since we are supposed to get an AdapterException
467
        	fail("Expected AdapterException - Error: " + e);
468
        }
469
        adapter.stop();
470
        fail("Exception not thrown for invalid adapter");
471
	}
472
	
473
	public static void testSetLogOutputterAPI(String adapterConfigFile)
474
	{
475
		adapterConfigFile = getActualFile(adapterConfigFile);
476
		Adapter adapter = new Adapter();
477
		adapter.setContextConfigPath(adapterConfigFile);
478
		adapter.setComponentConfigPath(adapterConfigFile);
479
		
480
		adapter.setLoggingLevel((short)0);
481
 
482
		try 
483
		{
484
            /* Create a file outputter to capture GLA
485
             * log messages.
486
             */
487
            CBEFileOutputter fo = new CBEFileOutputter();
488
            fo.setDirectory(new File(adapterConfigFile).getParent());
489
            fo.setFileName("testgla1.log");
490
491
            /* Set the outputter to capture the GLA log messages */
492
            adapter.setLogOutputter(fo);
493
            
494
			IContext [] contexts = adapter.getConfiguration();
495
        	IComponent[] components = contexts[0].getComponents();
496
            /* Get the sensor and update the directory and file name of the log to parse */
497
            SingleOSFileSensor sensor = (SingleOSFileSensor)components[0];
498
            sensor.setDirectory(new File(adapterConfigFile).getParent());
499
            sensor.setFileName("example.log");
500
            
501
            /* Get the outputter and update the directory and file name of the output file */
502
            CBEFileOutputter outputter = (CBEFileOutputter)components[components.length-1];
503
            outputter.setFileName("sample.out");
504
            outputter.setDirectory(new File(adapterConfigFile).getParent());
505
506
        	adapter.start(false, false);
507
        }
508
        catch (AdapterException e) {
509
        	adapter.stop();
510
        	fail(e.getMessage());
511
        }
512
        catch(Throwable e)
513
        {
514
        	adapter.stop();
515
        	// Fail since we are supposed to get an AdapterException
516
        	fail("Expected AdapterException - Error: " + e);
517
        }
518
519
        try {
520
            Thread.sleep(3000);
521
        }
522
        catch (InterruptedException e) {}
523
        adapter.stop();
524
        File result = (new File(new File(adapterConfigFile).getParent() + "/testgla1.log"));
525
        assertTrue("Out file " + result.getAbsolutePath()+ "was not generated", (result.exists() && result.length() > 0));
526
	}
527
	
528
	public static void testStopAPI(String adapterConfigFile)
529
	{
530
		adapterConfigFile = getActualFile(adapterConfigFile);
531
		Adapter adapter = new Adapter();
532
		adapter.setContextConfigPath(adapterConfigFile);
533
		adapter.setComponentConfigPath(adapterConfigFile);
534
 
535
		try 
536
		{
537
			IContext [] contexts = adapter.getConfiguration();
538
        	IComponent[] components = contexts[0].getComponents();
539
            /* Get the sensor and update the directory and file name of the log to parse */
540
            SingleOSFileSensor sensor = (SingleOSFileSensor)components[0];
541
            sensor.setDirectory(new File(adapterConfigFile).getParent());
542
            sensor.setFileName("example.log");
543
            
544
            /* Get the outputter and update the directory and file name of the output file */
545
            CBEFileOutputter outputter = (CBEFileOutputter)components[components.length-1];
546
            outputter.setFileName("apacheaccess.out");
547
            outputter.setDirectory(new File(adapterConfigFile).getParent());
548
549
        	adapter.start(true, true);
550
        }
551
        catch (AdapterException e) {
552
        	adapter.stop();
553
        	fail(e.getMessage());
554
        }
555
        catch(Throwable e)
556
        {
557
        	adapter.stop();
558
        	// Fail since we are supposed to get an AdapterException
559
        	fail("Expected AdapterException - Error: " + e);
560
        }
561
562
        try {
563
            Thread.sleep(3000);
564
        }
565
        catch (InterruptedException e) {}
566
        adapter.stop();
567
568
        /* Get the adapter status */
569
        IStatus status = adapter.getStatus();
570
571
        if (status != null) {
572
        	assertFalse("Adapter has not stopped",status.isActive());
573
        }
574
	}
575
	
576
	
577
	public static void testHardStopAPI(String adapterConfigFile)
578
	{
579
		adapterConfigFile = getActualFile(adapterConfigFile);
580
		Adapter adapter = new Adapter();
581
		adapter.setContextConfigPath(adapterConfigFile);
582
		adapter.setComponentConfigPath(adapterConfigFile);
583
 
584
		try 
585
		{
586
			IContext [] contexts = adapter.getConfiguration();
587
        	IComponent[] components = contexts[0].getComponents();
588
            /* Get the sensor and update the directory and file name of the log to parse */
589
            SingleOSFileSensor sensor = (SingleOSFileSensor)components[0];
590
            sensor.setDirectory(new File(adapterConfigFile).getParent());
591
            sensor.setFileName("example.log");
592
            
593
            /* Get the outputter and update the directory and file name of the output file */
594
            CBEFileOutputter outputter = (CBEFileOutputter)components[components.length-1];
595
            outputter.setFileName("apacheaccess.out");
596
            outputter.setDirectory(new File(adapterConfigFile).getParent());
597
598
        	adapter.start(true, true);
599
        }
600
        catch (AdapterException e) {
601
        	adapter.stop();
602
        	fail(e.getMessage());
603
        }
604
        catch(Throwable e)
605
        {
606
        	adapter.stop();
607
        	// Fail since we are supposed to get an AdapterException
608
        	fail("Expected AdapterException - Error: " + e);
609
        }
610
611
        try {
612
            Thread.sleep(3000);
613
        }
614
        catch (InterruptedException e) {}
615
        adapter.hardStop();
616
        try {
617
            Thread.sleep(3000);
618
        }
619
        catch (InterruptedException e) {}
620
        /* Get the adapter status */
621
        IStatus status = adapter.getStatus();
622
623
        if (status != null) {
624
        	assertFalse("Adapter has not stopped",status.isActive());
625
        }
626
	}
627
	
628
	
629
	public static void testGetStatusAPI(String adapterConfigFile)
630
	{
631
		adapterConfigFile = getActualFile(adapterConfigFile);
632
		Adapter adapter = new Adapter();
633
		adapter.setContextConfigPath(adapterConfigFile);
634
		adapter.setComponentConfigPath(adapterConfigFile);
635
 
636
		try 
637
		{
638
			IContext [] contexts = adapter.getConfiguration();
639
        	IComponent[] components = contexts[0].getComponents();
640
            /* Get the sensor and update the directory and file name of the log to parse */
641
            SingleOSFileSensor sensor = (SingleOSFileSensor)components[0];
642
            sensor.setDirectory(new File(adapterConfigFile).getParent());
643
            sensor.setFileName("example.log");
644
            
645
            /* Get the outputter and update the directory and file name of the output file */
646
            CBEFileOutputter outputter = (CBEFileOutputter)components[components.length-1];
647
            outputter.setFileName("apacheaccess.out");
648
            outputter.setDirectory(new File(adapterConfigFile).getParent());
649
650
        	adapter.start(true, true);
651
        }
652
        catch (AdapterException e) {
653
        	adapter.stop();
654
        	fail(e.getMessage());
655
        }
656
        catch(Throwable e)
657
        {
658
        	adapter.stop();
659
        	// Fail since we are supposed to get an AdapterException
660
        	fail("Expected AdapterException - Error: " + e);
661
        }
662
663
        try {
664
            Thread.sleep(3000);
665
        }
666
        catch (InterruptedException e) {}
667
        
668
        
669
        /* Get the adapter status */
670
        IStatus status = adapter.getStatus();
671
        if (status != null) {
672
        	long time = status.getElapsedTimeInMilliseconds();
673
        	int processed = status.getItemsProcessedCount();
674
        	adapter.stop();
675
        	assertTrue("Adapter has invalid status",(time > 0 && processed > 0));
676
        }
677
        else
678
        {
679
        	adapter.stop();
680
        	fail("Status object is null");
681
        }
682
	}
683
	
684
	public static void main(String[] arg)
685
	{
686
		testStopAPI("D:\\TPTP_4_4\\build_tptp\\GenericLogAdapter\\config\\Apache\\access\\v1.3.26\\regex_example.adapter");
687
	}
688
689
}

Return to bug 170870