1 /*******************************************************************************
2 * Copyright (c) 2013 Ericsson
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Matthew Khouzam - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.tmf
.ui
.tests
.trace
;
15 import static org
.junit
.Assert
.fail
;
18 import java
.util
.ArrayList
;
19 import java
.util
.Collection
;
21 import org
.eclipse
.core
.runtime
.IStatus
;
22 import org
.junit
.Test
;
23 import org
.junit
.runner
.RunWith
;
24 import org
.junit
.runners
.Parameterized
;
25 import org
.junit
.runners
.Parameterized
.Parameters
;
28 * Invalid Xml files, random errors
30 * @author Matthew Khouzam
33 @RunWith(Parameterized
.class)
34 public class CustomXmlTraceInvalidTest
extends CustomXmlTraceTest
{
36 private final static String pathname
= "tracesets/xml/invalid";
39 * This should create the parameters to launch the project
41 * @return the path of the parameters
43 @Parameters(name
= "{index}: path {0}")
44 public static Collection
<Object
[]> getFiles() {
45 File
[] invalidFiles
= (new File(pathname
)).listFiles();
46 Collection
<Object
[]> params
= new ArrayList
<>();
47 for (File f
: invalidFiles
) {
48 Object
[] arr
= new Object
[] { f
.getAbsolutePath() };
60 public CustomXmlTraceInvalidTest(String filePath
) {
65 * Test all the invalid xml files
68 public void testInvalid() {
69 IStatus invalid
= getTrace().validate(null, getPath());
70 if (IStatus
.ERROR
!= invalid
.getSeverity()) {