@Test public void testWorkDefinitionMatchWorkDefinitionString() { IAtsWorkDefinition workDef = new MockWorkDefinition("mine"); WorkDefinitionMatch match = new WorkDefinitionMatch(workDef.getName(), "trace"); match.setWorkDefinition(workDef); Assert.assertNotNull(match.getWorkDefinition()); Assert.assertFalse(match.getTrace().isEmpty()); }
@Test public void testAddTrace() { WorkDefinitionMatch match = new WorkDefinitionMatch(); Assert.assertTrue(match.getTrace().isEmpty()); match.addTrace("trace 1"); Assert.assertEquals("trace 1", match.getTrace().iterator().next()); match.addTrace("trace 1"); Assert.assertEquals(1, match.getTrace().size()); Assert.assertEquals("trace 1", match.getTrace().iterator().next()); match.addTrace("trace 2"); Assert.assertEquals("trace 1", match.getTrace().iterator().next()); Assert.assertEquals(2, match.getTrace().size()); }
@Test public void testWorkDefinitionMatch() { WorkDefinitionMatch match = new WorkDefinitionMatch(); Assert.assertNull(match.getWorkDefinition()); Assert.assertTrue(match.getTrace().isEmpty()); }