Search in sources :

Example 11 with TestSuiteInfoNew

use of cbit.vcell.numericstest.TestSuiteInfoNew in project vcell by virtualcell.

the class TestingFrmwkTreeModel method createTestSuiteTree.

private synchronized BioModelNode createTestSuiteTree(TestSuiteGroup tsg) throws DataAccessException, java.io.IOException, org.jdom.JDOMException {
    boolean isTFUser = getDocumentManager().getUser().isTestAccount();
    if (isTFUser && tsg != null && !tsg.hadUpdateTSError) {
        BioModelNode rootRootNode = new BioModelNode(TEST_SUITE_SUBTREE_NAME, true);
        // }else
        if (tsg.latestTestSuiteInfos != null) {
            Arrays.sort(tsg.latestTestSuiteInfos, new Comparator<TestSuiteInfoNew>() {

                public int compare(TestSuiteInfoNew o1, TestSuiteInfoNew o2) {
                    return o1.getTSDate().compareTo(o2.getTSDate());
                }
            });
            for (int i = 0; i < tsg.latestTestSuiteInfos.length; i++) {
                BioModelNode tsNodeNoDetail = new BioModelNode(tsg.latestTestSuiteInfos[i], true);
                tsNodeNoDetail.add(new BioModelNode(null, false));
                rootRootNode.add(tsNodeNoDetail);
            }
        }
        return rootRootNode;
    } else {
        BioModelNode rootRootNode = new BioModelNode("No TestSuites" + (!isTFUser ? " - Not TFuser" : "") + (tsg.hadUpdateTSError ? " ERROR" : ""), false);
        return rootRootNode;
    }
}
Also used : BioModelNode(cbit.vcell.desktop.BioModelNode) TestSuiteInfoNew(cbit.vcell.numericstest.TestSuiteInfoNew)

Example 12 with TestSuiteInfoNew

use of cbit.vcell.numericstest.TestSuiteInfoNew in project vcell by virtualcell.

the class TestingFrmwkTreeModel method refreshTree.

