/** * Accuracy test for the method <code>getCommonProjectMetadataKeys()</code>.<br> * The result should be correct. * * @throws Exception to JUnit. */ @Test public void test_getCommonProjectMetadataKeys_1() throws Exception { em.getTransaction().begin(); instance.createProjectMetadataKey(projectMetadataKey, userId); em.getTransaction().commit(); List<DirectProjectMetadataKey> res = instance.getCommonProjectMetadataKeys(); assertEquals("'getCommonProjectMetadataKeys' should be correct.", 2, res.size()); DirectProjectMetadataKey directProjectMetadataKey = res.get(0); if (directProjectMetadataKey.getId() != projectMetadataKey.getId()) { directProjectMetadataKey = res.get(1); } assertEquals( "'getCommonProjectMetadataKeys' should be correct.", "name3", directProjectMetadataKey.getName()); assertEquals( "'getCommonProjectMetadataKeys' should be correct.", "some text", directProjectMetadataKey.getDescription()); assertNull( "'getCommonProjectMetadataKeys' should be correct.", directProjectMetadataKey.getClientId()); assertNull( "'getCommonProjectMetadataKeys' should be correct.", directProjectMetadataKey.getGrouping()); assertTrue( "'getCommonProjectMetadataKeys' should be correct.", directProjectMetadataKey.isSingle()); }
/** * Accuracy test for the method <code>getCommonProjectMetadataKeys()</code>.<br> * The result should be correct. * * @throws Exception to JUnit. */ @Test public void test_getCommonProjectMetadataKeys_2() throws Exception { TestsHelper.clearDB(em); List<DirectProjectMetadataKey> res = instance.getCommonProjectMetadataKeys(); assertEquals("'getCommonProjectMetadataKeys' should be correct.", 0, res.size()); }