Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 145578 Details for
Bug 287562
[TMF] Update the Event Model code
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Event model refresh
287562.patch (text/plain), 53.21 KB, created by
Francois Chouinard
on 2009-08-25 14:55:06 EDT
(
hide
)
Description:
Event model refresh
Filename:
MIME Type:
Creator:
Francois Chouinard
Created:
2009-08-25 14:55:06 EDT
Size:
53.21 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.linuxtools.tmf.tests >Index: META-INF/MANIFEST.MF >=================================================================== >--- META-INF/MANIFEST.MF (revision 22815) >+++ META-INF/MANIFEST.MF (working copy) >@@ -5,6 +5,5 @@ > Bundle-Version: 0.0.1 > Bundle-RequiredExecutionEnvironment: J2SE-1.5 > Bundle-Vendor: Eclipse >-Require-Bundle: org.junit4;bundle-version="4.5.0" >-Import-Package: org.eclipse.linuxtools.tmf.event, >- org.eclipse.linuxtools.tmf.eventlog >+Require-Bundle: org.junit4;bundle-version="4.5.0", >+ org.eclipse.linuxtools.tmf;bundle-version="0.0.1" >Index: src/org/eclipse/linuxtools/tmf/eventlog/TmfEventRequestTest.java >=================================================================== >--- src/org/eclipse/linuxtools/tmf/eventlog/TmfEventRequestTest.java (revision 22815) >+++ src/org/eclipse/linuxtools/tmf/eventlog/TmfEventRequestTest.java (working copy) >@@ -17,7 +17,7 @@ > import java.util.Vector; > > import org.eclipse.linuxtools.tmf.event.TmfEvent; >-import org.eclipse.linuxtools.tmf.event.TmfTimeWindow; >+import org.eclipse.linuxtools.tmf.event.TmfTimeRange; > import org.eclipse.linuxtools.tmf.event.TmfTimestamp; > import org.junit.BeforeClass; > import org.junit.Test; >@@ -42,7 +42,7 @@ > > @Test > public void testConstructorForRange() throws Exception { >- TmfTimeWindow range = new TmfTimeWindow(TmfTimestamp.BigBang, TmfTimestamp.BigCrunch); >+ TmfTimeRange range = new TmfTimeRange(TmfTimestamp.BigBang, TmfTimestamp.BigCrunch); > TmfEventRequest request = new TmfEventRequest(range, 0, -1, 1); > > assertEquals("StartTime", TmfTimestamp.BigBang, request.getRange().getStartTime()); >@@ -53,7 +53,7 @@ > > @Test > public void testConstructorForNbEvents() throws Exception { >- TmfTimeWindow range = new TmfTimeWindow(TmfTimestamp.BigBang, TmfTimestamp.BigCrunch); >+ TmfTimeRange range = new TmfTimeRange(TmfTimestamp.BigBang, TmfTimestamp.BigCrunch); > TmfEventRequest request = new TmfEventRequest(range, 0, 10, 1); > > assertEquals("StartTime", TmfTimestamp.BigBang, request.getRange().getStartTime()); >@@ -64,7 +64,7 @@ > > @Test > public void testConstructorWithOffset() throws Exception { >- TmfTimeWindow range = new TmfTimeWindow(TmfTimestamp.BigBang, TmfTimestamp.BigCrunch); >+ TmfTimeRange range = new TmfTimeRange(TmfTimestamp.BigBang, TmfTimestamp.BigCrunch); > TmfEventRequest request = new TmfEventRequest(range, 5, 10, 1); > > assertEquals("StartTime", TmfTimestamp.BigBang, request.getRange().getStartTime()); >@@ -75,7 +75,7 @@ > > @Test > public void testConstructorWithNegativeOffset() throws Exception { >- TmfTimeWindow range = new TmfTimeWindow(TmfTimestamp.BigBang, TmfTimestamp.BigCrunch); >+ TmfTimeRange range = new TmfTimeRange(TmfTimestamp.BigBang, TmfTimestamp.BigCrunch); > TmfEventRequest request = new TmfEventRequest(range, -5, 10, 1); > > assertEquals("StartTime", TmfTimestamp.BigBang, request.getRange().getStartTime()); >@@ -95,7 +95,7 @@ > final int BLOCK_SIZE = 100; > final Vector<TmfEvent> requestedEvents = new Vector<TmfEvent>(); > >- TmfTimeWindow range = new TmfTimeWindow(TmfTimestamp.BigBang, TmfTimestamp.BigCrunch); >+ TmfTimeRange range = new TmfTimeRange(TmfTimestamp.BigBang, TmfTimestamp.BigCrunch); > final TmfEventRequest request = new TmfEventRequest(range, 0, NB_EVENTS, BLOCK_SIZE) { > @Override > public void newEvents(Vector<TmfEvent> events) { >@@ -125,7 +125,7 @@ > final Vector<TmfEvent> requestedEvents = new Vector<TmfEvent>(); > int nbExpectedEvents = TmfRequestHandlerStub.MAX_GENERATED_EVENTS; > >- TmfTimeWindow range = new TmfTimeWindow(TmfTimestamp.BigBang, TmfTimestamp.BigCrunch); >+ TmfTimeRange range = new TmfTimeRange(TmfTimestamp.BigBang, TmfTimestamp.BigCrunch); > final TmfEventRequest request = new TmfEventRequest(range, 0, NB_EVENTS, BLOCK_SIZE) { > @Override > public void newEvents(Vector<TmfEvent> events) { >@@ -156,7 +156,7 @@ > final Vector<TmfEvent> requestedEvents = new Vector<TmfEvent>(); > int nbExpectedEvents = TmfRequestHandlerStub.MAX_GENERATED_EVENTS; > >- TmfTimeWindow range = new TmfTimeWindow(TmfTimestamp.BigBang, TmfTimestamp.BigCrunch); >+ TmfTimeRange range = new TmfTimeRange(TmfTimestamp.BigBang, TmfTimestamp.BigCrunch); > final TmfEventRequest request = new TmfEventRequest(range, OFFSET, NB_EVENTS, BLOCK_SIZE) { > @Override > public void newEvents(Vector<TmfEvent> events) { >@@ -187,7 +187,7 @@ > final Vector<TmfEvent> requestedEvents = new Vector<TmfEvent>(); > int nbExpectedEvents = TmfRequestHandlerStub.MAX_GENERATED_EVENTS; > >- TmfTimeWindow range = new TmfTimeWindow(TmfTimestamp.BigBang, TmfTimestamp.BigCrunch); >+ TmfTimeRange range = new TmfTimeRange(TmfTimestamp.BigBang, TmfTimestamp.BigCrunch); > final TmfEventRequest request = new TmfEventRequest(range, OFFSET, NB_EVENTS, BLOCK_SIZE) { > @Override > public void newEvents(Vector<TmfEvent> events) { >@@ -220,7 +220,7 @@ > final int BLOCK_SIZE = 100; > final Vector<TmfEvent> requestedEvents = new Vector<TmfEvent>(); > >- TmfTimeWindow range = new TmfTimeWindow(TmfTimestamp.BigBang, TmfTimestamp.BigCrunch); >+ TmfTimeRange range = new TmfTimeRange(TmfTimestamp.BigBang, TmfTimestamp.BigCrunch); > final TmfEventRequest request = new TmfEventRequest(range, 0, NB_EVENTS, BLOCK_SIZE) { > @Override > public void newEvents(Vector<TmfEvent> events) { >Index: src/org/eclipse/linuxtools/tmf/eventlog/TmfEventLogTest.java >=================================================================== >--- src/org/eclipse/linuxtools/tmf/eventlog/TmfEventLogTest.java (revision 22815) >+++ src/org/eclipse/linuxtools/tmf/eventlog/TmfEventLogTest.java (working copy) >@@ -19,7 +19,7 @@ > import java.util.Vector; > > import org.eclipse.linuxtools.tmf.event.TmfEvent; >-import org.eclipse.linuxtools.tmf.event.TmfTimeWindow; >+import org.eclipse.linuxtools.tmf.event.TmfTimeRange; > import org.eclipse.linuxtools.tmf.event.TmfTimestamp; > import org.junit.BeforeClass; > import org.junit.Test; >@@ -54,7 +54,7 @@ > assertEquals("GetEpoch", TmfTimestamp.BigBang, eventLog.getEpoch()); > assertEquals("GetNbEvents", fTotalNbEvents, eventLog.getNbEvents()); > >- TmfTimeWindow timeRange = eventLog.getTimeRange(); >+ TmfTimeRange timeRange = eventLog.getTimeRange(); > assertEquals("GetTimeRange", 0, timeRange.getStartTime().getValue()); > assertEquals("GetTimeRange", fTotalNbEvents - 1, timeRange.getEndTime().getValue()); > } >@@ -68,7 +68,7 @@ > assertEquals("GetEpoch", epoch, eventLog.getEpoch()); > assertEquals("GetNbEvents", fTotalNbEvents, eventLog.getNbEvents()); > >- TmfTimeWindow timeRange = eventLog.getTimeRange(); >+ TmfTimeRange timeRange = eventLog.getTimeRange(); > assertEquals("GetTimeRange", 0, timeRange.getStartTime().getValue()); > assertEquals("GetTimeRange", fTotalNbEvents - 1, timeRange.getEndTime().getValue()); > } >@@ -86,7 +86,7 @@ > final int BLOCK_SIZE = 100; > final Vector<TmfEvent> requestedEvents = new Vector<TmfEvent>(); > >- TmfTimeWindow range = new TmfTimeWindow(TmfTimestamp.BigBang, TmfTimestamp.BigCrunch); >+ TmfTimeRange range = new TmfTimeRange(TmfTimestamp.BigBang, TmfTimestamp.BigCrunch); > final TmfEventRequest request = new TmfEventRequest(range, 0, NB_EVENTS, BLOCK_SIZE) { > @Override > public void newEvents(Vector<TmfEvent> events) { >@@ -118,7 +118,7 @@ > final Vector<TmfEvent> requestedEvents = new Vector<TmfEvent>(); > int nbExpectedEvents = eventLog.getNbEvents(); > >- TmfTimeWindow range = new TmfTimeWindow(TmfTimestamp.BigBang, TmfTimestamp.BigCrunch); >+ TmfTimeRange range = new TmfTimeRange(TmfTimestamp.BigBang, TmfTimestamp.BigCrunch); > final TmfEventRequest request = new TmfEventRequest(range, 0, NB_EVENTS, BLOCK_SIZE) { > @Override > public void newEvents(Vector<TmfEvent> events) { >@@ -151,7 +151,7 @@ > final Vector<TmfEvent> requestedEvents = new Vector<TmfEvent>(); > int nbExpectedEvents = TmfRequestHandlerStub.MAX_GENERATED_EVENTS; > >- TmfTimeWindow range = new TmfTimeWindow(TmfTimestamp.BigBang, TmfTimestamp.BigCrunch); >+ TmfTimeRange range = new TmfTimeRange(TmfTimestamp.BigBang, TmfTimestamp.BigCrunch); > final TmfEventRequest request = new TmfEventRequest(range, OFFSET, NB_EVENTS, BLOCK_SIZE) { > @Override > public void newEvents(Vector<TmfEvent> events) { >@@ -184,7 +184,7 @@ > final Vector<TmfEvent> requestedEvents = new Vector<TmfEvent>(); > int nbExpectedEvents = TmfRequestHandlerStub.MAX_GENERATED_EVENTS; > >- TmfTimeWindow range = new TmfTimeWindow(TmfTimestamp.BigBang, TmfTimestamp.BigCrunch); >+ TmfTimeRange range = new TmfTimeRange(TmfTimestamp.BigBang, TmfTimestamp.BigCrunch); > final TmfEventRequest request = new TmfEventRequest(range, OFFSET, NB_EVENTS, BLOCK_SIZE) { > @Override > public void newEvents(Vector<TmfEvent> events) { >@@ -219,7 +219,7 @@ > final int BLOCK_SIZE = 100; > final Vector<TmfEvent> requestedEvents = new Vector<TmfEvent>(); > >- TmfTimeWindow range = new TmfTimeWindow(TmfTimestamp.BigBang, TmfTimestamp.BigCrunch); >+ TmfTimeRange range = new TmfTimeRange(TmfTimestamp.BigBang, TmfTimestamp.BigCrunch); > final TmfEventRequest request = new TmfEventRequest(range, 0, NB_EVENTS, BLOCK_SIZE) { > @Override > public void newEvents(Vector<TmfEvent> events) { >Index: src/org/eclipse/linuxtools/tmf/event/TmfEventTypeTest.java >=================================================================== >--- src/org/eclipse/linuxtools/tmf/event/TmfEventTypeTest.java (revision 22815) >+++ src/org/eclipse/linuxtools/tmf/event/TmfEventTypeTest.java (working copy) >@@ -19,7 +19,7 @@ > /** > * <b><u>TmfEventTypeTest</u></b> > * <p> >- * TODO: Implement me. Please. >+ * JUnit test suite for the TmfEventType class. > */ > public class TmfEventTypeTest { > >Index: src/org/eclipse/linuxtools/tmf/event/TmfTimestampTest.java >=================================================================== >--- src/org/eclipse/linuxtools/tmf/event/TmfTimestampTest.java (revision 22815) >+++ src/org/eclipse/linuxtools/tmf/event/TmfTimestampTest.java (working copy) >@@ -7,7 +7,7 @@ > * http://www.eclipse.org/legal/epl-v10.html > * > * Contributors: >- * Francois Chouinard (fchouinard@gmail.com) - Initial API and implementation >+ * Francois Chouinard - Initial API and implementation > *******************************************************************************/ > > package org.eclipse.linuxtools.tmf.event; >@@ -19,7 +19,7 @@ > /** > * <b><u>TmfTimestampTest</u></b> > * <p> >- * TODO: Implement me. Please. >+ * JUnit test suite for the TmfTimestamp class. > */ > public class TmfTimestampTest { > >@@ -37,6 +37,14 @@ > > @Test > public void testSimpleConstructor() throws Exception { >+ TmfTimestamp ts = new TmfTimestamp(12345); >+ assertEquals("getValue", 12345, ts.getValue()); >+ assertEquals("getscale", 0, ts.getScale()); >+ assertEquals("getPrecision", 0, ts.getPrecision()); >+ } >+ >+ @Test >+ public void testSimpleConstructor2() throws Exception { > TmfTimestamp ts = new TmfTimestamp(12345, (byte) -1); > assertEquals("getValue", 12345, ts.getValue()); > assertEquals("getscale", -1, ts.getScale()); >Index: src/org/eclipse/linuxtools/tmf/event/TmfEventFormatTest.java >=================================================================== >--- src/org/eclipse/linuxtools/tmf/event/TmfEventFormatTest.java (revision 22815) >+++ src/org/eclipse/linuxtools/tmf/event/TmfEventFormatTest.java (working copy) >@@ -7,7 +7,7 @@ > * http://www.eclipse.org/legal/epl-v10.html > * > * Contributors: >- * Francois Chouinard (fchouinard@gmail.com) - Initial API and implementation >+ * Francois Chouinard - Initial API and implementation > *******************************************************************************/ > > package org.eclipse.linuxtools.tmf.event; >@@ -19,7 +19,7 @@ > /** > * <b><u>TmfEventFormatTest</u></b> > * <p> >- * TODO: Implement me. Please. >+ * JUnit test suite for the TmfEventFormat class. > */ > public class TmfEventFormatTest { > >Index: src/org/eclipse/linuxtools/tmf/event/TmfTraceEventTest.java >=================================================================== >--- src/org/eclipse/linuxtools/tmf/event/TmfTraceEventTest.java (revision 22815) >+++ src/org/eclipse/linuxtools/tmf/event/TmfTraceEventTest.java (working copy) >@@ -7,10 +7,9 @@ > * http://www.eclipse.org/legal/epl-v10.html > * > * Contributors: >- * Francois Chouinard (fchouinard@gmail.com) - Initial API and implementation >+ * Francois Chouinard - Initial API and implementation > *******************************************************************************/ > >- > package org.eclipse.linuxtools.tmf.event; > > import static org.junit.Assert.assertEquals; >@@ -20,7 +19,7 @@ > /** > * <b><u>TmfTraceEventTest</u></b> > * <p> >- * TODO: Implement me. Please. >+ * JUnit test suite for the TmfTraceEvent class. > */ > public class TmfTraceEventTest { > >Index: src/org/eclipse/linuxtools/tmf/event/TmfEventContentTest.java >=================================================================== >--- src/org/eclipse/linuxtools/tmf/event/TmfEventContentTest.java (revision 22815) >+++ src/org/eclipse/linuxtools/tmf/event/TmfEventContentTest.java (working copy) >@@ -7,7 +7,7 @@ > * http://www.eclipse.org/legal/epl-v10.html > * > * Contributors: >- * Francois Chouinard (fchouinard@gmail.com) - Initial API and implementation >+ * Francois Chouinard - Initial API and implementation > *******************************************************************************/ > > package org.eclipse.linuxtools.tmf.event; >@@ -19,7 +19,7 @@ > /** > * <b><u>TmfEventContentTest</u></b> > * <p> >- * TODO: Implement me. Please. >+ * JUnit test suite for the TmfEventContent class. > */ > public class TmfEventContentTest { > >@@ -29,8 +29,7 @@ > > @Test > public void testTmfEventContent() { >- TmfEventContent content = new TmfEventContent("Some content", >- new TmfEventFormat()); >+ TmfEventContent content = new TmfEventContent("Some content", new TmfEventFormat()); > assertEquals("getFormat", 1, content.getFormat().getLabels().length); > assertEquals("getLabels", "Content", content.getFormat().getLabels()[0]); > assertEquals("getContent", "Some content", content.getContent()); >@@ -42,8 +41,7 @@ > > @Test > public void testBasicGetField() { >- TmfEventContent content = new TmfEventContent("Some content", >- new TmfEventFormat()); >+ TmfEventContent content = new TmfEventContent("Some content", new TmfEventFormat()); > assertEquals("getField", 1, content.getFields().length); > assertEquals("getField", "Some content", content.getField(0).toString()); > } >@@ -56,8 +54,7 @@ > assertEquals("getField", "-10", content.getField(1).toString()); > assertEquals("getField", "true", content.getField(2).toString()); > assertEquals("getField", "some string", content.getField(3).toString()); >- assertEquals("getField", "[TmfTimestamp:1,2,3]", content.getField(4) >- .toString()); >+ assertEquals("getField", "[TmfTimestamp:1,2,3]", content.getField(4).toString()); > } > > } >Index: src/org/eclipse/linuxtools/tmf/event/TmfEventTest.java >=================================================================== >--- src/org/eclipse/linuxtools/tmf/event/TmfEventTest.java (revision 22815) >+++ src/org/eclipse/linuxtools/tmf/event/TmfEventTest.java (working copy) >@@ -7,7 +7,7 @@ > * http://www.eclipse.org/legal/epl-v10.html > * > * Contributors: >- * Francois Chouinard (fchouinard@gmail.com) - Initial API and implementation >+ * Francois Chouinard - Initial API and implementation > *******************************************************************************/ > > package org.eclipse.linuxtools.tmf.event; >@@ -19,7 +19,7 @@ > /** > * <b><u>TmfEventTest</u></b> > * <p> >- * TODO: Implement me. Please. >+ * JUNit test suite for the TmfEvent class. > */ > public class TmfEventTest { > >@@ -40,29 +40,80 @@ > TmfEvent event = new TmfEvent(timestamp, source, type, content, reference); > > // Check the event timestamp >- TmfTimestamp evTS = event.getTimestamp(); >- assertEquals("getValue", 12345, evTS.getValue()); >- assertEquals("getscale", 2, evTS.getScale()); >- assertEquals("getPrecision", 5, evTS.getPrecision()); >+ TmfTimestamp ts = event.getTimestamp(); >+ assertEquals("getValue", 12345, ts.getValue()); >+ assertEquals("getscale", 2, ts.getScale()); >+ assertEquals("getPrecision", 5, ts.getPrecision()); >+ >+ // Check the original event timestamp >+ ts = event.getOriginalTimestamp(); >+ assertEquals("getValue", 12345, ts.getValue()); >+ assertEquals("getscale", 2, ts.getScale()); >+ assertEquals("getPrecision", 5, ts.getPrecision()); >+ >+ // Check the event source >+ TmfEventSource src = event.getSource(); >+ assertEquals("getValue", "Source", src.getSourceId()); >+ >+ // Check the event type >+ TmfEventType tp = event.getType(); >+ assertEquals("getValue", "Type", tp.getTypeId()); >+ assertEquals("getFormat", "field1", tp.getFormat().getLabels()[0]); >+ assertEquals("getFormat", "field2", tp.getFormat().getLabels()[1]); >+ >+ // Check the event content >+ TmfEventContent cnt = event.getContent(); >+ assertEquals("getField", 1, cnt.getFields().length); >+ assertEquals("getField", "Some content", cnt.getField(0).toString()); >+ >+ // Check the event reference >+ TmfEventReference ref = event.getReference(); >+ assertEquals("getValue", "Reference", ref.getValue()); >+ } >+ >+ @Test >+ public void testTmfEvent2() { >+ TmfTimestamp original = new TmfTimestamp(12345, (byte) 2, 5); >+ TmfTimestamp effective = new TmfTimestamp(12350, (byte) 2, 5); >+ TmfEventSource source = new TmfEventSource("Source"); >+ TmfEventFormat format = new TmfEventFormat(new String[] { "field1", "field2" }); >+ TmfEventType type = new TmfEventType("Type", format); >+ TmfEventContent content = new TmfEventContent("Some content", format); >+ TmfEventReference reference = new TmfEventReference("Reference"); >+ >+ // Create the event >+ TmfEvent event = new TmfEvent(original, effective, source, type, content, reference); >+ >+ // Check the event timestamp >+ TmfTimestamp ts = event.getTimestamp(); >+ assertEquals("getValue", 12350, ts.getValue()); >+ assertEquals("getscale", 2, ts.getScale()); >+ assertEquals("getPrecision", 5, ts.getPrecision()); >+ >+ // Check the original event timestamp >+ ts = event.getOriginalTimestamp(); >+ assertEquals("getValue", 12345, ts.getValue()); >+ assertEquals("getscale", 2, ts.getScale()); >+ assertEquals("getPrecision", 5, ts.getPrecision()); > > // Check the event source >- TmfEventSource evSrc = event.getSource(); >- assertEquals("getValue", "Source", evSrc.getSourceId()); >+ TmfEventSource src = event.getSource(); >+ assertEquals("getValue", "Source", src.getSourceId()); > > // Check the event type >- TmfEventType evType = event.getType(); >- assertEquals("getValue", "Type", evType.getTypeId()); >- assertEquals("getFormat", "field1", evType.getFormat().getLabels()[0]); >- assertEquals("getFormat", "field2", evType.getFormat().getLabels()[1]); >+ TmfEventType tp = event.getType(); >+ assertEquals("getValue", "Type", tp.getTypeId()); >+ assertEquals("getFormat", "field1", tp.getFormat().getLabels()[0]); >+ assertEquals("getFormat", "field2", tp.getFormat().getLabels()[1]); > > // Check the event content >- TmfEventContent evContent = event.getContent(); >- assertEquals("getField", 1, evContent.getFields().length); >- assertEquals("getField", "Some content", evContent.getField(0).toString()); >+ TmfEventContent cnt = event.getContent(); >+ assertEquals("getField", 1, cnt.getFields().length); >+ assertEquals("getField", "Some content", cnt.getField(0).toString()); > > // Check the event reference >- TmfEventReference evRef = event.getReference(); >- assertEquals("getValue", "Reference", evRef.getValue()); >+ TmfEventReference ref = event.getReference(); >+ assertEquals("getValue", "Reference", ref.getValue()); > } > > } >Index: src/org/eclipse/linuxtools/tmf/event/TmfTimeRangeTest.java >=================================================================== >--- src/org/eclipse/linuxtools/tmf/event/TmfTimeRangeTest.java (revision 0) >+++ src/org/eclipse/linuxtools/tmf/event/TmfTimeRangeTest.java (revision 0) >@@ -0,0 +1,82 @@ >+/******************************************************************************* >+ * Copyright (c) 2009 Ericsson >+ * >+ * All rights reserved. This program and the accompanying materials are >+ * made available under the terms of the Eclipse Public License v1.0 which >+ * accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Francois Chouinard - Initial API and implementation >+ *******************************************************************************/ >+ >+package org.eclipse.linuxtools.tmf.event; >+ >+import static org.junit.Assert.assertEquals; >+import static org.junit.Assert.assertTrue; >+import static org.junit.Assert.assertFalse; >+ >+import org.junit.Test; >+ >+/** >+ * <b><u>TmfTimeRangeTest</u></b> >+ * <p> >+ * JUnit test suite for the TmfTimeRange class. >+ */ >+public class TmfTimeRangeTest { >+ >+ // ======================================================================== >+ // Constructors >+ // ======================================================================== >+ >+ @Test >+ public void testConstructor() throws Exception { >+ TmfTimestamp ts1 = new TmfTimestamp(12345); >+ TmfTimestamp ts2 = new TmfTimestamp(12350); >+ TmfTimeRange range = new TmfTimeRange(ts1, ts2); >+ assertEquals("startTime", ts1, range.getStartTime()); >+ assertEquals("endTime", ts2, range.getEndTime()); >+ } >+ >+ @Test >+ public void testOpenRange1() throws Exception { >+ TmfTimestamp ts2 = new TmfTimestamp(12350); >+ TmfTimeRange range = new TmfTimeRange(TmfTimestamp.BigBang, ts2); >+ assertEquals("startTime", TmfTimestamp.BigBang, range.getStartTime()); >+ assertEquals("endTime", ts2, range.getEndTime()); >+ } >+ >+ @Test >+ public void testOpenRange2() throws Exception { >+ TmfTimestamp ts1 = new TmfTimestamp(12345); >+ TmfTimeRange range = new TmfTimeRange(ts1, TmfTimestamp.BigCrunch); >+ assertEquals("startTime", ts1, range.getStartTime()); >+ assertEquals("endTime", TmfTimestamp.BigCrunch, range.getEndTime()); >+ } >+ >+ @Test >+ public void testOpenRange3() throws Exception { >+ TmfTimeRange range = new TmfTimeRange(TmfTimestamp.BigBang, TmfTimestamp.BigCrunch); >+ assertEquals("startTime", TmfTimestamp.BigBang, range.getStartTime()); >+ assertEquals("endTime", TmfTimestamp.BigCrunch, range.getEndTime()); >+ } >+ >+ // ======================================================================== >+ // Constructors >+ // ======================================================================== >+ >+ @Test >+ public void testContains() throws Exception { >+ TmfTimestamp ts1 = new TmfTimestamp(12345); >+ TmfTimestamp ts2 = new TmfTimestamp(12350); >+ TmfTimeRange range = new TmfTimeRange(ts1, ts2); >+ >+ assertTrue("contains (lower bound)", range.contains(new TmfTimestamp(12345))); >+ assertTrue("contains (higher bound)", range.contains(new TmfTimestamp(12350))); >+ assertTrue("contains (within bounds)", range.contains(new TmfTimestamp(12346))); >+ >+ assertFalse("contains (low value)", range.contains(new TmfTimestamp(12340))); >+ assertFalse("contains (high value)", range.contains(new TmfTimestamp(12351))); >+ } >+ >+} >Index: src/org/eclipse/linuxtools/tmf/event/AllEventTests.java >=================================================================== >--- src/org/eclipse/linuxtools/tmf/event/AllEventTests.java (revision 22815) >+++ src/org/eclipse/linuxtools/tmf/event/AllEventTests.java (working copy) >@@ -7,7 +7,7 @@ > * http://www.eclipse.org/legal/epl-v10.html > * > * Contributors: >- * Francois Chouinard (fchouinard@gmail.com) - Initial API and implementation >+ * Francois Chouinard - Initial API and implementation > *******************************************************************************/ > > package org.eclipse.linuxtools.tmf.event; >@@ -18,6 +18,7 @@ > @RunWith(Suite.class) > @Suite.SuiteClasses({ > TmfTimestampTest.class, >+ TmfTimeRangeTest.class, > TmfEventTypeTest.class, > TmfEventFormatTest.class, > TmfEventContentTest.class, >#P org.eclipse.linuxtools.tmf >Index: src/org/eclipse/linuxtools/tmf/event/TmfEventType.java >=================================================================== >--- src/org/eclipse/linuxtools/tmf/event/TmfEventType.java (revision 22815) >+++ src/org/eclipse/linuxtools/tmf/event/TmfEventType.java (working copy) >@@ -7,7 +7,7 @@ > * http://www.eclipse.org/legal/epl-v10.html > * > * Contributors: >- * Francois Chouinard (fchouinard@gmail.com) - Initial API and implementation >+ * Francois Chouinard - Initial API and implementation > *******************************************************************************/ > > package org.eclipse.linuxtools.tmf.event; >@@ -57,4 +57,13 @@ > return fFormat; > } > >+ // ======================================================================== >+ // Operators >+ // ======================================================================== >+ >+ @Override >+ public String toString() { >+ return fTypeId.toString(); >+ } >+ > } >Index: src/org/eclipse/linuxtools/tmf/event/ITmfContentParser.java >=================================================================== >--- src/org/eclipse/linuxtools/tmf/event/ITmfContentParser.java (revision 22815) >+++ src/org/eclipse/linuxtools/tmf/event/ITmfContentParser.java (working copy) >@@ -7,7 +7,7 @@ > * http://www.eclipse.org/legal/epl-v10.html > * > * Contributors: >- * Francois Chouinard (fchouinard@gmail.com) - Initial API and implementation >+ * Francois Chouinard - Initial API and implementation > *******************************************************************************/ > > package org.eclipse.linuxtools.tmf.event; >Index: src/org/eclipse/linuxtools/tmf/event/TmfTimestamp.java >=================================================================== >--- src/org/eclipse/linuxtools/tmf/event/TmfTimestamp.java (revision 22815) >+++ src/org/eclipse/linuxtools/tmf/event/TmfTimestamp.java (working copy) >@@ -7,7 +7,7 @@ > * http://www.eclipse.org/legal/epl-v10.html > * > * Contributors: >- * Francois Chouinard (fchouinard@gmail.com) - Initial API and implementation >+ * Francois Chouinard - Initial API and implementation > *******************************************************************************/ > > package org.eclipse.linuxtools.tmf.event; >@@ -19,20 +19,20 @@ > * <p> > * It provides a generic timestamp implementation in its most basic form: > * <ul> >- * <li> an unstructured integer value >- * <li> a time scale corresponding to the magnitude of the value wrt some >- * application-specific base unit (e.g. the second) >- * <li> a precision to indicate the error on the value (useful for comparing >- * timestamps in different scales). Default: 0. >+ * <li>an unstructured integer value >+ * <li>a time scale corresponding to the magnitude of the value wrt some >+ * application-specific base unit (e.g. the second) >+ * <li>a precision to indicate the error on the value (useful for comparing >+ * timestamps in different scales). Default: 0. > * </ul> >- * To allow synchronization of timestamps from different reference clocks, >- * there is a possibility to "adjust" the timestamp both by changing its >- * scale (traces of different scale) and by adding an offset to its value >- * (clock drift between traces). >+ * To allow synchronization of timestamps from different reference clocks, there >+ * is a possibility to "adjust" the timestamp both by changing its scale (traces >+ * of different scale) and by adding an offset to its value (clock drift between >+ * traces). > * <p> >- * Note that the adjusted timestamp value could be negative e.g. for events >- * that occurred before t0 of the reference clock. >- * >+ * Note that the adjusted timestamp value could be negative e.g. for events that >+ * occurred before t0 of the reference clock. >+ * > */ > public class TmfTimestamp { > >@@ -40,16 +40,16 @@ > // Attributes > // ======================================================================== > >- private final long fValue; // The timestamp value >- private final byte fScale; // The time scale >- private final long fPrecision; // The value precision (tolerance) >+ protected final long fValue; // The timestamp value >+ protected final byte fScale; // The time scale >+ protected final long fPrecision; // The value precision (tolerance) > > // ======================================================================== > // Constants > // ======================================================================== > > // The beginning and end of time >- public static final TmfTimestamp BigBang = new TmfTimestamp(0, (byte) 0, 0); >+ public static final TmfTimestamp BigBang = new TmfTimestamp(0, (byte) 0, 0); > public static final TmfTimestamp BigCrunch = new TmfTimestamp(Long.MAX_VALUE, Byte.MAX_VALUE, 0); > > // ======================================================================== >@@ -57,17 +57,24 @@ > // ======================================================================== > > /** >- * Default constructor. >+ * Default constructor. > */ > public TmfTimestamp() { > this(0, (byte) 0, 0); > } > > /** >+ * Simple constructor. >+ */ >+ public TmfTimestamp(long value) { >+ this(value, (byte) 0, 0); >+ } >+ >+ /** > * Simple constructor with default error value > * >- * @param value - the original time value >- * @param scale - the time scale >+ * @param value >+ * @param scale > */ > public TmfTimestamp(long value, byte scale) { > this(value, scale, 0); >@@ -76,9 +83,9 @@ > /** > * Constructor with measurement error. > * >- * @param value - the time value >- * @param scale - the time scale >- * @param precision - the value precision (tolerance) >+ * @param value >+ * @param scale >+ * @param precision > */ > public TmfTimestamp(long value, byte scale, long precision) { > fValue = value; >@@ -89,7 +96,7 @@ > /** > * Copy constructor. > * >- * @param other - the timestamp to clone >+ * @param other > */ > public TmfTimestamp(TmfTimestamp other) { > this(other.fValue, other.fScale, other.fPrecision); >@@ -124,11 +131,6 @@ > // Operators > // ======================================================================== > >- @Override >- public String toString() { >- return "[TmfTimestamp:" + fValue + "," + fScale + "," + fPrecision + "]"; >- } >- > /** > * Return a shifted and scaled timestamp. > * >@@ -137,9 +139,11 @@ > * meaning beyond that scale difference and it's not even worth the trouble > * to switch to BigDecimal arithmetics. > * >- * @param offset - the shift value (in the same scale as newScale) >- * @param newScale - the new scale >- * @return The synchronized timestamp >+ * @param offset >+ * - the shift value (in the same scale as newScale) >+ * @param newScale >+ * - the new scale >+ * @return The synchronized timestamp > */ > > /* >@@ -150,6 +154,7 @@ > * difference in scale exceeds that value. > */ > private static int MAX_SCALING = 19; >+ > public TmfTimestamp synchronize(long offset, byte newScale) throws ArithmeticException { > long newValue = fValue; > long newPrecision = fPrecision; >@@ -161,8 +166,9 @@ > if (scaleDiff > MAX_SCALING) { > throw new ArithmeticException("Scaling exception"); > } >+ // Not pretty... > long scalingFactor = 1; >- for (int i = 0; i < Math.abs(fScale - newScale); i++) { >+ for (int i = 0; i < scaleDiff; i++) { > scalingFactor *= 10; > } > if (newScale < fScale) { >@@ -179,9 +185,10 @@ > > /** > * Compute the adjustment, in the reference scale, needed to synchronize >- * this timestamp with a reference timestamp. >+ * this timestamp with a reference timestamp. > * >- * @param reference - the reference timestamp to synchronize with >+ * @param reference >+ * - the reference timestamp to synchronize with > * @return The adjustment term in the reference time scale > * @throws TmfNumericalException > */ >@@ -193,11 +200,12 @@ > /** > * Compare with another timestamp > * >- * @param other - the otehr timestamp >- * @param withinPrecision - indicates if precision is to be take into consideration >- * @return <li> -1: this timestamp is lower >- * <li> 0: timestamps are equal (within precision if requested) >- * <li> 1: this timestamp is higher >+ * @param other >+ * - the other timestamp >+ * @param withinPrecision >+ * - indicates if precision is to be take into consideration >+ * @return <li>-1: this timestamp is lower <li>0: timestamps are equal >+ * (within precision if requested) <li>1: this timestamp is higher > * @throws TmfNumericalException > */ > public int compareTo(final TmfTimestamp other, boolean withinPrecision) { >@@ -211,8 +219,8 @@ > return 1; > return 0; > } >- return (fValue == other.fValue) ? 0 : >- (fValue < other.fValue) ? -1 : 1; >+ return (fValue == other.fValue) ? 0 : (fValue < other.fValue) ? -1 >+ : 1; > } > > // If values have different time scales, adjust to the finest one and >@@ -226,7 +234,8 @@ > return ts1.compareTo(ts2, withinPrecision); > } catch (ArithmeticException e) { > if ((fValue == 0) || (other.fValue == 0)) { >- return (fValue == other.fValue) ? 0 : (fValue < other.fValue) ? -1 : 1; >+ return (fValue == other.fValue) ? 0 >+ : (fValue < other.fValue) ? -1 : 1; > } > if ((fValue > 0) && (other.fValue > 0)) { > return (fScale < other.fScale) ? -1 : 1; >@@ -238,7 +247,9 @@ > } > } > >- /* (non-Javadoc) >+ /* >+ * (non-Javadoc) >+ * > * @see java.lang.Object#equals(java.lang.Object) > */ > @Override >@@ -248,4 +259,12 @@ > return super.equals(other); > } > >+ /* (non-Javadoc) >+ * @see java.lang.Object#toString() >+ */ >+ @Override >+ public String toString() { >+ return "[TmfTimestamp:" + fValue + "," + fScale + "," + fPrecision + "]"; >+ } >+ > } >\ No newline at end of file >Index: src/org/eclipse/linuxtools/tmf/event/TmfEventField.java >=================================================================== >--- src/org/eclipse/linuxtools/tmf/event/TmfEventField.java (revision 22815) >+++ src/org/eclipse/linuxtools/tmf/event/TmfEventField.java (working copy) >@@ -7,7 +7,7 @@ > * http://www.eclipse.org/legal/epl-v10.html > * > * Contributors: >- * Francois Chouinard (fchouinard@gmail.com) - Initial API and implementation >+ * Francois Chouinard - Initial API and implementation > *******************************************************************************/ > > package org.eclipse.linuxtools.tmf.event; >@@ -57,4 +57,5 @@ > public String toString() { > return fValue.toString(); > } >+ > } >Index: src/org/eclipse/linuxtools/tmf/event/TmfEventSource.java >=================================================================== >--- src/org/eclipse/linuxtools/tmf/event/TmfEventSource.java (revision 22815) >+++ src/org/eclipse/linuxtools/tmf/event/TmfEventSource.java (working copy) >@@ -7,7 +7,7 @@ > * http://www.eclipse.org/legal/epl-v10.html > * > * Contributors: >- * Francois Chouinard (fchouinard@gmail.com) - Initial API and implementation >+ * Francois Chouinard - Initial API and implementation > *******************************************************************************/ > > package org.eclipse.linuxtools.tmf.event; >@@ -53,4 +53,14 @@ > public Object getSourceId() { > return fSourceId; > } >+ >+ // ======================================================================== >+ // Operators >+ // ======================================================================== >+ >+ @Override >+ public String toString() { >+ return fSourceId.toString(); >+ } >+ > } >Index: src/org/eclipse/linuxtools/tmf/event/TmfTimeRange.java >=================================================================== >--- src/org/eclipse/linuxtools/tmf/event/TmfTimeRange.java (revision 22815) >+++ src/org/eclipse/linuxtools/tmf/event/TmfTimeRange.java (working copy) >@@ -7,7 +7,7 @@ > * http://www.eclipse.org/legal/epl-v10.html > * > * Contributors: >- * Francois Chouinard (fchouinard@gmail.com) - Initial API and implementation >+ * Francois Chouinard - Initial API and implementation > *******************************************************************************/ > > package org.eclipse.linuxtools.tmf.event; >@@ -17,7 +17,7 @@ > * <p> > * A utility class to define time ranges. > */ >-public class TmfTimeWindow { >+public class TmfTimeRange { > > // ======================================================================== > // Attributes >@@ -34,7 +34,7 @@ > * @param startTime > * @param endTime > */ >- public TmfTimeWindow(TmfTimestamp startTime, TmfTimestamp endTime) { >+ public TmfTimeRange(TmfTimestamp startTime, TmfTimestamp endTime) { > fStartTime = startTime; > fEndTime = endTime; > } >@@ -56,4 +56,20 @@ > public TmfTimestamp getEndTime() { > return fEndTime; > } >+ >+ // ======================================================================== >+ // Predicates >+ // ======================================================================== >+ >+ /** >+ * Check if the timestamp is within the time range >+ * >+ * @param ts >+ * @return >+ */ >+ public boolean contains(TmfTimestamp ts) { >+ boolean result = (fStartTime.compareTo(ts, true) <= 0) && (fEndTime.compareTo(ts, true) >= 0); >+ return result; >+ } >+ > } >Index: src/org/eclipse/linuxtools/tmf/event/TmfEventContent.java >=================================================================== >--- src/org/eclipse/linuxtools/tmf/event/TmfEventContent.java (revision 22815) >+++ src/org/eclipse/linuxtools/tmf/event/TmfEventContent.java (working copy) >@@ -7,7 +7,7 @@ > * http://www.eclipse.org/legal/epl-v10.html > * > * Contributors: >- * Francois Chouinard (fchouinard@gmail.com) - Initial API and implementation >+ * Francois Chouinard - Initial API and implementation > *******************************************************************************/ > > package org.eclipse.linuxtools.tmf.event; >Index: src/org/eclipse/linuxtools/tmf/event/TmfTimeWindow.java >=================================================================== >--- src/org/eclipse/linuxtools/tmf/event/TmfTimeWindow.java (revision 22815) >+++ src/org/eclipse/linuxtools/tmf/event/TmfTimeWindow.java (working copy) >@@ -1,59 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2009 Ericsson >- * >- * All rights reserved. This program and the accompanying materials are >- * made available under the terms of the Eclipse Public License v1.0 which >- * accompanies this distribution, and is available at >- * http://www.eclipse.org/legal/epl-v10.html >- * >- * Contributors: >- * Francois Chouinard (fchouinard@gmail.com) - Initial API and implementation >- *******************************************************************************/ >- >-package org.eclipse.linuxtools.tmf.event; >- >-/** >- * <b><u>TmfTimeWindow</u></b> >- * <p> >- * A utility class to define time ranges. >- */ >-public class TmfTimeWindow { >- >- // ======================================================================== >- // Attributes >- // ======================================================================== >- >- private final TmfTimestamp fStartTime; >- private final TmfTimestamp fEndTime; >- >- // ======================================================================== >- // Constructors >- // ======================================================================== >- >- /** >- * @param startTime >- * @param endTime >- */ >- public TmfTimeWindow(TmfTimestamp startTime, TmfTimestamp endTime) { >- fStartTime = startTime; >- fEndTime = endTime; >- } >- >- // ======================================================================== >- // Accessors >- // ======================================================================== >- >- /** >- * @return The time range start time >- */ >- public TmfTimestamp getStartTime() { >- return fStartTime; >- } >- >- /** >- * @return The time range end time >- */ >- public TmfTimestamp getEndTime() { >- return fEndTime; >- } >-} >Index: src/org/eclipse/linuxtools/tmf/event/TmfTraceEvent.java >=================================================================== >--- src/org/eclipse/linuxtools/tmf/event/TmfTraceEvent.java (revision 22815) >+++ src/org/eclipse/linuxtools/tmf/event/TmfTraceEvent.java (working copy) >@@ -7,7 +7,7 @@ > * http://www.eclipse.org/legal/epl-v10.html > * > * Contributors: >- * Francois Chouinard (fchouinard@gmail.com) - Initial API and implementation >+ * Francois Chouinard - Initial API and implementation > *******************************************************************************/ > > package org.eclipse.linuxtools.tmf.event; >@@ -45,6 +45,25 @@ > * @param content > * @param reference > */ >+ public TmfTraceEvent(TmfTimestamp originalTS, TmfTimestamp effectiveTS, TmfEventSource source, >+ TmfEventType type, TmfEventContent content, TmfEventReference reference, >+ String path, String file, int line) >+ { >+ super(originalTS, effectiveTS, source, type,content, reference); >+ fSourcePath = path; >+ fFileName = file; >+ fLineNumber = line; >+ } >+ >+ /** >+ * The constructor. >+ * >+ * @param timestamp >+ * @param source >+ * @param type >+ * @param content >+ * @param reference >+ */ > public TmfTraceEvent(TmfTimestamp timestamp, TmfEventSource source, TmfEventType type, > TmfEventContent content, TmfEventReference reference, > String path, String file, int line) >Index: src/org/eclipse/linuxtools/tmf/event/TmfEventFormat.java >=================================================================== >--- src/org/eclipse/linuxtools/tmf/event/TmfEventFormat.java (revision 22815) >+++ src/org/eclipse/linuxtools/tmf/event/TmfEventFormat.java (working copy) >@@ -7,7 +7,7 @@ > * http://www.eclipse.org/legal/epl-v10.html > * > * Contributors: >- * Francois Chouinard (fchouinard@gmail.com) - Initial API and implementation >+ * Francois Chouinard - Initial API and implementation > *******************************************************************************/ > > package org.eclipse.linuxtools.tmf.event; >@@ -68,4 +68,5 @@ > public TmfEventField[] parse(Object content) { > return new TmfEventField[] { new TmfEventField(content.toString()) }; > } >+ > } >Index: src/org/eclipse/linuxtools/tmf/event/TmfEvent.java >=================================================================== >--- src/org/eclipse/linuxtools/tmf/event/TmfEvent.java (revision 22815) >+++ src/org/eclipse/linuxtools/tmf/event/TmfEvent.java (working copy) >@@ -7,7 +7,7 @@ > * http://www.eclipse.org/legal/epl-v10.html > * > * Contributors: >- * Francois Chouinard (fchouinard@gmail.com) - Initial API and implementation >+ * Francois Chouinard - Initial API and implementation > *******************************************************************************/ > > package org.eclipse.linuxtools.tmf.event; >@@ -15,9 +15,7 @@ > /** > * <b><u>TmfEvent</u></b> > * <p> >- * The basic event structure in the TMF. >- * <p> >- * In its canonical form, an event has: >+ * The basic event structure in the TMF. In its canonical form, an event has: > * <ul> > * <li> a normalized timestamp > * <li> a source (reporter) >@@ -34,7 +32,8 @@ > // Attributes > // ======================================================================== > >- private final TmfTimestamp fTimestamp; >+ private final TmfTimestamp fEffectiveTimestamp; >+ private final TmfTimestamp fOriginalTimestamp; > private final TmfEventSource fSource; > private final TmfEventType fType; > private final TmfEventContent fContent; >@@ -51,10 +50,28 @@ > * @param content > * @param reference > */ >- public TmfEvent(TmfTimestamp timestamp, TmfEventSource source, TmfEventType type, >- TmfEventContent content, TmfEventReference reference) >+ public TmfEvent(TmfTimestamp originalTS, TmfTimestamp effectiveTS, TmfEventSource source, >+ TmfEventType type, TmfEventContent content, TmfEventReference reference) > { >- fTimestamp = timestamp; >+ fOriginalTimestamp = originalTS; >+ fEffectiveTimestamp = effectiveTS; >+ fSource = source; >+ fType = type; >+ fContent = content; >+ fReference = reference; >+ } >+ >+ /** >+ * @param timestamp >+ * @param source >+ * @param type >+ * @param content >+ * @param reference >+ */ >+ public TmfEvent(TmfTimestamp timestamp, TmfEventSource source, >+ TmfEventType type, TmfEventContent content, TmfEventReference reference) >+ { >+ fOriginalTimestamp = fEffectiveTimestamp = timestamp; > fSource = source; > fType = type; > fContent = content; >@@ -69,7 +86,14 @@ > * @return > */ > public TmfTimestamp getTimestamp() { >- return fTimestamp; >+ return fEffectiveTimestamp; >+ } >+ >+ /** >+ * @return >+ */ >+ public TmfTimestamp getOriginalTimestamp() { >+ return fOriginalTimestamp; > } > > /** >@@ -99,4 +123,5 @@ > public TmfEventReference getReference() { > return fReference; > } >+ > } >Index: src/org/eclipse/linuxtools/tmf/event/TmfEventReference.java >=================================================================== >--- src/org/eclipse/linuxtools/tmf/event/TmfEventReference.java (revision 22815) >+++ src/org/eclipse/linuxtools/tmf/event/TmfEventReference.java (working copy) >@@ -7,7 +7,7 @@ > * http://www.eclipse.org/legal/epl-v10.html > * > * Contributors: >- * Francois Chouinard (fchouinard@gmail.com) - Initial API and implementation >+ * Francois Chouinard - Initial API and implementation > *******************************************************************************/ > > package org.eclipse.linuxtools.tmf.event; >@@ -46,4 +46,14 @@ > public Object getValue() { > return fReference; > } >+ >+ // ======================================================================== >+ // Operators >+ // ======================================================================== >+ >+ @Override >+ public String toString() { >+ return fReference.toString(); >+ } >+ > } >Index: src/org/eclipse/linuxtools/tmf/TmfCorePlugin.java >=================================================================== >--- src/org/eclipse/linuxtools/tmf/TmfCorePlugin.java (revision 22815) >+++ src/org/eclipse/linuxtools/tmf/TmfCorePlugin.java (working copy) >@@ -7,7 +7,7 @@ > * http://www.eclipse.org/legal/epl-v10.html > * > * Contributors: >- * Francois Chouinard (fchouinard@gmail.com) - Initial API and implementation >+ * Francois Chouinard - Initial API and implementation > *******************************************************************************/ > > package org.eclipse.linuxtools.tmf; >@@ -16,11 +16,11 @@ > import org.osgi.framework.BundleContext; > > /** >- * <b><u>Activator</u></b> >+ * <b><u>TmfCorePlugin</u></b> > * <p> > * The activator class controls the plug-in life cycle > */ >-public class Activator extends AbstractUIPlugin { >+public class TmfCorePlugin extends AbstractUIPlugin { > > // ======================================================================== > // Attributes >@@ -30,7 +30,7 @@ > public static final String PLUGIN_ID = "org.eclipse.linuxtools.tmf"; > > // The shared instance >- private static Activator plugin; >+ private static TmfCorePlugin plugin; > > // ======================================================================== > // Constructors >@@ -39,7 +39,7 @@ > /** > * The constructor > */ >- public Activator() { >+ public TmfCorePlugin() { > } > > // ======================================================================== >@@ -49,7 +49,7 @@ > /** > * @return the shared instance > */ >- public static Activator getDefault() { >+ public static TmfCorePlugin getDefault() { > return plugin; > } > >Index: src/org/eclipse/linuxtools/tmf/eventlog/TmfEventRequest.java >=================================================================== >--- src/org/eclipse/linuxtools/tmf/eventlog/TmfEventRequest.java (revision 22815) >+++ src/org/eclipse/linuxtools/tmf/eventlog/TmfEventRequest.java (working copy) >@@ -15,7 +15,7 @@ > import java.util.Vector; > > import org.eclipse.linuxtools.tmf.event.TmfEvent; >-import org.eclipse.linuxtools.tmf.event.TmfTimeWindow; >+import org.eclipse.linuxtools.tmf.event.TmfTimeRange; > > /** > * <b><u>TmfEventRequest</u></b> >@@ -68,7 +68,7 @@ > // Attributes > // ======================================================================== > >- private final TmfTimeWindow fRange; // The requested events timestamp range >+ private final TmfTimeRange fRange; // The requested events timestamp range > private final long fOffset; // The synchronization offset to apply > private final int fNbRequestedEvents; // The number of events to read (-1 == the whole range) > private final int fBlockSize; // The maximum number of events per chunk >@@ -86,7 +86,7 @@ > * @param offset > * @param nbEvents > */ >- public TmfEventRequest(TmfTimeWindow range, long offset, int nbEvents) { >+ public TmfEventRequest(TmfTimeRange range, long offset, int nbEvents) { > this(range, offset, nbEvents, DEFAULT_BLOCK_SIZE); > } > >@@ -96,7 +96,7 @@ > * @param nbEvents > * @param maxBlockSize Size of the largest blocks expected > */ >- public TmfEventRequest(TmfTimeWindow range, long offset, int nbEvents, int maxBlockSize) { >+ public TmfEventRequest(TmfTimeRange range, long offset, int nbEvents, int maxBlockSize) { > fRange = range; > fOffset = offset; > fNbRequestedEvents = nbEvents; >@@ -110,7 +110,7 @@ > /** > * @return the requested time range > */ >- public TmfTimeWindow getRange() { >+ public TmfTimeRange getRange() { > return fRange; > } > >Index: src/org/eclipse/linuxtools/tmf/eventlog/TmfTrace.java >=================================================================== >--- src/org/eclipse/linuxtools/tmf/eventlog/TmfTrace.java (revision 22815) >+++ src/org/eclipse/linuxtools/tmf/eventlog/TmfTrace.java (working copy) >@@ -16,7 +16,7 @@ > import java.util.Vector; > > import org.eclipse.linuxtools.tmf.event.TmfEvent; >-import org.eclipse.linuxtools.tmf.event.TmfTimeWindow; >+import org.eclipse.linuxtools.tmf.event.TmfTimeRange; > import org.eclipse.linuxtools.tmf.event.TmfTimestamp; > > /** >@@ -79,7 +79,7 @@ > return fEpoch; > } > >- public TmfTimeWindow getTimeRange() { >+ public TmfTimeRange getTimeRange() { > return fStream.getTimeRange(); > } > >Index: src/org/eclipse/linuxtools/tmf/eventlog/TmfEventStream.java >=================================================================== >--- src/org/eclipse/linuxtools/tmf/eventlog/TmfEventStream.java (revision 22815) >+++ src/org/eclipse/linuxtools/tmf/eventlog/TmfEventStream.java (working copy) >@@ -19,7 +19,7 @@ > import java.util.Vector; > > import org.eclipse.linuxtools.tmf.event.TmfEvent; >-import org.eclipse.linuxtools.tmf.event.TmfTimeWindow; >+import org.eclipse.linuxtools.tmf.event.TmfTimeRange; > import org.eclipse.linuxtools.tmf.event.TmfTimestamp; > > /** >@@ -55,7 +55,7 @@ > private int fNbEvents = 0; > > // The time span of the event stream >- private TmfTimeWindow fTimeRange = new TmfTimeWindow(TmfTimestamp.BigBang, TmfTimestamp.BigBang); >+ private TmfTimeRange fTimeRange = new TmfTimeRange(TmfTimestamp.BigBang, TmfTimestamp.BigBang); > > // ======================================================================== > // Constructors >@@ -105,7 +105,7 @@ > /** > * @return > */ >- public TmfTimeWindow getTimeRange() { >+ public TmfTimeRange getTimeRange() { > return fTimeRange; > } > >@@ -184,7 +184,7 @@ > location = getCurrentLocation(); > event = getNextEvent(); > } >- fTimeRange = new TmfTimeWindow(startTime, lastTime); >+ fTimeRange = new TmfTimeRange(startTime, lastTime); > } > seek(0); > } catch (IOException e) { >Index: META-INF/MANIFEST.MF >=================================================================== >--- META-INF/MANIFEST.MF (revision 22815) >+++ META-INF/MANIFEST.MF (working copy) >@@ -3,7 +3,7 @@ > Bundle-Name: TMF > Bundle-SymbolicName: org.eclipse.linuxtools.tmf > Bundle-Version: 0.0.1 >-Bundle-Activator: org.eclipse.linuxtools.tmf.Activator >+Bundle-Activator: org.eclipse.linuxtools.tmf.TmfCorePlugin > Bundle-Vendor: Eclipse > Require-Bundle: org.eclipse.ui, > org.eclipse.core.runtime, >@@ -11,5 +11,6 @@ > Bundle-RequiredExecutionEnvironment: J2SE-1.5 > Bundle-ActivationPolicy: lazy > Import-Package: org.junit.runner >-Export-Package: org.eclipse.linuxtools.tmf.event, >+Export-Package: org.eclipse.linuxtools.tmf, >+ org.eclipse.linuxtools.tmf.event, > org.eclipse.linuxtools.tmf.eventlog
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
fchouinard
:
iplog-
Actions:
View
|
Diff
Attachments on
bug 287562
: 145578 |
151266
|
151267
|
151666