// public void refreshTree(LoadTestInfoOpResults loadTestInfoOpResults) {
// BioModelNode rootNode = getLoadTestRoot();
// //Create Load Test Info Tree
// BioModelNode loadTestInfoNode = new BioModelNode(TestingFrmwkTreeModel.LOAD_TEST_INFO_NAME, true);
// for (int i = 0; i < loadTestInfoOpResults.getLoadTestSoftwareVersionTimeStamps().length; i++) {
// LoadTestTreeInfo loadTestTreeInfo = new LoadTestTreeInfo();
// loadTestTreeInfo.loadTestSoftwareVersionTimeStamp = loadTestInfoOpResults.getLoadTestSoftwareVersionTimeStamps()[i];
// loadTestTreeInfo.userid = null;
// loadTestTreeInfo.bioOrMathModelKey = null;
// String progress = "";
// if(loadTestInfoOpResults.getLoadTestInfoEmptyCounts()[i] != null){
// double progPercent =
// (double)(loadTestInfoOpResults.getLoadTestInfoCounts()[i]-loadTestInfoOpResults.getLoadTestInfoEmptyCounts()[i])/
// (double)loadTestInfoOpResults.getLoadTestInfoCounts()[i];
// progress = " [working "+NumberUtils.formatNumber(progPercent*100, 3)+"%]";
// }
// loadTestTreeInfo.treeDisplayText =
// loadTestInfoOpResults.getLoadTestSoftwareVersionTimeStamps()[i].getSoftwareVersion()+
// " "+loadTestInfoOpResults.getLoadTestSoftwareVersionTimeStamps()[i].getRunTimeStamp()+
// " "+loadTestInfoOpResults.getLoadTestInfoCounts()[i]+" ("+
// loadTestInfoOpResults.getTotalBioAndMathmodelCount()+")"+
// progress;
// 
// BioModelNode infoNode =
// new BioModelNode(loadTestTreeInfo,false);
// loadTestInfoNode.add(infoNode);
// }
// for (int i = 0; i < rootNode.getChildCount(); i++) {
// BioModelNode childNode = (BioModelNode)rootNode.getChildAt(i);
// if(childNode.getUserObject().equals(TestingFrmwkTreeModel.LOAD_TEST_INFO_NAME)){
// removeNodeFromParent(childNode);
// insertNodeInto(loadTestInfoNode, rootNode, i);
// }
// }
// 
// //Create Load Test failed tree
// BioModelNode loadTestFailNode = new BioModelNode(TestingFrmwkTreeModel.LOAD_TEST_FAIL_NAME, true);
// Enumeration<LoadTestSoftwareVersionTimeStamp> failEnum = loadTestInfoOpResults.getLoadTestFailedHash().keys();
// while(failEnum.hasMoreElements()){
// LoadTestSoftwareVersionTimeStamp loadTestSoftwareVersionTimeStamp =
// failEnum.nextElement();
// Vector<LoadTestFailedDetails> faildetailsV = loadTestInfoOpResults.getLoadTestFailedHash().get(loadTestSoftwareVersionTimeStamp);
// BioModelNode loadTestSoftwareVersionTimeStampNode =
// new BioModelNode("("+faildetailsV.size()+") "+loadTestSoftwareVersionTimeStamp.getSoftwareVersion()+" "+
// loadTestSoftwareVersionTimeStamp.getRunTimeStamp(),true);
// loadTestFailNode.add(loadTestSoftwareVersionTimeStampNode);
// LoadTestFailedDetails[] sortedDetails = faildetailsV.toArray(new LoadTestFailedDetails[0]);
// Arrays.sort(sortedDetails,new Comparator<LoadTestFailedDetails>() {
// public int compare(LoadTestFailedDetails o1, LoadTestFailedDetails o2) {
// // TODO Auto-generated method stub
// return o1.errorMessage.compareToIgnoreCase(o2.errorMessage);
// }
// });
// for (int i = 0; i < sortedDetails.length; i++) {
// LoadTestTreeInfo loadTestTreeInfo = new LoadTestTreeInfo();
// loadTestTreeInfo.loadTestSoftwareVersionTimeStamp = loadTestSoftwareVersionTimeStamp;
// loadTestTreeInfo.userid = sortedDetails[i].userid;
// loadTestTreeInfo.bioOrMathModelKey = sortedDetails[i].modelKeyValue;
// loadTestTreeInfo.treeDisplayText =
// sortedDetails[i].userid+" ["+sortedDetails[i].modelType+"] '"+
// sortedDetails[i].modelName+"'     "+sortedDetails[i].errorMessage;
// 
// BioModelNode detailNode = new BioModelNode(loadTestTreeInfo, false);
// loadTestSoftwareVersionTimeStampNode.add(detailNode);
// }
// 
// 
// }
// for (int i = 0; i < rootNode.getChildCount(); i++) {
// BioModelNode childNode = (BioModelNode)rootNode.getChildAt(i);
// if(childNode.getUserObject().equals(TestingFrmwkTreeModel.LOAD_TEST_FAIL_NAME)){
// removeNodeFromParent(childNode);
// insertNodeInto(loadTestFailNode, rootNode, i);
// //			firePropertyChange(TS_NODE_REFRESH, childNode, finalNode);
// }
// }
// 
// }
/**
 * Insert the method's description here.
 * Creation date: (2/14/01 3:50:24 PM)
 */
