git.hedgecode.org
/
snooker-score-api.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[LIB-5] Change tests serialize
[snooker-score-api.git]
/
src
/
test
/
java
/
org
/
hedgecode
/
snooker
/
json
/
AbstractJsonTest.java
diff --git
a/src/test/java/org/hedgecode/snooker/json/AbstractJsonTest.java
b/src/test/java/org/hedgecode/snooker/json/AbstractJsonTest.java
index
0ef6fa6
..
6158dc3
100644
(file)
--- a/
src/test/java/org/hedgecode/snooker/json/AbstractJsonTest.java
+++ b/
src/test/java/org/hedgecode/snooker/json/AbstractJsonTest.java
@@
-24,6
+24,7
@@
import java.io.FileReader;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
+import java.io.Serializable;
import com.google.gson.Gson;
import com.google.gson.Gson;
@@
-49,7
+50,7
@@
public abstract class AbstractJsonTest extends Assert {
getClass().getSimpleName() + JSON_EXT
).getFile()
);
getClass().getSimpleName() + JSON_EXT
).getFile()
);
- private final File serFile =
+ private final File ser
ialize
File =
new File(
jsonFile.getParent() + File.separator
+ getClass().getSimpleName() + SERIALIZE_EXT
new File(
jsonFile.getParent() + File.separator
+ getClass().getSimpleName() + SERIALIZE_EXT
@@
-79,30
+80,30
@@
public abstract class AbstractJsonTest extends Assert {
return sb.toString();
}
return sb.toString();
}
- protected void serialize(
JsonSerializable json
Object) throws IOException {
+ protected void serialize(
Serializable serialize
Object) throws IOException {
try (ObjectOutputStream oos =
new ObjectOutputStream(
new FileOutputStream(
try (ObjectOutputStream oos =
new ObjectOutputStream(
new FileOutputStream(
- serFile.getAbsolutePath()
+ ser
ialize
File.getAbsolutePath()
)
)
) {
)
)
) {
- oos.writeObject(
json
Object);
+ oos.writeObject(
serialize
Object);
}
}
}
}
- protected
Json
Serializable deserialize() throws IOException, ClassNotFoundException {
-
JsonSerializable json
Object;
+ protected Serializable deserialize() throws IOException, ClassNotFoundException {
+
Serializable deserialize
Object;
try (ObjectInputStream ois =
new ObjectInputStream(
new FileInputStream(
try (ObjectInputStream ois =
new ObjectInputStream(
new FileInputStream(
- serFile.getAbsolutePath()
+ ser
ialize
File.getAbsolutePath()
)
)
) {
)
)
) {
-
jsonObject = (Json
Serializable) ois.readObject();
+
deserializeObject = (
Serializable) ois.readObject();
}
}
- return
json
Object;
+ return
deserialize
Object;
}
}
}
}