Skip to content

Commit 4096f77

Browse files
committed
removed unused initializations
1 parent 6cb1ef6 commit 4096f77

File tree

1 file changed

+6
-26
lines changed

1 file changed

+6
-26
lines changed

logicaldoc-util/src/test/java/com/logicaldoc/util/config/ContextPropertiesTest.java

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,9 @@
1010
import java.util.Base64;
1111
import java.util.Properties;
1212

13-
import org.junit.After;
14-
import org.junit.Before;
1513
import org.junit.Test;
1614

1715
import com.logicaldoc.util.io.FileUtil;
18-
import com.logicaldoc.util.io.IOUtil;
1916

2017
import junit.framework.Assert;
2118

@@ -27,24 +24,6 @@
2724
*/
2825
public class ContextPropertiesTest {
2926

30-
private ContextProperties contextProperties;
31-
32-
private File propsFile = new File("target/testtest.properties");
33-
34-
@Before
35-
public void setUp() throws IOException {
36-
IOUtil.write(this.getClass().getResourceAsStream("/context.properties"), propsFile);
37-
contextProperties = new ContextProperties(propsFile);
38-
}
39-
40-
@After
41-
public void trearDown() throws IOException {
42-
FileUtil.delete(propsFile);
43-
for (File backupFile : contextProperties.getBackups()) {
44-
FileUtil.delete(backupFile);
45-
}
46-
}
47-
4827
@Test
4928
public void testWrite() throws IOException {
5029
File abcFile = new File("target/abc1.properties");
@@ -61,8 +40,9 @@ public void testWrite() throws IOException {
6140
public void testSetAndGetProperty() throws FileNotFoundException, IOException {
6241
File abcFile = new File("target/abc.properties");
6342
ContextProperties contextProperties = new ContextProperties(abcFile);
64-
65-
// testing implicit encoding and decoding in setProperty and getPoperty (ContextProperties class)
43+
44+
// testing implicit encoding and decoding in setProperty and getPoperty
45+
// (ContextProperties class)
6646
contextProperties.setProperty("propA", "pippo");
6747
contextProperties.setProperty("propB", """
6848
pippo
@@ -116,13 +96,13 @@ public void testSetAndGetProperty() throws FileNotFoundException, IOException {
11696
assertEquals("pippo\npluto\npaperino", decodedValue1);
11797

11898
assertEquals("", contextProperties.getProperty("emptyKey"));
119-
99+
120100
// no encoding in properties.setProperty
121101
String multiLineValue = """
122102
pippo
123103
pluto
124104
paperino""";
125-
properties.setProperty("propB", multiLineValue);
126-
assertEquals(multiLineValue, properties.getProperty("propB"));
105+
properties.setProperty("propB", multiLineValue);
106+
assertEquals(multiLineValue, properties.getProperty("propB"));
127107
}
128108
}

0 commit comments

Comments
 (0)