public void refreshTree(final TestSuiteInfoNew tsin) {
    if (getDocumentManager() != null && getDocumentManager().getUser() != null) {
        if (getDocumentManager().getUser().isTestAccount()) {
            AsynchClientTask GetTestSuites = new AsynchClientTask("Refresh Testing FrameWork Display", AsynchClientTask.TASKTYPE_NONSWING_BLOCKING) {

                @Override
                public void run(Hashtable<String, Object> hashTable) throws Exception {
                    TestSuiteGroup tsg = new TestSuiteGroup();
                    boolean bRemove = false;
                    try {
                        TestSuiteInfoNew[] latestTestSuiteInfos = null;
                        TestSuiteNew latestTestSuite = null;
                        boolean hadUpdateTSError = false;
                        if (getDocumentManager() != null) {
                            TestSuiteInfoNew[] testSuiteInfos = null;
                            getClientTaskStatusSupport().setMessage("Getting TestsuiteInfos");
                            try {
                                testSuiteInfos = getDocumentManager().getTestSuiteInfos();
                            } catch (Throwable e) {
                                e.printStackTrace();
                                hadUpdateTSError = true;
                            }
                            if (testSuiteInfos != null) {
                                latestTestSuiteInfos = testSuiteInfos;
                                if (tsin != null) {
                                    try {
                                        getClientTaskStatusSupport().setProgress(50);
                                        if (tsin.getTSKey() != null) {
                                            // from Refesh or remove TestSuite
                                            bRemove = true;
                                            for (int i = 0; i < testSuiteInfos.length; i++) {
                                                if (testSuiteInfos[i].getTSKey().equals(tsin.getTSKey())) {
                                                    bRemove = false;
                                                    break;
                                                }
                                            }
                                            if (!bRemove) {
                                                getClientTaskStatusSupport().setMessage("Getting Testsuite " + tsin.getTSID());
                                                latestTestSuite = getDocumentManager().getTestSuite(tsin.getTSKey());
                                            } else {
                                                getClientTaskStatusSupport().setMessage("Remove Testsuite " + tsin.getTSID());
                                                latestTestSuiteInfos = new TestSuiteInfoNew[] { tsin };
                                            }
                                        } else {
                                            // from Duplicate TestSuite
                                            for (int i = 0; i < testSuiteInfos.length; i++) {
                                                if (testSuiteInfos[i].getTSID().equals(tsin.getTSID())) {
                                                    latestTestSuite = getDocumentManager().getTestSuite(testSuiteInfos[i].getTSKey());
                                                    break;
                                                }
                                            }
                                        }
                                    } catch (DataAccessException e) {
                                        tsg = new TestSuiteGroup();
                                        throw e;
                                    }
                                }
                            }
                        }
                        tsg.latestTestSuiteInfos = latestTestSuiteInfos;
                        tsg.latestTestSuite = latestTestSuite;
                        tsg.hadUpdateTSError = hadUpdateTSError;
                    } finally {
                        if (tsg.latestTestSuiteInfos != null) {
                            getClientTaskStatusSupport().setProgress(tsg.latestTestSuiteInfos.length * 100 / (tsg.latestTestSuiteInfos.length + 1));
                        }
                        hashTable.put("tsg", tsg);
                        hashTable.put("bRemove", bRemove);
                    }
                }
            };
            AsynchClientTask updateTreeTask = new AsynchClientTask("Refresh Testing FrameWork Display", AsynchClientTask.TASKTYPE_SWING_BLOCKING) {

                @Override
                public void run(Hashtable<String, Object> hashTable) throws Exception {
                    TestSuiteGroup tsg = (TestSuiteGroup) hashTable.get("tsg");
                    boolean bRemove = (Boolean) hashTable.get("bRemove");
                    updateTree(tsg, bRemove);
                }
            };
            ClientTaskDispatcher.dispatch(treeOwner.getParent(), new Hashtable<String, Object>(), new AsynchClientTask[] { GetTestSuites, updateTreeTask }, false);
        } else {
            setRoot(new BioModelNode(getDocumentManager().getUser().getName() + " Not TestAccount User"));
        }
    } else {
        setRoot(new BioModelNode("empty"));
    }
}
Also used : AsynchClientTask(cbit.vcell.client.task.AsynchClientTask) TestSuiteNew(cbit.vcell.numericstest.TestSuiteNew) Hashtable(java.util.Hashtable) BioModelNode(cbit.vcell.desktop.BioModelNode) TestSuiteInfoNew(cbit.vcell.numericstest.TestSuiteInfoNew) DataAccessException(org.vcell.util.DataAccessException)

