Added test sources

This commit is contained in:
ebner
2011-10-21 10:56:32 +02:00
parent 3b21bdef30
commit 43034e80f9
32 changed files with 1922 additions and 0 deletions
+7
View File
@@ -112,6 +112,13 @@
<version>RELEASE701</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
<scope>test</scope>
<type>jar</type>
</dependency>
</dependencies>
<build>
@@ -0,0 +1,80 @@
/*
* Copyright (C) 2011 Paul Scherrer Institute
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ch.psi.fda.ui.ce.panels;
import javax.swing.JFrame;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
/**
*
* @author ebner
*/
public class CollapsibleListContainerTest {
private final static long PANEL_OPEN_TIME = 10000;
public CollapsibleListContainerTest() {
}
@BeforeClass
public static void setUpClass() throws Exception {
}
@AfterClass
public static void tearDownClass() throws Exception {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
@Test
public void testSetAction() throws InterruptedException {
// final JFrame frame = new JFrame();
// CollapsibleListContainer<String> instance = new CollapsibleListContainer<String>(new DefaultListItemProvider());
// instance.setHeader("Test Container");
// instance.setCollapsed(true);
// frame.add(instance);
// frame.pack();
//
// java.awt.EventQueue.invokeLater(new Runnable() {
// @Override
// public void run() {
// frame.setVisible(true);
// }
// });
//
// Thread.sleep(PANEL_OPEN_TIME);
//
// for(String a: instance.getItems()){
// Logger.getLogger(CollapsibleListContainerTest.class.getName()).log(Level.INFO, "Action - {0}", a.getClass().getCanonicalName());
// }
}
}
@@ -0,0 +1,90 @@
/*
* Copyright (C) 2011 Paul Scherrer Institute
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ch.psi.fda.ui.ce.panels.model;
import ch.psi.fda.model.v1.Action;
import javax.swing.JFrame;
import ch.psi.fda.model.v1.ChannelAction;
import ch.psi.fda.ui.ce.panels.CollapsibleListContainer;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
/**
*
* @author ebner
*/
public class ActionPanelTest {
private final static long PANEL_OPEN_TIME = 10000;
public ActionPanelTest() {
}
@BeforeClass
public static void setUpClass() throws Exception {
}
@AfterClass
public static void tearDownClass() throws Exception {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
@Test
public void testPanel() throws InterruptedException {
ChannelAction action = new ChannelAction();
action.setChannel("MY-CHANNEL");
List<Action> list = new ArrayList<Action>();
list.add(action);
final JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
CollapsibleListContainer<Action> instance = new CollapsibleListContainer<Action>(new ActionListItemProvider(list));
instance.setHeader("Actions");
frame.add(instance);
frame.pack();
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
frame.setVisible(true);
}
});
Thread.sleep(PANEL_OPEN_TIME);
for(Action a: list){
Logger.getLogger(ActionPanelTest.class.getName()).log(Level.INFO, "Action - {0}", a.getClass().getCanonicalName());
}
}
}
@@ -0,0 +1,74 @@
/*
* Copyright (C) 2011 Paul Scherrer Institute
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ch.psi.fda.ui.ce.panels.model;
import javax.swing.JFrame;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
/**
*
* @author ebner
*/
public class ArrayDetectorPanelTest {
private final static long PANEL_OPEN_TIME = 1000000;
public ArrayDetectorPanelTest() {
}
@BeforeClass
public static void setUpClass() throws Exception {
}
@AfterClass
public static void tearDownClass() throws Exception {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
@Test
public void testPanel() throws InterruptedException {
final JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
ArrayDetectorPanel instance = new ArrayDetectorPanel();
// RegionPanel instance = new RegionPanel();
frame.add(instance);
frame.pack();
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
frame.setVisible(true);
}
});
Thread.sleep(PANEL_OPEN_TIME);
}
}
@@ -0,0 +1,84 @@
/*
* Copyright (C) 2011 Paul Scherrer Institute
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ch.psi.fda.ui.ce.panels.model;
import ch.psi.fda.model.v1.ArrayPositioner;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JFrame;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
/**
*
* @author ebner
*/
public class ArrayPositionerPanelTest {
private final static long PANEL_OPEN_TIME = 10000;
public ArrayPositionerPanelTest() {
}
@BeforeClass
public static void setUpClass() throws Exception {
}
@AfterClass
public static void tearDownClass() throws Exception {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of getObject method, of class ArrayPositionerPanel.
*/
@Test
public void testGetObject() throws InterruptedException {
final JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
ArrayPositioner p = new ArrayPositioner();
ArrayPositionerPanel instance = new ArrayPositionerPanel(p);
frame.add(instance);
frame.pack();
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
frame.setVisible(true);
}
});
Thread.sleep(PANEL_OPEN_TIME);
Logger.getLogger(ArrayPositionerPanelTest.class.getName()).log(Level.INFO, "Positioner {0} - Positions: {1}", new Object[]{p.getName(), p.getPositions()});
}
}
@@ -0,0 +1,81 @@
/*
* Copyright (C) 2011 Paul Scherrer Institute
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ch.psi.fda.ui.ce.panels.model;
import javax.swing.JFrame;
import ch.psi.fda.model.v1.ChannelAction;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
/**
*
* @author ebner
*/
public class ChannelActionPanelTest {
private final static long PANEL_OPEN_TIME = 100000;
public ChannelActionPanelTest() {
}
@BeforeClass
public static void setUpClass() throws Exception {
}
@AfterClass
public static void tearDownClass() throws Exception {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of getAction method, of class ChannelActionPanel.
*/
@Test
public void testPanel() throws InterruptedException {
ChannelAction action = new ChannelAction();
action.setChannel("MY-CHANNEL");
final JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
ChannelActionPanel instance = new ChannelActionPanel(action);
frame.add(instance);
frame.pack();
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
frame.setVisible(true);
}
});
Thread.sleep(PANEL_OPEN_TIME);
System.out.println("Channel entered: "+action.getChannel());
}
}
@@ -0,0 +1,81 @@
/*
* Copyright (C) 2011 Paul Scherrer Institute
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ch.psi.fda.ui.ce.panels.model;
import ch.psi.fda.model.v1.ChannelParameterMapping;
import javax.swing.JFrame;
import ch.psi.fda.model.v1.ParameterMapping;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
/**
*
* @author ebner
*/
public class ChannelParameterMappingPanelTest {
private final static long PANEL_OPEN_TIME = 100000;
public ChannelParameterMappingPanelTest() {
}
@BeforeClass
public static void setUpClass() throws Exception {
}
@AfterClass
public static void tearDownClass() throws Exception {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of getAction method, of class ChannelActionPanel.
*/
@Test
public void testPanel() throws InterruptedException {
final JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
ChannelParameterMapping m = new ChannelParameterMapping();
ChannelParameterMappingPanel instance = new ChannelParameterMappingPanel(m);
frame.add(instance);
frame.pack();
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
frame.setVisible(true);
}
});
Thread.sleep(PANEL_OPEN_TIME);
System.out.println("Channel entered: "+m.getVariable());
}
}
@@ -0,0 +1,78 @@
/*
* Copyright (C) 2011 Paul Scherrer Institute
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ch.psi.fda.ui.ce.panels.model;
import javax.swing.JFrame;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
/**
*
* @author ebner
*/
public class ConfigurationPanelTest {
private final static long PANEL_OPEN_TIME = 1000000;
public ConfigurationPanelTest() {
}
@BeforeClass
public static void setUpClass() throws Exception {
}
@AfterClass
public static void tearDownClass() throws Exception {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of getObject method, of class ArrayPositionerPanel.
*/
@Test
public void testGetObject() throws InterruptedException {
final JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
ConfigurationPanel instance = new ConfigurationPanel();
frame.add(instance);
frame.pack();
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
frame.setVisible(true);
}
});
Thread.sleep(PANEL_OPEN_TIME);
}
}
@@ -0,0 +1,78 @@
/*
* Copyright (C) 2011 Paul Scherrer Institute
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ch.psi.fda.ui.ce.panels.model;
import javax.swing.JFrame;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
/**
*
* @author ebner
*/
public class ContinuousDimensionPanelTest {
private final static long PANEL_OPEN_TIME = 1000000;
public ContinuousDimensionPanelTest() {
}
@BeforeClass
public static void setUpClass() throws Exception {
}
@AfterClass
public static void tearDownClass() throws Exception {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of getObject method, of class ArrayPositionerPanel.
*/
@Test
public void testGetObject() throws InterruptedException {
final JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
ContinuousDimensionPanel instance = new ContinuousDimensionPanel();
frame.add(instance);
frame.pack();
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
frame.setVisible(true);
}
});
Thread.sleep(PANEL_OPEN_TIME);
}
}
@@ -0,0 +1,78 @@
/*
* Copyright (C) 2011 Paul Scherrer Institute
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ch.psi.fda.ui.ce.panels.model;
import javax.swing.JFrame;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
/**
*
* @author ebner
*/
public class ContinuousPositionerPanelTest {
private final static long PANEL_OPEN_TIME = 10000;
public ContinuousPositionerPanelTest() {
}
@BeforeClass
public static void setUpClass() throws Exception {
}
@AfterClass
public static void tearDownClass() throws Exception {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of getObject method, of class ArrayPositionerPanel.
*/
@Test
public void testGetObject() throws InterruptedException {
final JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
ContinuousPositionerPanel instance = new ContinuousPositionerPanel();
frame.add(instance);
frame.pack();
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
frame.setVisible(true);
}
});
Thread.sleep(PANEL_OPEN_TIME);
}
}
@@ -0,0 +1,78 @@
/*
* Copyright (C) 2011 Paul Scherrer Institute
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ch.psi.fda.ui.ce.panels.model;
import javax.swing.JFrame;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
/**
*
* @author ebner
*/
public class DiscreteStepDimensionPanelTest {
private final static long PANEL_OPEN_TIME = 1000000;
public DiscreteStepDimensionPanelTest() {
}
@BeforeClass
public static void setUpClass() throws Exception {
}
@AfterClass
public static void tearDownClass() throws Exception {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of getObject method, of class ArrayPositionerPanel.
*/
@Test
public void testGetObject() throws InterruptedException {
final JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
DiscreteStepDimensionPanel instance = new DiscreteStepDimensionPanel();
frame.add(instance);
frame.pack();
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
frame.setVisible(true);
}
});
Thread.sleep(PANEL_OPEN_TIME);
}
}
@@ -0,0 +1,75 @@
/*
* Copyright (C) 2011 Paul Scherrer Institute
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ch.psi.fda.ui.ce.panels.model;
import javax.swing.JFrame;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
/**
*
* @author ebner
*/
public class DiscreteStepPositionerPanelTest {
private final static long PANEL_OPEN_TIME = 20000;
public DiscreteStepPositionerPanelTest() {
}
@BeforeClass
public static void setUpClass() throws Exception {
}
@AfterClass
public static void tearDownClass() throws Exception {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of getPanelSupport method, of class DiscreteStepPositionerPanel.
*/
@Test
public void testPanel() throws InterruptedException {
final JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
DiscreteStepPositionerPanel instance = new DiscreteStepPositionerPanel();
frame.add(instance);
frame.pack();
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
frame.setVisible(true);
}
});
Thread.sleep(PANEL_OPEN_TIME);
}
}
@@ -0,0 +1,81 @@
/*
* Copyright (C) 2011 Paul Scherrer Institute
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ch.psi.fda.ui.ce.panels.model;
import ch.psi.fda.model.v1.IDParameterMapping;
import javax.swing.JFrame;
import ch.psi.fda.model.v1.ParameterMapping;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
/**
*
* @author ebner
*/
public class IDParameterMappingPanelTest {
private final static long PANEL_OPEN_TIME = 100000;
public IDParameterMappingPanelTest() {
}
@BeforeClass
public static void setUpClass() throws Exception {
}
@AfterClass
public static void tearDownClass() throws Exception {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of getAction method, of class ChannelActionPanel.
*/
@Test
public void testPanel() throws InterruptedException {
final JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
IDParameterMapping m = new IDParameterMapping();
IDParameterMappingPanel instance = new IDParameterMappingPanel(m);
frame.add(instance);
frame.pack();
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
frame.setVisible(true);
}
});
Thread.sleep(PANEL_OPEN_TIME);
System.out.println("Channel entered: "+m.getVariable());
}
}
@@ -0,0 +1,81 @@
/*
* Copyright (C) 2011 Paul Scherrer Institute
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ch.psi.fda.ui.ce.panels.model;
import ch.psi.fda.model.v1.LinePlot;
import javax.swing.JFrame;
import ch.psi.fda.model.v1.Visualization;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
/**
*
* @author ebner
*/
public class LinePlotPanelTest {
private final static long PANEL_OPEN_TIME = 200000;
public LinePlotPanelTest() {
}
@BeforeClass
public static void setUpClass() throws Exception {
}
@AfterClass
public static void tearDownClass() throws Exception {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of getAction method, of class ScriptActionPanel.
*/
@Test
public void testPanel() throws InterruptedException {
final JFrame frame = new JFrame();
LinePlot p = new LinePlot();
LinePlotPanel instance = new LinePlotPanel(p);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.add(instance);
frame.pack();
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
frame.setVisible(true);
}
});
Thread.sleep(PANEL_OPEN_TIME);
System.out.println("Command entered: "+p.getTitle());
}
}
@@ -0,0 +1,82 @@
/*
* Copyright (C) 2011 Paul Scherrer Institute
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ch.psi.fda.ui.ce.panels.model;
import ch.psi.fda.model.v1.LinearPositioner;
import javax.swing.JFrame;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
/**
*
* @author ebner
*/
public class LinearPositionerPanelTest {
private final static long PANEL_OPEN_TIME = 10000;
public LinearPositionerPanelTest() {
}
@BeforeClass
public static void setUpClass() throws Exception {
}
@AfterClass
public static void tearDownClass() throws Exception {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of getObject method, of class LinearPositionerPanel.
*/
@Test
public void testGetObject() throws InterruptedException {
final JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
LinearPositioner p = new LinearPositioner();
LinearPositionerPanel instance = new LinearPositionerPanel(p);
// RegionPanel instance = new RegionPanel();
frame.add(instance);
frame.pack();
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
frame.setVisible(true);
}
});
Thread.sleep(PANEL_OPEN_TIME);
Logger.getLogger(LinearPositionerPanelTest.class.getName()).log(Level.INFO, "Positioner {0} - Start: {1}", new Object[]{p.getName(), p.getStart()});
}
}
@@ -0,0 +1,80 @@
/*
* Copyright (C) 2011 Paul Scherrer Institute
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ch.psi.fda.ui.ce.panels.model;
import ch.psi.fda.model.v1.MatrixPlot;
import javax.swing.JFrame;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
/**
*
* @author ebner
*/
public class MatrixPlotPanelTest {
private final static long PANEL_OPEN_TIME = 200000;
public MatrixPlotPanelTest() {
}
@BeforeClass
public static void setUpClass() throws Exception {
}
@AfterClass
public static void tearDownClass() throws Exception {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of getAction method, of class ScriptActionPanel.
*/
@Test
public void testPanel() throws InterruptedException {
final JFrame frame = new JFrame();
MatrixPlot p = new MatrixPlot();
MatrixPlotPanel instance = new MatrixPlotPanel(p);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.add(instance);
frame.pack();
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
frame.setVisible(true);
}
});
Thread.sleep(PANEL_OPEN_TIME);
System.out.println("Command entered: "+p.getTitle());
}
}
@@ -0,0 +1,51 @@
/*
* Copyright (C) 2011 Paul Scherrer Institute
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ch.psi.fda.ui.ce.panels.model;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
/**
*
* @author ebner
*/
@RunWith(Suite.class)
@Suite.SuiteClasses({ch.psi.fda.ui.ce.panels.model.ActionPanelTest.class,ch.psi.fda.ui.ce.panels.model.ScriptActionPanelTest.class,ch.psi.fda.ui.ce.panels.model.ChannelActionPanelTest.class,ch.psi.fda.ui.ce.panels.model.PositionerPanelTest.class,ch.psi.fda.ui.ce.panels.model.DiscreteStepPositionerPanelTest.class,ch.psi.fda.ui.ce.panels.model.LinearPositionerPanelTest.class,ch.psi.fda.ui.ce.panels.model.RegionPanelTest.class,ch.psi.fda.ui.ce.panels.model.ArrayDetectorPanelTest.class,ch.psi.fda.ui.ce.panels.model.ShellActionPanelTest.class,ch.psi.fda.ui.ce.panels.model.ArrayPositionerPanelTest.class,ch.psi.fda.ui.ce.panels.model.ScalarDetectorPanelTest.class,ch.psi.fda.ui.ce.panels.model.RegionPositionerPanelTest.class})
public class NewTestSuite {
@BeforeClass
public static void setUpClass() throws Exception {
}
@AfterClass
public static void tearDownClass() throws Exception {
}
@Before
public void setUp() throws Exception {
}
@After
public void tearDown() throws Exception {
}
}
@@ -0,0 +1,90 @@
/*
* Copyright (C) 2011 Paul Scherrer Institute
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ch.psi.fda.ui.ce.panels.model;
import ch.psi.fda.model.v1.DiscreteStepPositioner;
import ch.psi.fda.ui.ce.panels.CollapsibleListContainer;
import javax.swing.JFrame;
import ch.psi.fda.model.v1.Positioner;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
/**
*
* @author ebner
*/
public class PositionerPanelTest {
private final static long PANEL_OPEN_TIME = 10000;
public PositionerPanelTest() {
}
@BeforeClass
public static void setUpClass() throws Exception {
}
@AfterClass
public static void tearDownClass() throws Exception {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
@Test
public void testPanel() throws InterruptedException {
// ChannelAction action = new ChannelAction();
// action.setChannel("MY-CHANNEL");
List<DiscreteStepPositioner> list = new ArrayList<DiscreteStepPositioner>();
// list.add(action);
final JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
CollapsibleListContainer<DiscreteStepPositioner> instance = new CollapsibleListContainer<DiscreteStepPositioner>(new DiscreteStepPositionerListItemProvider(list));
instance.setHeader("Positioners");
frame.add(instance);
frame.pack();
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
frame.setVisible(true);
}
});
Thread.sleep(PANEL_OPEN_TIME);
for(Positioner a: list){
Logger.getLogger(PositionerPanelTest.class.getName()).log(Level.INFO, "Action - {0}", a.getClass().getCanonicalName());
}
}
}
@@ -0,0 +1,88 @@
/*
* Copyright (C) 2011 Paul Scherrer Institute
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ch.psi.fda.ui.ce.panels.model;
import ch.psi.fda.ui.ce.panels.CollapsibleListContainer;
import javax.swing.JFrame;
import ch.psi.fda.model.v1.Region;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
/**
*
* @author ebner
*/
public class RegionPanelTest {
private final static long PANEL_OPEN_TIME = 10000;
public RegionPanelTest() {
}
@BeforeClass
public static void setUpClass() throws Exception {
}
@AfterClass
public static void tearDownClass() throws Exception {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of getRegion method, of class RegionPanel.
*/
@Test
public void testPanel() throws InterruptedException {
final JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
List<Region> list = new ArrayList<Region>();
CollapsibleListContainer<Region> instance = new CollapsibleListContainer<Region>(new RegionListItemProvider(list));
// RegionPanel instance = new RegionPanel();
frame.add(instance);
frame.pack();
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
frame.setVisible(true);
}
});
Thread.sleep(PANEL_OPEN_TIME);
Logger.getLogger(RegionPanelTest.class.getName()).log(Level.INFO, "Size of list: {0}", list.size());
for(Region r: list){
Logger.getLogger(RegionPanelTest.class.getName()).log(Level.INFO, "Start: {0}", r.getStart());
}
}
}
@@ -0,0 +1,83 @@
/*
* Copyright (C) 2011 Paul Scherrer Institute
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ch.psi.fda.ui.ce.panels.model;
import ch.psi.fda.model.v1.DiscreteStepPositioner;
import ch.psi.fda.model.v1.RegionPositioner;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JFrame;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
/**
*
* @author ebner
*/
public class RegionPositionerPanelTest {
private final static long PANEL_OPEN_TIME = 10000;
public RegionPositionerPanelTest() {
}
@BeforeClass
public static void setUpClass() throws Exception {
}
@AfterClass
public static void tearDownClass() throws Exception {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of getAction method, of class ChannelActionPanel.
*/
@Test
public void testPanel() throws InterruptedException {
final JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
RegionPositioner p = new RegionPositioner();
RegionPositionerPanel instance = new RegionPositionerPanel(p);
frame.add(instance);
frame.pack();
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
frame.setVisible(true);
}
});
Thread.sleep(PANEL_OPEN_TIME);
Logger.getLogger(RegionPositionerPanelTest.class.getName()).log(Level.INFO, "Positioner {0}",p.toString());
}
}
@@ -0,0 +1,77 @@
/*
* Copyright (C) 2011 Paul Scherrer Institute
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ch.psi.fda.ui.ce.panels.model;
import javax.swing.JFrame;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
/**
*
* @author ebner
*/
public class ScalarDetectorPanelTest {
private final static long PANEL_OPEN_TIME = 1000000;
public ScalarDetectorPanelTest() {
}
@BeforeClass
public static void setUpClass() throws Exception {
}
@AfterClass
public static void tearDownClass() throws Exception {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of getRegion method, of class RegionPanel.
*/
@Test
public void testPanel() throws InterruptedException {
final JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
ScalarDetectorPanel instance = new ScalarDetectorPanel();
// RegionPanel instance = new RegionPanel();
frame.add(instance);
frame.pack();
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
frame.setVisible(true);
}
});
Thread.sleep(PANEL_OPEN_TIME);
}
}
@@ -0,0 +1,78 @@
/*
* Copyright (C) 2011 Paul Scherrer Institute
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ch.psi.fda.ui.ce.panels.model;
import javax.swing.JFrame;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
/**
*
* @author ebner
*/
public class ScanPanelTest {
private final static long PANEL_OPEN_TIME = 1000000;
public ScanPanelTest() {
}
@BeforeClass
public static void setUpClass() throws Exception {
}
@AfterClass
public static void tearDownClass() throws Exception {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of getObject method, of class ArrayPositionerPanel.
*/
@Test
public void testGetObject() throws InterruptedException {
final JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
ScanPanel instance = new ScanPanel();
frame.add(instance);
frame.pack();
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
frame.setVisible(true);
}
});
Thread.sleep(PANEL_OPEN_TIME);
}
}
@@ -0,0 +1,83 @@
/*
* Copyright (C) 2011 Paul Scherrer Institute
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ch.psi.fda.ui.ce.panels.model;
import javax.swing.JFrame;
import ch.psi.fda.model.v1.ScriptAction;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
/**
*
* @author ebner
*/
public class ScriptActionPanelTest {
private final static long PANEL_OPEN_TIME = 2000;
public ScriptActionPanelTest() {
}
@BeforeClass
public static void setUpClass() throws Exception {
}
@AfterClass
public static void tearDownClass() throws Exception {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of getAction method, of class ScriptActionPanel.
*/
@Test
public void testPanel() throws InterruptedException {
ScriptAction action = new ScriptAction();
action.setScript("My Script is very\nlong ...");
final JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
ScriptActionPanel instance = new ScriptActionPanel(action);
frame.add(instance);
frame.pack();
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
frame.setVisible(true);
}
});
Thread.sleep(PANEL_OPEN_TIME);
ScriptAction result = instance.getObject();
System.out.println("Command entered: "+result.getScript());
}
}
@@ -0,0 +1,80 @@
/*
* Copyright (C) 2011 Paul Scherrer Institute
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ch.psi.fda.ui.ce.panels.model;
import ch.psi.fda.model.v1.Manipulation;
import javax.swing.JFrame;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
/**
*
* @author ebner
*/
public class ScriptManipulationPanelTest {
private final static long PANEL_OPEN_TIME = 100000;
public ScriptManipulationPanelTest() {
}
@BeforeClass
public static void setUpClass() throws Exception {
}
@AfterClass
public static void tearDownClass() throws Exception {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of getAction method, of class ChannelActionPanel.
*/
@Test
public void testPanel() throws InterruptedException {
final JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
ScriptManipulationPanel instance = new ScriptManipulationPanel();
frame.add(instance);
frame.pack();
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
frame.setVisible(true);
}
});
Thread.sleep(PANEL_OPEN_TIME);
Manipulation result = instance.getObject();
}
}
@@ -0,0 +1,84 @@
/*
* Copyright (C) 2011 Paul Scherrer Institute
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ch.psi.fda.ui.ce.panels.model;
import ch.psi.fda.model.v1.ShellAction;
import javax.swing.JFrame;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
/**
*
* @author ebner
*/
public class ShellActionPanelTest {
private final static long PANEL_OPEN_TIME = 2000;
public ShellActionPanelTest() {
}
@BeforeClass
public static void setUpClass() throws Exception {
}
@AfterClass
public static void tearDownClass() throws Exception {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of getAction method, of class ShellActionPanel.
*/
@Test
public void testPanel() throws InterruptedException {
ShellAction action = new ShellAction();
action.setCommand("TESTCOMMAND");
final JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
ShellActionPanel instance = new ShellActionPanel(action);
frame.add(instance);
frame.pack();
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
frame.setVisible(true);
}
});
Thread.sleep(PANEL_OPEN_TIME);
ShellAction result = instance.getObject();
System.out.println("Command entered: "+result.getCommand());
}
}
View File
View File