import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
@Test
public void testObadvice() {
- Obadvice data = new Obadvice();
new Obadvice();
new Obadvice("Test", "Test");
+ new Obadvice(new DummyIdentifier(), "Test");
+ Obadvice data = new Obadvice();
data.clone();
data.addObadviceExpression(new ObadviceExpression());
+ assertNotNull(data.clone());
data.removeObadviceExpression(new ObadviceExpression());
data.removeAllExpressions();
+ assertEquals(0, data.getObadviceExpressions().size());
+ data.setObadviceExpressions(null);
+ assertNull(data.getObadviceExpressions());
+ data.removeAllExpressions();
data.prePersist();
data.preUpdate();
data.setId(1);
assertTrue("Test".equals(data.getType()));
data.setXacmlId("Test");
assertTrue("Test".equals(data.getXacmlId()));
+
}
@Test
data.setXacmlId("Test");
assertTrue("Test".equals(data.getXacmlId()));
data.toString();
+
+ RuleAlgorithms ra0 = new RuleAlgorithms(new DummyIdentifier());
+ assertTrue(ra0.isStandard());
+ assertFalse(ra0.isCustom());
+ RuleAlgorithms ra1 = new RuleAlgorithms(new DummyIdentifier(), 'C');
+ assertFalse(ra1.isStandard());
+ assertTrue(ra1.isCustom());
}
@Test
assertTrue("Test".equals(data.getXacmlId()));
data.setIsStandard(PolicyAlgorithms.STANDARD);
assertTrue(data.isStandard());
+ assertFalse(data.isCustom());
+ data.setIsStandard(PolicyAlgorithms.CUSTOM);
+ assertFalse(data.isStandard());
+ assertTrue(data.isCustom());
+
+ DummyIdentifier identifier = new DummyIdentifier();
+ assertNotNull(new PolicyAlgorithms(identifier));
+ assertNotNull(new PolicyAlgorithms(identifier, 'C'));
}
}