~ubuntu-branches/ubuntu/utopic/eclipse-linuxtools/utopic

« back to all changes in this revision

Viewing changes to lttng/org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/component/TmfDataProviderStub.java

  • Committer: Package Import Robot
  • Author(s): Jakub Adam
  • Date: 2014-05-12 18:11:40 UTC
  • mfrom: (3.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20140512181140-w237r3vsah1tmybz
Tags: 2.2.1-1
* New upstream release.
* Refreshed d/patches.
* Removed eclipse-cdt-valgrind-remote package, all its functionality
  is now provided by eclipse-cdt-profiling-framework-remote.
* Added remove-license-feature.patch.
* Bump Standards-Version to 3.9.5.
* Enable eclipse-changelog package.
* Enable eclipse-rpm-editor package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*******************************************************************************
2
 
 * Copyright (c) 2009, 2010 Ericsson
 
2
 * Copyright (c) 2009, 2013 Ericsson
3
3
 *
4
4
 * All rights reserved. This program and the accompanying materials are
5
5
 * made available under the terms of the Eclipse Public License v1.0 which
20
20
import org.eclipse.core.runtime.FileLocator;
21
21
import org.eclipse.core.runtime.Path;
22
22
import org.eclipse.linuxtools.tmf.core.component.TmfDataProvider;
23
 
import org.eclipse.linuxtools.tmf.core.event.TmfEvent;
 
23
import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
24
24
import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
25
25
import org.eclipse.linuxtools.tmf.core.request.ITmfDataRequest;
26
26
import org.eclipse.linuxtools.tmf.core.request.ITmfEventRequest;
33
33
 * <p>
34
34
 * TODO: Implement me. Please.
35
35
 */
36
 
@SuppressWarnings({"nls","javadoc"})
37
 
public class TmfDataProviderStub extends TmfDataProvider<TmfEvent> {
 
36
@SuppressWarnings("javadoc")
 
37
public class TmfDataProviderStub extends TmfDataProvider {
38
38
 
39
39
    private static final String DIRECTORY   = "testfiles";
40
40
    private static final String TEST_STREAM = "M-Test-10K";
42
42
    private TmfTraceStub fTrace;
43
43
 
44
44
    public TmfDataProviderStub(final String path) throws IOException {
45
 
        super("TmfDataProviderStub", TmfEvent.class);
 
45
        super("TmfDataProviderStub", ITmfEvent.class);
46
46
        final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(path), null);
47
47
        try {
48
48
            final File test = new File(FileLocator.toFileURL(location).toURI());
63
63
    // ------------------------------------------------------------------------
64
64
 
65
65
    @Override
66
 
    public ITmfContext armRequest(final ITmfDataRequest<TmfEvent> request) {
67
 
        if (request instanceof ITmfEventRequest<?>) {
68
 
            final ITmfContext context = fTrace.seekEvent(((ITmfEventRequest<?>) request).getRange().getStartTime());
 
66
    public ITmfContext armRequest(final ITmfDataRequest request) {
 
67
        if (request instanceof ITmfEventRequest) {
 
68
            final ITmfContext context = fTrace.seekEvent(((ITmfEventRequest) request).getRange().getStartTime());
69
69
            return context;
70
70
        }
71
71
        return null;
72
72
    }
73
73
 
74
74
    @Override
75
 
    public TmfEvent getNext(final ITmfContext context) {
 
75
    public ITmfEvent getNext(final ITmfContext context) {
76
76
        return fTrace.getNext(context);
77
77
    }
78
78
 
79
79
    @Override
80
 
    public boolean isCompleted(final ITmfDataRequest<TmfEvent> request, final TmfEvent data, final int nbRead) {
 
80
    public boolean isCompleted(final ITmfDataRequest request, final ITmfEvent data, final int nbRead) {
81
81
        return false;
82
82
    }
83
83