This commit is contained in:
parent
1375020388
commit
8cfc21bc3c
|
@ -18,7 +18,7 @@ public class Msq {
|
||||||
|
|
||||||
public List<Page> page = new ArrayList<>();
|
public List<Page> page = new ArrayList<>();
|
||||||
|
|
||||||
private final VersionInfo versionInfo;
|
public final VersionInfo versionInfo;
|
||||||
|
|
||||||
public Msq() {
|
public Msq() {
|
||||||
versionInfo = new VersionInfo("rusEFI+2020");
|
versionInfo = new VersionInfo("rusEFI+2020");
|
||||||
|
@ -36,7 +36,7 @@ public class Msq {
|
||||||
@NotNull
|
@NotNull
|
||||||
public static Msq create(int totalConfigSize, String tsSignature) {
|
public static Msq create(int totalConfigSize, String tsSignature) {
|
||||||
Msq tune = new Msq();
|
Msq tune = new Msq();
|
||||||
tune.versionInfo.setTsSignature(tsSignature);
|
tune.versionInfo.setSignature(tsSignature);
|
||||||
tune.page.add(new Page(null, null));
|
tune.page.add(new Page(null, null));
|
||||||
tune.page.add(new Page(0, totalConfigSize));
|
tune.page.add(new Page(0, totalConfigSize));
|
||||||
return tune;
|
return tune;
|
||||||
|
@ -84,7 +84,6 @@ public class Msq {
|
||||||
return new Bibliography();
|
return new Bibliography();
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlElement
|
|
||||||
public VersionInfo getVersionInfo() {
|
public VersionInfo getVersionInfo() {
|
||||||
return versionInfo;
|
return versionInfo;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ import javax.xml.bind.annotation.XmlAttribute;
|
||||||
|
|
||||||
public class VersionInfo {
|
public class VersionInfo {
|
||||||
private String firmwareInfo;
|
private String firmwareInfo;
|
||||||
private String tsSignature;
|
private String signature;
|
||||||
|
|
||||||
public VersionInfo() {
|
public VersionInfo() {
|
||||||
}
|
}
|
||||||
|
@ -30,14 +30,14 @@ public class VersionInfo {
|
||||||
|
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
public String getSignature() {
|
public String getSignature() {
|
||||||
return tsSignature;
|
return signature;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFirmwareInfo(String firmwareInfo) {
|
public void setFirmwareInfo(String firmwareInfo) {
|
||||||
this.firmwareInfo = firmwareInfo;
|
this.firmwareInfo = firmwareInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTsSignature(String tsSignature) {
|
public void setSignature(String signature) {
|
||||||
this.tsSignature = tsSignature;
|
this.signature = signature;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@ import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* from IDEA this unit test needs to be executed with "empty" working directory
|
* from IDEA this unit test needs to be executed with "empty" working directory
|
||||||
|
@ -32,6 +33,7 @@ public class TuneReadWriteTest {
|
||||||
public void testCompareBinaryToTSTune() throws Exception {
|
public void testCompareBinaryToTSTune() throws Exception {
|
||||||
Msq tsTune = Msq.readTune(PATH + "CurrentTune.msq");
|
Msq tsTune = Msq.readTune(PATH + "CurrentTune.msq");
|
||||||
System.out.println(tsTune);
|
System.out.println(tsTune);
|
||||||
|
assertNotNull("signature", tsTune.getVersionInfo().getSignature());
|
||||||
|
|
||||||
ConfigurationImage tsBinaryData = tsTune.asImage(IniFileModel.getInstance(), Fields.TOTAL_CONFIG_SIZE);
|
ConfigurationImage tsBinaryData = tsTune.asImage(IniFileModel.getInstance(), Fields.TOTAL_CONFIG_SIZE);
|
||||||
|
|
||||||
|
@ -55,6 +57,7 @@ public class TuneReadWriteTest {
|
||||||
|
|
||||||
// and now reading that XML back
|
// and now reading that XML back
|
||||||
Msq tuneFromFile = Msq.readTune(fileName);
|
Msq tuneFromFile = Msq.readTune(fileName);
|
||||||
|
assertNotNull(tuneFromFile.getVersionInfo().getSignature());
|
||||||
|
|
||||||
ConfigurationImage binaryDataFromXml = tuneFromFile.asImage(IniFileModel.getInstance(), Fields.TOTAL_CONFIG_SIZE);
|
ConfigurationImage binaryDataFromXml = tuneFromFile.asImage(IniFileModel.getInstance(), Fields.TOTAL_CONFIG_SIZE);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue