From: <ba...@us...> - 2007-09-19 20:30:56
|
Revision: 922 http://obo.svn.sourceforge.net/obo/?rev=922&view=rev Author: balhoff Date: 2007-09-19 13:31:00 -0700 (Wed, 19 Sep 2007) Log Message: ----------- Updated test class to compile. The tests still have errors because of assumptions about ontology content. Modified Paths: -------------- phenote/trunk/src/java/phenote/gui/TestPhenote.java phenote/trunk/src/java/phenote/main/Phenote.java Modified: phenote/trunk/src/java/phenote/gui/TestPhenote.java =================================================================== --- phenote/trunk/src/java/phenote/gui/TestPhenote.java 2007-09-19 19:03:49 UTC (rev 921) +++ phenote/trunk/src/java/phenote/gui/TestPhenote.java 2007-09-19 20:31:00 UTC (rev 922) @@ -2,35 +2,35 @@ // move to main package?? +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + import java.awt.Toolkit; import java.awt.datatransfer.Clipboard; import java.awt.datatransfer.ClipboardOwner; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.Transferable; import java.awt.event.KeyEvent; -import java.util.Calendar; -import javax.swing.JList; + import javax.swing.event.HyperlinkEvent; import org.junit.BeforeClass; import org.junit.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; // wierd -import static org.junit.Assert.assertTrue; -import phenote.datamodel.CharacterI; -import phenote.datamodel.CharacterListI; import phenote.dataadapter.CharacterListManager; -import phenote.dataadapter.fly.FlyCharacter; import phenote.dataadapter.fly.FlyCharList; import phenote.dataadapter.fly.FlyCharListTransferable; +import phenote.dataadapter.fly.FlyCharacter; import phenote.dataadapter.fly.FlybaseDataAdapter; -import phenote.util.HtmlUtil; -import phenote.main.Phenote; +import phenote.datamodel.CharacterI; +import phenote.datamodel.CharacterListI; +import phenote.gui.field.AbstractAutoCompList; import phenote.gui.field.FieldPanel; import phenote.gui.field.SearchParamPanel; -import phenote.gui.field.AbstractAutoCompList; +import phenote.main.Phenote; +import phenote.util.HtmlUtil; // making same package as phenotes giving us access to package methods! @@ -44,7 +44,7 @@ private static AbstractAutoCompList entityComboBox; private static AbstractAutoCompList qualityComboBox; private static TermInfo termInfo; - private static CharacterTablePanel characterTablePanel; + private static CharacterTableController tableController; /** @BeforeClass says to run this once before all the tests */ @BeforeClass public static void init() { @@ -64,7 +64,7 @@ qualityComboBox = fieldPanel.getQualityComboBox(); qualityComboBox.setTestMode(true); termInfo = phenote.getTermInfo(); - characterTablePanel = phenote.getCharacterTablePanel(); + tableController = phenote.getCharacterTableController(); } /** @Test is an annotation defined in Test - Test looks for Test methods */ @@ -136,10 +136,12 @@ table in entity column */ private void comboTermSelectionGoesToTableTest() { // selecting item should make it go in table... + tableController.addNewCharacter(); + tableController.getSelectionModel().setSelectionInterval(0,0); System.out.println("Selecting 3rd entity item"); qualityComboBox.getJComboBox().setSelectedIndex(2); // 2 is 3rd String selectedQualityTerm = getQualityThirdAutoTerm(); - CharacterI selPheno = characterTablePanel.getSelectedCharacter(); + CharacterI selPheno = tableController.getSelectionModel().getSelected().get(0); String tableQuality = selPheno.getQuality().getName(); // oboclass assertEquals(selectedQualityTerm,tableQuality); System.out.println("term to table test passed, selected quality term " @@ -225,8 +227,8 @@ } private void flyDataAdapterTest() { - CharacterListI cl = characterTablePanel.getCharacterList(); - characterTablePanel.pressCommitButtonTest(); + CharacterListI cl = CharacterListManager.main().getCharacterList(); + DataFlavor charListFlavor = FlyCharListTransferable.getCharListDataFlavor(); try { Object o = getClipboard().getData(charListFlavor); Modified: phenote/trunk/src/java/phenote/main/Phenote.java =================================================================== --- phenote/trunk/src/java/phenote/main/Phenote.java 2007-09-19 19:03:49 UTC (rev 921) +++ phenote/trunk/src/java/phenote/main/Phenote.java 2007-09-19 20:31:00 UTC (rev 922) @@ -53,11 +53,11 @@ private static Logger LOG = Logger.getLogger(Phenote.class); private static boolean standalone = false; // default for servlet - private JPanel characterTablePanel; private FieldPanel mainFieldPanel; private static Phenote phenote; private TermInfo termInfo; private SelectionHistory selectionHistory; + private CharacterTableController tableController; private CommandLine commandLine = CommandLine.inst(); private JFrame frame; public SplashScreen splashScreen; @@ -349,11 +349,10 @@ JPanel infoHistoryPanel = new JPanel(new GridBagLayout()); infoHistoryPanel.setBorder(new EmptyBorder(10,10,10,10)); - CharacterTableController tableController = new CharacterTableController(group.getName()); - characterTablePanel = tableController.getCharacterTablePanel(); + this.tableController = new CharacterTableController(group.getName()); // need to do different selection & edit mgrs - FieldPanel groupFieldPanel = new FieldPanel(true,false,group.getName(), tableController.getSelectionModel()); + FieldPanel groupFieldPanel = new FieldPanel(true,false,group.getName(), this.tableController.getSelectionModel()); groupFieldPanel.setBorder(new EmptyBorder(10,10,10,10)); // for testing - thats it if (group == null || group.getName().equals("default")) @@ -374,7 +373,7 @@ - JSplitPane outerSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, true, innerSplitPane, characterTablePanel); + JSplitPane outerSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, true, innerSplitPane, this.tableController.getCharacterTablePanel()); mainPanel.add(outerSplitPane); return mainPanel; } @@ -427,6 +426,7 @@ public FieldPanel getFieldPanel() { return mainFieldPanel; } public TermInfo getTermInfo() { return termInfo; } //public CharacterTablePanel getCharacterTablePanel() { return characterTablePanel; } + public CharacterTableController getCharacterTableController() { return this.tableController; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |