Skip to content

Commit 56b2039

Browse files
committed
Change name of BooleanToogleModification to BooleanToggleModification
Create tests for equals methods
1 parent 3b88e88 commit 56b2039

11 files changed

+584
-10
lines changed

src/main/java/de/rub/nds/modifiablevariable/VariableModification.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import de.rub.nds.modifiablevariable.biginteger.BigIntegerSubtractModification;
1717
import de.rub.nds.modifiablevariable.biginteger.BigIntegerXorModification;
1818
import de.rub.nds.modifiablevariable.bool.BooleanExplicitValueModification;
19-
import de.rub.nds.modifiablevariable.bool.BooleanToogleModification;
19+
import de.rub.nds.modifiablevariable.bool.BooleanToggleModification;
2020
import de.rub.nds.modifiablevariable.bytearray.*;
2121
import de.rub.nds.modifiablevariable.filter.AccessModificationFilter;
2222
import de.rub.nds.modifiablevariable.integer.IntegerAddModification;
@@ -42,7 +42,7 @@
4242
@XmlTransient
4343
@XmlSeeAlso({ AccessModificationFilter.class, BigIntegerAddModification.class, BigIntegerInteractiveModification.class,
4444
BigIntegerExplicitValueModification.class, BigIntegerSubtractModification.class,
45-
BooleanExplicitValueModification.class, BooleanToogleModification.class, BigIntegerXorModification.class,
45+
BooleanExplicitValueModification.class, BooleanToggleModification.class, BigIntegerXorModification.class,
4646
BigIntegerShiftLeftModification.class, BigIntegerShiftRightModification.class, IntegerAddModification.class,
4747
IntegerExplicitValueModification.class, IntegerSubtractModification.class, IntegerXorModification.class,
4848
IntegerShiftLeftModification.class, IntegerShiftRightModification.class, ByteArrayDeleteModification.class,

src/main/java/de/rub/nds/modifiablevariable/bool/BooleanModificationFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ public static VariableModification<Boolean> createRandomModification() {
2424
case 1:
2525
return new BooleanExplicitValueModification(false);
2626
case 2:
27-
return new BooleanToogleModification();
27+
return new BooleanToggleModification();
2828
}
2929
return null;
3030
}
3131

3232
public static VariableModification<Boolean> toogle() {
33-
return new BooleanToogleModification();
33+
return new BooleanToggleModification();
3434
}
3535

3636
public static VariableModification<Boolean> explicitValue(final boolean explicitValue) {

src/main/java/de/rub/nds/modifiablevariable/bool/BooleanToogleModification.java renamed to src/main/java/de/rub/nds/modifiablevariable/bool/BooleanToggleModification.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414

1515
@XmlRootElement
1616
@XmlType(propOrder = { "modificationFilter", "postModification" })
17-
public class BooleanToogleModification extends VariableModification<Boolean> {
17+
public class BooleanToggleModification extends VariableModification<Boolean> {
1818

19-
public BooleanToogleModification() {
19+
public BooleanToggleModification() {
2020
}
2121

2222
@Override
@@ -29,7 +29,7 @@ protected Boolean modifyImplementationHook(Boolean input) {
2929

3030
@Override
3131
public VariableModification<Boolean> getModifiedCopy() {
32-
return new BooleanToogleModification();
32+
return new BooleanToggleModification();
3333
}
3434

3535
@Override

src/main/java/de/rub/nds/modifiablevariable/util/Modifiable.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import de.rub.nds.modifiablevariable.biginteger.BigIntegerModificationFactory;
55
import de.rub.nds.modifiablevariable.biginteger.ModifiableBigInteger;
66
import de.rub.nds.modifiablevariable.bool.BooleanExplicitValueModification;
7-
import de.rub.nds.modifiablevariable.bool.BooleanToogleModification;
7+
import de.rub.nds.modifiablevariable.bool.BooleanToggleModification;
88
import de.rub.nds.modifiablevariable.bool.ModifiableBoolean;
99
import de.rub.nds.modifiablevariable.bytearray.ByteArrayModificationFactory;
1010
import de.rub.nds.modifiablevariable.bytearray.ModifiableByteArray;
@@ -150,7 +150,7 @@ public static ModifiableByteArray duplicate() {
150150
}
151151

152152
public static ModifiableBoolean toggle() {
153-
return getModifiableBooleanWithModification(new BooleanToogleModification());
153+
return getModifiableBooleanWithModification(new BooleanToggleModification());
154154
}
155155

156156
public static ModifiableBigInteger shiftLeftBigInteger(Integer i) {
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
/*
2+
* Copyright 2019 captain.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package de.rub.nds.modifiablevariable.biginteger;
17+
18+
import java.math.BigInteger;
19+
import org.junit.Before;
20+
import org.junit.Test;
21+
import static org.junit.Assert.*;
22+
23+
/**
24+
*
25+
* @author captain
26+
*/
27+
public class BigIntegerAddModificationTest {
28+
29+
private BigIntegerAddModification b1;
30+
31+
private BigIntegerAddModification b2;
32+
33+
private BigIntegerAddModification b3;
34+
35+
private Integer integer1;
36+
37+
@Before
38+
public void setUp() {
39+
b1 = new BigIntegerAddModification(BigInteger.ONE);
40+
b2 = new BigIntegerAddModification(BigInteger.TEN);
41+
b3 = new BigIntegerAddModification(BigInteger.ONE);
42+
integer1 = 1;
43+
}
44+
45+
/**
46+
* Test of modifyImplementationHook method, of class
47+
* BigIntegerAddModification.
48+
*/
49+
@Test
50+
public void testModifyImplementationHook() {
51+
}
52+
53+
/**
54+
* Test of getSummand method, of class BigIntegerAddModification.
55+
*/
56+
@Test
57+
public void testGetSummand() {
58+
}
59+
60+
/**
61+
* Test of setSummand method, of class BigIntegerAddModification.
62+
*/
63+
@Test
64+
public void testSetSummand() {
65+
}
66+
67+
/**
68+
* Test of getModifiedCopy method, of class BigIntegerAddModification.
69+
*/
70+
@Test
71+
public void testGetModifiedCopy() {
72+
}
73+
74+
/**
75+
* Test of hashCode method, of class BigIntegerAddModification.
76+
*/
77+
@Test
78+
public void testHashCode() {
79+
}
80+
81+
/**
82+
* Test of equals method, of class BigIntegerAddModification.
83+
*/
84+
@Test
85+
public void testEquals() {
86+
assertFalse(b1.equals(b2));
87+
assertFalse(b1.equals(integer1));
88+
assertTrue(b1.equals(b1));
89+
assertTrue(b1.equals(b3));
90+
}
91+
92+
}
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
/*
2+
* Copyright 2019 captain.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package de.rub.nds.modifiablevariable.biginteger;
17+
18+
import java.math.BigInteger;
19+
import org.junit.Before;
20+
import org.junit.Test;
21+
import static org.junit.Assert.*;
22+
23+
/**
24+
*
25+
* @author captain
26+
*/
27+
public class BigIntegerExplicitValueModificationTest {
28+
29+
private BigIntegerExplicitValueModification b1;
30+
private BigIntegerExplicitValueModification b2;
31+
private BigIntegerExplicitValueModification b3;
32+
private Integer integer1;
33+
34+
@Before
35+
public void setUp() {
36+
b1 = new BigIntegerExplicitValueModification(BigInteger.ONE);
37+
b2 = new BigIntegerExplicitValueModification(BigInteger.TEN);
38+
b3 = new BigIntegerExplicitValueModification(BigInteger.ONE);
39+
integer1 = 1;
40+
}
41+
42+
/**
43+
* Test of modifyImplementationHook method, of class
44+
* BigIntegerExplicitValueModification.
45+
*/
46+
@Test
47+
public void testModifyImplementationHook() {
48+
}
49+
50+
/**
51+
* Test of getExplicitValue method, of class
52+
* BigIntegerExplicitValueModification.
53+
*/
54+
@Test
55+
public void testGetExplicitValue() {
56+
}
57+
58+
/**
59+
* Test of setExplicitValue method, of class
60+
* BigIntegerExplicitValueModification.
61+
*/
62+
@Test
63+
public void testSetExplicitValue() {
64+
}
65+
66+
/**
67+
* Test of getModifiedCopy method, of class
68+
* BigIntegerExplicitValueModification.
69+
*/
70+
@Test
71+
public void testGetModifiedCopy() {
72+
}
73+
74+
/**
75+
* Test of hashCode method, of class BigIntegerExplicitValueModification.
76+
*/
77+
@Test
78+
public void testHashCode() {
79+
}
80+
81+
/**
82+
* Test of equals method, of class BigIntegerExplicitValueModification.
83+
*/
84+
@Test
85+
public void testEquals() {
86+
assertFalse(b1.equals(b2));
87+
assertFalse(b1.equals(integer1));
88+
assertTrue(b1.equals(b1));
89+
assertTrue(b1.equals(b3));
90+
}
91+
92+
}
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
/*
2+
* Copyright 2019 captain.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package de.rub.nds.modifiablevariable.biginteger;
17+
18+
import java.math.BigInteger;
19+
import org.junit.After;
20+
import org.junit.AfterClass;
21+
import org.junit.Before;
22+
import org.junit.BeforeClass;
23+
import org.junit.Test;
24+
import static org.junit.Assert.*;
25+
26+
/**
27+
*
28+
* @author captain
29+
*/
30+
public class BigIntegerSubtractModificationTest {
31+
32+
private BigIntegerSubtractModification b1;
33+
private BigIntegerSubtractModification b2;
34+
private BigIntegerSubtractModification b3;
35+
private Integer integer1;
36+
37+
@Before
38+
public void setUp() {
39+
b1 = new BigIntegerSubtractModification(BigInteger.ONE);
40+
b2 = new BigIntegerSubtractModification(BigInteger.TEN);
41+
b3 = new BigIntegerSubtractModification(BigInteger.ONE);
42+
integer1 = 1;
43+
}
44+
45+
/**
46+
* Test of modifyImplementationHook method, of class
47+
* BigIntegerSubtractModification.
48+
*/
49+
@Test
50+
public void testModifyImplementationHook() {
51+
}
52+
53+
/**
54+
* Test of getSubtrahend method, of class BigIntegerSubtractModification.
55+
*/
56+
@Test
57+
public void testGetSubtrahend() {
58+
}
59+
60+
/**
61+
* Test of setSubtrahend method, of class BigIntegerSubtractModification.
62+
*/
63+
@Test
64+
public void testSetSubtrahend() {
65+
}
66+
67+
/**
68+
* Test of getModifiedCopy method, of class BigIntegerSubtractModification.
69+
*/
70+
@Test
71+
public void testGetModifiedCopy() {
72+
}
73+
74+
/**
75+
* Test of hashCode method, of class BigIntegerSubtractModification.
76+
*/
77+
@Test
78+
public void testHashCode() {
79+
}
80+
81+
/**
82+
* Test of equals method, of class BigIntegerSubtractModification.
83+
*/
84+
@Test
85+
public void testEquals() {
86+
assertFalse(b1.equals(b2));
87+
assertFalse(b1.equals(integer1));
88+
assertTrue(b1.equals(b1));
89+
assertTrue(b1.equals(b3));
90+
}
91+
92+
}

0 commit comments

Comments
 (0)