{"action":"opened","issue":{"url":"https://api.github.com/repos/failys/cairis/issues/30","repository_url":"https://api.github.com/repos/failys/cairis","labels_url":"https://api.github.com/repos/failys/cairis/issues/30/labels{/name}","comments_url":"https://api.github.com/repos/failys/cairis/issues/30/comments","events_url":"https://api.github.com/repos/failys/cairis/issues/30/events","html_url":"https://github.com/failys/cairis/issues/30","id":160301379,"number":30,"title":"Component view deletion is broken","user":{"login":"failys","id":1562162,"avatar_url":"https://avatars.githubusercontent.com/u/1562162?v=3","gravatar_id":"","url":"https://api.github.com/users/failys","html_url":"https://github.com/failys","followers_url":"https://api.github.com/users/failys/followers","following_url":"https://api.github.com/users/failys/following{/other_user}","gists_url":"https://api.github.com/users/failys/gists{/gist_id}","starred_url":"https://api.github.com/users/failys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/failys/subscriptions","organizations_url":"https://api.github.com/users/failys/orgs","repos_url":"https://api.github.com/users/failys/repos","events_url":"https://api.github.com/users/failys/events{/privacy}","received_events_url":"https://api.github.com/users/failys/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/failys/cairis/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"failys","id":1562162,"avatar_url":"https://avatars.githubusercontent.com/u/1562162?v=3","gravatar_id":"","url":"https://api.github.com/users/failys","html_url":"https://github.com/failys","followers_url":"https://api.github.com/users/failys/followers","following_url":"https://api.github.com/users/failys/following{/other_user}","gists_url":"https://api.github.com/users/failys/gists{/gist_id}","starred_url":"https://api.github.com/users/failys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/failys/subscriptions","organizations_url":"https://api.github.com/users/failys/orgs","repos_url":"https://api.github.com/users/failys/repos","events_url":"https://api.github.com/users/failys/events{/privacy}","received_events_url":"https://api.github.com/users/failys/received_events","type":"User","site_admin":false},"milestone":null,"comments":0,"created_at":"2016-06-14T22:43:05Z","updated_at":"2016-06-14T22:43:05Z","closed_at":null,"body":"From the test case : \r\n\r\n================================================================ FAILURES ================================================================\r\n__________________________________________________ ComponentViewTest.testComponentView ___________________________________________________\r\n\r\nself = <cairis.test.test_ComponentView.ComponentViewTest testMethod=testComponentView>\r\n\r\n    def testComponentView(self):\r\n    \r\n      cvName = self.iComponentViews[0][\"theName\"]\r\n      cvSyn = self.iComponentViews[0][\"theSynopsis\"]\r\n      theComponents = []\r\n      for c in self.iComponentViews[0][\"theComponents\"]:\r\n        cName = c[\"theName\"]\r\n        cDesc = c[\"theDescription\"]\r\n        cInts = []\r\n        for i in c[\"theInterfaces\"]:\r\n          cInts.append((i[\"theName\"],i[\"theType\"],i[\"theAccessRight\"],i[\"thePrivilege\"]))\r\n        cStructs = []\r\n        for cs in c[\"theStructure\"]:\r\n          cStructs.append((cs[\"theHeadAsset\"],cs[\"theHeadAdornment\"],cs[\"theHeadNav\"],cs[\"theHeadNry\"],cs[\"theHeadRole\"],cs[\"theTailRole\"],cs[\"theTailNry\"],cs[\"theTailNav\"],cs[\"theTailAdornment\"],cs[\"theTailAsset\"]))\r\n        cReqs = []\r\n        cGoals = []\r\n        for i in c[\"theComponentGoals\"]:\r\n          cGoals.append(i)\r\n    \r\n        cGoalAssocs = []\r\n        for cga in c[\"theComponentGoalAssociations\"]:\r\n          cGoalAssocs.append((cga[\"theGoalName\"],cga[\"theSubGoalName\"],cga[\"theRefType\"],'None'))\r\n        theComponents.append(ComponentParameters(cName,cDesc,cInts,cStructs,cReqs,cGoals,cGoalAssocs))\r\n    \r\n      theConnectors = []\r\n      for conn in self.iComponentViews[0][\"theConnectors\"]:\r\n        theConnectors.append(ConnectorParameters(conn[\"theName\"],cvName,conn[\"theFromComponent\"],conn[\"theFromRole\"],conn[\"theFromInterface\"],conn[\"theToComponent\"],conn[\"theToInterface\"],conn[\"theToRole\"],conn[\"theAssetName\"],conn[\"theProtocol\"],conn[\"theAccessRight\"]))\r\n    \r\n      icvp = ComponentViewParameters(cvName,cvSyn,self.theMetricTypes,self.theRoles,self.theAssets,self.theRequirements,self.theGoals,theComponents,theConnectors)\r\n      b = Borg()\r\n      b.dbProxy.addComponentView(icvp)\r\n    \r\n      ocvps = b.dbProxy.getComponentViews()\r\n      ocvp = ocvps[cvName]\r\n    \r\n      self.assertEqual(icvp.name(), ocvp.name())\r\n      self.assertEqual(icvp.synopsis(), ocvp.synopsis())\r\n    \r\n>     b.dbProxy.deleteComponentView(ocvp.id())\r\n\r\ntest_ComponentView.py:116: \r\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \r\n../core/MySQLDatabaseProxy.py:9468: in deleteComponentView\r\n    self.deleteObject(cvId,'component_view')\r\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \r\n\r\nself = <cairis.core.MySQLDatabaseProxy.MySQLDatabaseProxy instance at 0xac2cdac>, objtId = 104L, tableName = 'component_view'\r\n\r\n    def deleteObject(self,objtId,tableName):\r\n      try:\r\n        curs = self.conn.cursor()\r\n        sqlTxt = 'call delete_' + tableName + '(%s)'\r\n        curs.execute(sqlTxt,[objtId])\r\n        if (curs.rowcount == -1):\r\n          exceptionText = 'Error deleting ' + tableName + ' id ' + str(objtId)\r\n          raise DatabaseProxyException(exceptionText)\r\n        curs.close()\r\n      except _mysql_exceptions.IntegrityError, e:\r\n        id,msg = e\r\n        exceptionText = 'Cannot remove ' + tableName + ' due to dependent data (id:' + str(id) + ',message:' + msg + ').'\r\n>       raise IntegrityException(exceptionText)\r\nE       IntegrityException: 'Cannot remove component_view due to dependent data (id:1451,message:Cannot delete or update a parent row: a foreign key constraint fails (`arm`.`connector`, CONSTRAINT `connector_ibfk_4` FOREIGN KEY (`to_component_id`) REFERENCES `component` (`id`))).'\r\n\r\n../core/MySQLDatabaseProxy.py:1014: IntegrityException\r\n---------------------------------------------------------- Captured stderr call ----------------------------------------------------------\r\n/home/cairisuser/cairis/cairis/core/MySQLDatabaseProxy.py:9132: Warning: Incorrect integer value: 'provided' for column 'reqId' at row 1\r\n  curs.execute('call addComponentInterface(%s,%s,%s,%s,%s)',[componentId,ifName,ifType,arName,pName])\r\n/home/cairisuser/cairis/cairis/core/MySQLDatabaseProxy.py:9132: Warning: Incorrect integer value: 'required' for column 'reqId' at row 1\r\n  curs.execute('call addComponentInterface(%s,%s,%s,%s,%s)',[componentId,ifName,ifType,arName,pName])\r\n/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py:91: Warning: No data - zero rows fetched, selected, or processed\r\n"}}
{"actor":{"display_login":"failys"}}