Example 13 with TestSuiteInfoNew

use of cbit.vcell.numericstest.TestSuiteInfoNew in project vcell by virtualcell.

the class TestingFrmwkTreeModel method updateTree.

/**
 * Invoked when an action occurs.
 */
private void updateTree(final TestSuiteGroup tsg, boolean bRemove) throws Exception {
    if (tsg != null) {
        if (tsg.latestTestSuite == null && tsg.latestTestSuiteInfos != null && !bRemove) {
            BioModelNode finalNode = new BioModelNode("VCell Testing Framework");
            BioModelNode testSuiteNode = null;
            try {
                testSuiteNode = createTestSuiteTree(tsg);
            } finally {
                if (testSuiteNode == null) {
                    testSuiteNode = new BioModelNode("Error Creating TestSuite Tree", false);
                }
            }
            BioModelNode loadTestNode = null;
            try {
                loadTestNode = createLoadTestTree();
            } finally {
                if (loadTestNode == null) {
                    loadTestNode = new BioModelNode("Error Creating LoadTest Tree", false);
                }
            }
            finalNode.add(loadTestNode);
            finalNode.add(testSuiteNode);
            setRoot(finalNode);
        } else if (tsg.latestTestSuite != null && !bRemove) {
            BioModelNode finalNode = null;
            BioModelNode rootNode = getTestSuiteRoot(TestingFrmwkTreeModel.this);
            finalNode = createTestSuiteSubTree(tsg.latestTestSuite);
            for (int i = 0; i < rootNode.getChildCount(); i++) {
                BioModelNode childNode = (BioModelNode) rootNode.getChildAt(i);
                TestSuiteInfoNew childtsin = (TestSuiteInfoNew) childNode.getUserObject();
                if (childtsin.getTSKey().equals(tsg.latestTestSuite.getTSInfoNew().getTSKey())) {
                    removeNodeFromParent(childNode);
                    insertNodeInto(finalNode, rootNode, i);
                    firePropertyChange(TS_NODE_REFRESH, childNode, finalNode);
                    return;
                }
            }
            // Must be NEW TeestSuite
            // insert at top
            insertNodeInto(finalNode, rootNode, rootNode.getChildCount());
        } else if (tsg.latestTestSuiteInfos != null && bRemove) {
            // Remove tree nodes that aren't in DB
            BioModelNode rootNode = getTestSuiteRoot(TestingFrmwkTreeModel.this);
            for (int j = 0; j < tsg.latestTestSuiteInfos.length; j++) {
                for (int i = 0; i < rootNode.getChildCount(); i++) {
                    BioModelNode childNode = (BioModelNode) rootNode.getChildAt(i);
                    TestSuiteInfoNew childtsin = (TestSuiteInfoNew) childNode.getUserObject();
                    if (childtsin.getTSKey().equals(tsg.latestTestSuiteInfos[j].getTSKey())) {
                        removeNodeFromParent(childNode);
                        break;
                    }
                }
            }
        }
    }
}
Also used : BioModelNode(cbit.vcell.desktop.BioModelNode) TestSuiteInfoNew(cbit.vcell.numericstest.TestSuiteInfoNew)

Example 14 with TestSuiteInfoNew

use of cbit.vcell.numericstest.TestSuiteInfoNew in project vcell by virtualcell.

the class TestingFrameworkPanel method removeCompiledSolverTestCriteria.

