[927] | 1 | // Copyright 2012 Georg-August-Universität Göttingen, Germany
|
---|
| 2 | //
|
---|
| 3 | // Licensed under the Apache License, Version 2.0 (the "License");
|
---|
| 4 | // you may not use this file except in compliance with the License.
|
---|
| 5 | // You may obtain a copy of the License at
|
---|
| 6 | //
|
---|
| 7 | // http://www.apache.org/licenses/LICENSE-2.0
|
---|
| 8 | //
|
---|
| 9 | // Unless required by applicable law or agreed to in writing, software
|
---|
| 10 | // distributed under the License is distributed on an "AS IS" BASIS,
|
---|
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
| 12 | // See the License for the specific language governing permissions and
|
---|
| 13 | // limitations under the License.
|
---|
| 14 |
|
---|
[922] | 15 | package de.ugoe.cs.autoquest.plugin.guitar.eventcore;
|
---|
[197] | 16 |
|
---|
[922] | 17 | import de.ugoe.cs.autoquest.IReplayDecorator;
|
---|
| 18 | import de.ugoe.cs.autoquest.eventcore.IReplayable;
|
---|
| 19 | import de.ugoe.cs.autoquest.plugin.guitar.EFGReplayDecorator;
|
---|
[204] | 20 | import de.ugoe.cs.util.StringTools;
|
---|
[197] | 21 |
|
---|
[204] | 22 | /**
|
---|
| 23 | * <p>
|
---|
| 24 | * {@link IReplayable} used to generate test cases for the GUITAR suite.
|
---|
| 25 | * </p>
|
---|
| 26 | *
|
---|
| 27 | * @author Steffen Herbold
|
---|
| 28 | * @version 1.0
|
---|
| 29 | */
|
---|
[556] | 30 | public class GUITARReplayable implements IReplayable {
|
---|
[197] | 31 |
|
---|
[560] | 32 | /**
|
---|
| 33 | * <p>
|
---|
| 34 | * EventId in the EFG and GUI files.
|
---|
| 35 | * </p>
|
---|
| 36 | */
|
---|
| 37 | String eventId;
|
---|
[204] | 38 |
|
---|
[560] | 39 | /**
|
---|
| 40 | * <p>
|
---|
| 41 | * Id for object serialization.
|
---|
| 42 | * </p>
|
---|
| 43 | */
|
---|
| 44 | private static final long serialVersionUID = 1L;
|
---|
[197] | 45 |
|
---|
[560] | 46 | /**
|
---|
| 47 | * <p>
|
---|
| 48 | * Constructor. Creates a new {@link GUITARReplayable}.
|
---|
| 49 | * </p>
|
---|
| 50 | *
|
---|
| 51 | * @param eventId
|
---|
| 52 | */
|
---|
| 53 | public GUITARReplayable(String eventId) {
|
---|
| 54 | this.eventId = eventId;
|
---|
| 55 | }
|
---|
[204] | 56 |
|
---|
[560] | 57 | /*
|
---|
| 58 | * (non-Javadoc)
|
---|
| 59 | *
|
---|
[922] | 60 | * @see de.ugoe.cs.autoquest.eventcore.IReplayable#getReplay()
|
---|
[560] | 61 | */
|
---|
| 62 | @Override
|
---|
| 63 | public String getReplay() {
|
---|
| 64 | StringBuilder replay = new StringBuilder();
|
---|
| 65 | replay.append("<Step>" + StringTools.ENDLINE);
|
---|
| 66 | replay.append("<EventId>" + eventId + "</EventId>" + StringTools.ENDLINE);
|
---|
| 67 | replay.append("<ReachingStep>false</ReachingStep>" + StringTools.ENDLINE);
|
---|
| 68 | replay.append("</Step>" + StringTools.ENDLINE);
|
---|
| 69 | return replay.toString();
|
---|
| 70 | }
|
---|
[197] | 71 |
|
---|
[560] | 72 | /*
|
---|
| 73 | * (non-Javadoc)
|
---|
| 74 | *
|
---|
[922] | 75 | * @see de.ugoe.cs.autoquest.eventcore.IReplayable#getDecorator()
|
---|
[560] | 76 | */
|
---|
| 77 | @Override
|
---|
| 78 | public IReplayDecorator getDecorator() {
|
---|
| 79 | return EFGReplayDecorator.getInstance();
|
---|
| 80 | }
|
---|
| 81 |
|
---|
[197] | 82 | }
|
---|