Tasks #2400
Generator API for a single RST type
Status: | Resolved | Start date: | 10/09/2015 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | H. Oestreich | % Done: | 100% | |
Category: | - | |||
Target version: | 0.1 |
Description
- frequency
- user-defined payload (size)
rst.classification.ClassifiedRegion2D
g = new Generator(); g.addPayload(new Payload() {sfsdfsdf}.setTiming(new GridTiming(1Hz, 100 Hz, 10Hz))); g.addPayload(new Payload() {sfsdfsdf}.setTiming(new GridTiming(1Hz, 100 Hz, 10Hz))); g.execute();
Subtasks
History
#1 Updated by J. Wienke over 8 years ago
- Description updated (diff)
#2 Updated by H. Oestreich over 8 years ago
- % Done changed from 0 to 30
First version has been implemented and uploaded to the repo.
No evaluation and tests done yet. Will be done next week.
#3 Updated by H. Oestreich over 8 years ago
The current implementation looks like this:
final Generator generator = new Generator(); //Generation of the RST Object [...] // Generation of the payload final Payload payload = new Payload() {}; payload.setData(clRe2D); // clRe2D = RST Object from Type ClassifiedRegion2D payload.setScope(new Scope(scope)); final TimingGrid tg = new TimingGrid(); tg.addEntryAtEnd(new FrequencyDuration(1000, 15)); tg.addEntryAtEnd(new FrequencyDuration(5000, 30)); payload.setTiming(tg); // Adding the generated payload to the generator and executing it generator.addPayload(payload); generator.execute();
This does not exactly look like what Johannes proposed in the ticket, but it has been tested successfully.
I did take a look at the Google Protocol Buffers / RST Generated Java Files, but I was not able to adapt my implementation to that style yet.
#4 Updated by H. Oestreich over 8 years ago
- Status changed from New to In Progress
The API now got as simple as:
final Generator generator = new Generator(); generator.addTestPhase(createFrequencyScalingPhase()); generator.execute();
And and example for the creation of a test Phase:
final SimplePhase rpcCapture = new SimplePhase(); rpcCapture.setTiming(new OneTimeExecutionTiming()); rpcCapture.setTransaction(new RPCTransaction("capture", new Event(Long.class, new Long(0)), Factory.getInstance().createRemoteServer(scope))); generator.addTestPhase(rpcCapture);
Waiting for the release of version 0.1 before closing this ticket.
#5 Updated by H. Oestreich over 8 years ago
- Status changed from In Progress to Resolved