public void removeCompiledSolverTestCriteria() {
    final Object selectedObj = getTreeSelection();
    if (selectedObj instanceof TestSuiteInfoNew) {
        TestSuiteInfoNew tsInfoOriginal = (TestSuiteInfoNew) selectedObj;
        TestingFrameworkWindowManager tfwm = getTestingFrameworkWindowManager();
        AsynchClientTask[] tasks = SuiteTFRemoveCompiledSolvers.createTasks(getTestingFrameworkWindowManager(), tsInfoOriginal);
        ClientTaskDispatcher.dispatch(tfwm.getComponent(), new Hashtable<String, Object>(), tasks, false);
    }
}
Also used : TestingFrameworkWindowManager(cbit.vcell.client.TestingFrameworkWindowManager) AsynchClientTask(cbit.vcell.client.task.AsynchClientTask) TestSuiteInfoNew(cbit.vcell.numericstest.TestSuiteInfoNew)

Example 15 with TestSuiteInfoNew

use of cbit.vcell.numericstest.TestSuiteInfoNew in project vcell by virtualcell.

the class NumericsTestCellRenderer method setComponentProperties.

/**
 * Insert the method's description here.
 * Creation date: (5/8/01 8:35:45 AM)
 * @return javax.swing.Icon
 * @param nodeUserObject java.lang.Object
 */
protected void setComponentProperties(javax.swing.JLabel component, Object object) {
    if (object instanceof TestSuiteInfoNew) {
        TestSuiteInfoNew tsn = (TestSuiteInfoNew) object;
        component.setText((tsn.isLocked() ? "(Lock) " : "") + "Version No. : " + tsn.getTSID() + "; Vcell Version No. : " + tsn.getTSVCellBuild() + "; Numerics Build No. : " + tsn.getTSNumericsBuild() + " ; [" + (tsn.getTSAnnotation() == null ? "" : tsn.getTSAnnotation()) + "]");
        component.setToolTipText("Test Suite Info");
    }
// if (object instanceof TestCaseNew){
// TestCaseNew testCaseInfo = (TestCaseNew)object;
// component.setText(testCaseInfo.getMathModelInfo().getVersion().getName()+ " " +testCaseInfo.getType());
// component.setToolTipText("Test Case info");
// }
// if (object instanceof TestCriteriaNew){
// TestCriteriaNew tcInfo = (TestCriteriaNew)object;
// component.setText(tcInfo.getSimInfo().getVersion().getName());
// component.setToolTipText(" Test Criteria info");
// }
}
Also used : TestSuiteInfoNew(cbit.vcell.numericstest.TestSuiteInfoNew)

Aggregations

TestSuiteInfoNew (cbit.vcell.numericstest.TestSuiteInfoNew)16 TestCaseNew (cbit.vcell.numericstest.TestCaseNew)8 TestCriteriaNew (cbit.vcell.numericstest.TestCriteriaNew)8 BioModelNode (cbit.vcell.desktop.BioModelNode)7 TestSuiteNew (cbit.vcell.numericstest.TestSuiteNew)6 Vector (java.util.Vector)6 AsynchClientTask (cbit.vcell.client.task.AsynchClientTask)5 Hashtable (java.util.Hashtable)5 DataAccessException (org.vcell.util.DataAccessException)5 BigDecimal (java.math.BigDecimal)4 TFRefresh (cbit.vcell.client.task.TFRefresh)3 TFUpdateRunningStatus (cbit.vcell.client.task.TFUpdateRunningStatus)3 TestCaseNewBioModel (cbit.vcell.numericstest.TestCaseNewBioModel)3 TestCaseNewMathModel (cbit.vcell.numericstest.TestCaseNewMathModel)3 UserCancelException (org.vcell.util.UserCancelException)3 KeyValue (org.vcell.util.document.KeyValue)3 TFGenerateReport (cbit.vcell.client.task.TFGenerateReport)2 TestCriteriaCrossRefOPResults (cbit.vcell.numericstest.TestCriteriaCrossRefOPResults)2 SimulationInfo (cbit.vcell.solver.SimulationInfo)2 ActionEvent (java.awt.event.ActionEvent)2