/** * Test method for {@link * org.talend.core.repository.model.repositoryObject.MetadataCatalogRepositoryObject#getProperty()}. */ @Test public void testGetProperty() { Catalog catalog = orgomg.cwm.resource.relational.RelationalFactory.eINSTANCE.createCatalog(); catalog.setName(CATALOG_NAME); IRepositoryViewObject mockViewObject = mock(IRepositoryViewObject.class); Property property = PropertiesFactory.eINSTANCE.createProperty(); when(mockViewObject.getProperty()).thenReturn(property); ConnectionItem connItem = PropertiesFactory.eINSTANCE.createConnectionItem(); Connection conn = ConnectionFactory.eINSTANCE.createConnection(); connItem.setConnection(conn); Catalog catalog2 = orgomg.cwm.resource.relational.RelationalFactory.eINSTANCE.createCatalog(); catalog2.setName(CATALOG_NAME); conn.getDataPackage().add(catalog2); property.setItem(connItem); MetadataCatalogRepositoryObject catalogRepObject = new MetadataCatalogRepositoryObject(mockViewObject, catalog); Property property2 = catalogRepObject.getProperty(); Assert.assertTrue(property2.equals(property)); Assert.assertTrue(catalog2.equals(catalogRepObject.getCatalog())); }
public boolean isReadOnly() { Connection connection = getFunctionUnit().getConnection(); return connection == null ? false : connection.isReadOnly(); }