Source
stringclasses
1 value
Date
int32
2.01k
2.01k
Text
stringlengths
3
15.9M
Token_count
int32
1
2.44M
github-java-corpus
2,012
package org.uispec4j; import junit.framework.AssertionFailedError; import org.uispec4j.utils.AssertionFailureNotDetectedError; import javax.swing.*; import javax.swing.table.DefaultTableCellRenderer; import java.awt.*; public class TableContentTest extends TableTestCase { public void testAssertContentEquals() thro...
5,567
github-java-corpus
2,012
package org.uispec4j; import junit.framework.AssertionFailedError; import org.uispec4j.assertion.UISpecAssert; import org.uispec4j.utils.AssertionFailureNotDetectedError; import org.uispec4j.utils.UIComponentFactory; import org.uispec4j.utils.Utils; import org.uispec4j.xml.XmlAssert; import javax.swing.*; public cla...
1,197
github-java-corpus
2,012
package org.uispec4j; import javax.swing.*; public class ListSpinnerTest extends SpinnerTestCase { private ListSpinner listSpinner; protected void setUp() throws Exception { super.setUp(); listSpinner = (ListSpinner)spinner; } public String getText() { return "1"; } protected SpinnerModel c...
219
github-java-corpus
2,012
package org.uispec4j; import junit.framework.AssertionFailedError; import org.uispec4j.utils.AssertionFailureNotDetectedError; import org.uispec4j.utils.Counter; import javax.swing.event.TreeSelectionEvent; import javax.swing.event.TreeSelectionListener; import java.awt.event.MouseAdapter; import java.awt.event.Mouse...
1,250
github-java-corpus
2,012
package org.uispec4j; import junit.framework.TestCase; import org.uispec4j.assertion.UISpecAssert; import javax.swing.*; public class AbstractSwingUIComponentTest extends TestCase { public void testTooltips() throws Exception { DummySwingUIComponent component = new DummySwingUIComponent("label"); componen...
226
github-java-corpus
2,012
package org.uispec4j; import junit.framework.AssertionFailedError; import org.uispec4j.utils.AssertionFailureNotDetectedError; import org.uispec4j.xml.XmlAssert; import javax.swing.*; import java.awt.*; public class WindowForAwtWindowTest extends WindowTestCase { public void test() throws Exception { Window wi...
504
github-java-corpus
2,012
package org.uispec4j; import org.uispec4j.utils.UnitTestCase; import java.awt.*; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.Transferable; import java.io.DataInputStream; import java.io.InputStream; import java.io.Reader; import java.nio.ByteBuffer; import java.nio.CharBuffer; public class ...
808
github-java-corpus
2,012
package org.uispec4j; import org.uispec4j.xml.EventLogger; import java.awt.*; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; class MouseLogger extends EventLogger implements MouseListener { public MouseLogger(Component component) { component.addMouseListener(this); } public MouseLo...
247
github-java-corpus
2,012
package org.uispec4j; import org.uispec4j.utils.UIComponentFactory; import org.uispec4j.utils.UnitTestCase; import javax.swing.*; import javax.swing.table.AbstractTableModel; import javax.swing.table.DefaultTableCellRenderer; import java.awt.*; public abstract class TableTestCase extends UnitTestCase { Table table...
468
github-java-corpus
2,012
package org.uispec4j; import junit.framework.AssertionFailedError; import org.uispec4j.utils.AssertionFailureNotDetectedError; import org.uispec4j.utils.DummyActionListener; import org.uispec4j.utils.Functor; import org.uispec4j.utils.UIComponentFactory; import org.uispec4j.xml.XmlAssert; import org.uispec4j.assertion...
3,368
github-java-corpus
2,012
package org.uispec4j; import junit.framework.AssertionFailedError; import org.uispec4j.utils.AssertionFailureNotDetectedError; import org.uispec4j.xml.XmlAssert; import javax.swing.*; public abstract class SpinnerTestCase extends UIComponentTestCase { protected JSpinner jSpinner; protected Spinner spinner; pr...
518
github-java-corpus
2,012
package org.uispec4j; import junit.framework.AssertionFailedError; import org.uispec4j.utils.AssertionFailureNotDetectedError; import javax.swing.*; public class WindowForJFrameTest extends WindowTestCase { public void testIsModal() throws Exception { Window window = new Window(new JFrame()); assertFalse(...
205
github-java-corpus
2,012
package org.uispec4j; import junit.framework.AssertionFailedError; import org.uispec4j.utils.AssertionFailureNotDetectedError; import org.uispec4j.utils.ColorUtils; import org.uispec4j.utils.UIComponentFactory; import org.uispec4j.xml.XmlAssert; import javax.swing.*; import java.awt.*; public class TabGroupTest exte...
1,369
github-java-corpus
2,012
package org.uispec4j; import javax.swing.*; /** * Test class for {@link Window}. */ public class WindowForInternalFrameTest extends WindowTestCase { public void testIsModal() throws Exception { Window window = new Window(new JInternalFrame()); checkIsModal(window, false); } protected boolean suppo...
229
github-java-corpus
2,012
package org.uispec4j; import org.uispec4j.utils.UIComponentFactory; import org.uispec4j.xml.XmlAssert; import javax.swing.*; public class TreeComponentTest extends UIComponentTestCase { public void testGetComponentTypeName() throws Exception { assertEquals("tree", UIComponentFactory.createUIComponent(new JTree...
169
github-java-corpus
2,012
package org.uispec4j; import junit.framework.AssertionFailedError; import org.uispec4j.assertion.Assertion; import org.uispec4j.assertion.UISpecAssert; import org.uispec4j.interception.toolkit.Empty; import org.uispec4j.utils.AssertionFailureNotDetectedError; import org.uispec4j.utils.Chrono; import org.uispec4j.utils...
866
github-java-corpus
2,012
package org.uispec4j; import junit.framework.AssertionFailedError; import org.uispec4j.utils.AssertionFailureNotDetectedError; import org.uispec4j.utils.Functor; import javax.swing.*; import java.awt.*; public class ComboBoxTest extends UIComponentTestCase { private ComboBox comboBox; private JComboBox jComboBox...
2,361
github-java-corpus
2,012
package org.uispec4j; import junit.framework.AssertionFailedError; import org.uispec4j.utils.AssertionFailureNotDetectedError; import org.uispec4j.utils.DummyActionListener; import org.uispec4j.utils.Functor; import org.uispec4j.utils.UIComponentFactory; import org.uispec4j.xml.XmlAssert; import javax.swing.*; import...
2,060
github-java-corpus
2,012
package org.uispec4j; import junit.framework.AssertionFailedError; import org.uispec4j.utils.AssertionFailureNotDetectedError; import org.uispec4j.utils.UIComponentFactory; import org.uispec4j.xml.XmlAssert; import javax.swing.*; public class MenuBarTest extends UIComponentTestCase { private MenuBar menuBar; pri...
446
github-java-corpus
2,012
package org.uispec4j; import junit.framework.AssertionFailedError; import org.uispec4j.utils.AssertionFailureNotDetectedError; import org.uispec4j.utils.DummyActionListener; import javax.swing.*; import java.awt.event.FocusListener; import java.awt.event.FocusEvent; public abstract class TextBoxComponentTestCase ext...
576
github-java-corpus
2,012
package org.uispec4j.interception; import org.uispec4j.Trigger; import javax.swing.*; import java.awt.event.ActionEvent; public abstract class WindowInterceptorTestCase extends InterceptionTestCase { protected Trigger getShowFirstDialogTrigger() { return new Trigger() { public void run() throws Exception...
309
github-java-corpus
2,012
package org.uispec4j.interception; import junit.framework.AssertionFailedError; import org.uispec4j.UISpec4J; import org.uispec4j.interception.toolkit.UISpecDisplay; import org.uispec4j.utils.AssertionFailureNotDetectedError; import org.uispec4j.utils.UnitTestCase; import org.uispec4j.xml.EventLogger; import javax.sw...
701
github-java-corpus
2,012
package org.uispec4j.interception; import org.uispec4j.Trigger; import javax.swing.*; public class PopupMenuInterceptionTest extends InterceptionTestCase { public void test() throws Exception { String[] items = {"item 1", "item 2"}; assertTrue(PopupMenuInterceptor .run(new PopupTrigger(items)) ...
160
github-java-corpus
2,012
package org.uispec4j.interception; import org.uispec4j.Trigger; import org.uispec4j.Window; import javax.swing.*; public class BasicHandlerTest extends InterceptionTestCase { public void testStandardUsage() throws Exception { WindowInterceptor .init(triggerShowDialog()) .process(BasicHandler.init(...
1,407
github-java-corpus
2,012
package org.uispec4j.interception; import org.uispec4j.*; import org.uispec4j.utils.AssertionFailureNotDetectedError; import org.uispec4j.utils.Functor; import org.uispec4j.utils.Utils; import javax.swing.*; import java.awt.event.ActionEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; impor...
1,614
github-java-corpus
2,012
package org.uispec4j.interception; import org.uispec4j.Trigger; import org.uispec4j.Window; import org.uispec4j.utils.Functor; import org.uispec4j.utils.Utils; import javax.swing.*; public class WindowInterceptorCustomMethodsTest extends WindowInterceptorTestCase { public void testProcessTransientWindow() throws ...
1,166
github-java-corpus
2,012
package org.uispec4j.interception; import org.uispec4j.utils.AssertionFailureNotDetectedError; import org.uispec4j.utils.Utils; import javax.swing.*; public class WindowInterceptionTest extends InterceptionTestCase { public void testShowingAnUnexpectedWindow() throws Exception { JFrame frame = new JFrame(); ...
187
github-java-corpus
2,012
package org.uispec4j.interception; import junit.framework.Assert; import junit.framework.AssertionFailedError; import org.uispec4j.Trigger; import org.uispec4j.UISpec4J; import org.uispec4j.Window; import org.uispec4j.interception.handlers.ShownInterceptionDetectionHandler; import org.uispec4j.interception.toolkit.UIS...
4,351
github-java-corpus
2,012
package org.uispec4j.interception; import org.uispec4j.TextBox; import org.uispec4j.Window; import javax.swing.*; import java.util.Arrays; public class MainClassAdapterTest extends InterceptionTestCase { public void test() throws Exception { MainClassAdapter adapter = new MainClassAdapter(MyClass.class, "a", "...
356
github-java-corpus
2,012
package org.uispec4j.interception; import org.uispec4j.Trigger; import org.uispec4j.utils.ArrayUtils; import org.uispec4j.utils.Utils; import javax.swing.*; import java.awt.*; import java.io.File; public class FileChooserHandlerTest extends InterceptionTestCase { private JFileChooser chooser = new JFileChooser(); ...
1,940
github-java-corpus
2,012
package org.uispec4j.interception; import junit.framework.AssertionFailedError; import org.uispec4j.Button; import org.uispec4j.Trigger; import org.uispec4j.UISpec4J; import org.uispec4j.Window; import org.uispec4j.interception.handlers.ShownInterceptionDetectionHandler; import org.uispec4j.interception.toolkit.UISpec...
1,410
github-java-corpus
2,012
package org.uispec4j.interception; import junit.framework.AssertionFailedError; import org.uispec4j.Button; import org.uispec4j.Trigger; import org.uispec4j.UISpec4J; import org.uispec4j.Window; import org.uispec4j.interception.handlers.ShownInterceptionDetectionHandler; import org.uispec4j.utils.AssertionFailureNotDe...
1,383
github-java-corpus
2,012
package org.uispec4j.interception; import org.uispec4j.Trigger; import javax.swing.*; class JComponentDisplayTrigger implements Trigger { JComponent component; public JComponentDisplayTrigger(JComponent component) { this.component = component; } public void run() { JDialog dialog = InterceptionTest...
92
github-java-corpus
2,012
package org.uispec4j; import junit.framework.AssertionFailedError; import org.uispec4j.assertion.UISpecAssert; import org.uispec4j.utils.AssertionFailureNotDetectedError; import org.uispec4j.utils.Counter; import org.uispec4j.utils.ArrayUtils; import org.uispec4j.xml.EventLogger; import javax.swing.event.ListSelectio...
2,797
github-java-corpus
2,012
package org.uispec4j.utils; import javax.swing.*; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeCellRenderer; import java.awt.*; public class DummyTreeCellRenderer extends DefaultTreeCellRenderer { private final Font normalFont; private final Font boldFont; public DummyTree...
359
github-java-corpus
2,012
package org.uispec4j.utils; import junit.framework.TestCase; import java.io.File; public class FileTestUtilsTest extends TestCase { public void testDumpStringToFile() throws Exception { String content = "hello world" + Utils.LINE_SEPARATOR + "this a new line!"; String filename = "example.txt"; File fil...
108
github-java-corpus
2,012
package org.uispec4j.utils; import junit.framework.AssertionFailedError; import java.awt.*; /** * Test class for {@link ColorUtils} */ public class ColorUtilsTest extends UnitTestCase { public void testAssertEqualsWithPrefix() throws Exception { ColorUtils.assertEquals("Message", "FF0000", Color.RED); C...
1,182
github-java-corpus
2,012
package org.uispec4j.utils; public interface Functor { void run() throws Exception; }
21
github-java-corpus
2,012
package org.uispec4j.utils; import junit.framework.AssertionFailedError; import junit.framework.TestCase; import org.uispec4j.UISpec4J; import org.uispec4j.assertion.Assertion; import org.uispec4j.assertion.UISpecAssert; import org.uispec4j.interception.InterceptionError; import java.util.Locale; public abstract cla...
549
github-java-corpus
2,012
package org.uispec4j.utils; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class DummyActionListener implements ActionListener { private int callCount; public void actionPerformed(ActionEvent e) { callCount++; } public int getCallCount() { return callCount; } }
65
github-java-corpus
2,012
package org.uispec4j.utils; import org.uispec4j.Key; import org.uispec4j.UIComponent; import org.uispec4j.assertion.Assertion; import org.uispec4j.extension.JCountingButton; import java.awt.*; public class UIComponentFactoryTest extends UnitTestCase { public void testInitWithDummyComponent() throws Exception { ...
1,164
github-java-corpus
2,012
package org.uispec4j.utils; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.Locale; public class DateUtilsTest extends UnitTestCase { private Date date = getDate(1974, Calendar.NOVEMBER, 23, 19, 55, 0); public void testDate() thr...
376
github-java-corpus
2,012
package org.uispec4j.utils; public class UtilsTest extends UnitTestCase { public void test() throws Exception { checkNormalize("text", 4, "text"); checkNormalize("text ", 6, "text"); checkNormalize("text ", 8, "text"); checkNormalize("te", 3, "text"); checkNormalize("", 0, "text"); checkN...
763
github-java-corpus
2,012
package org.uispec4j.utils; import java.io.*; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; public class FileTestUtils { private static final File TMP_DIR = new File("tmp"); public static File getFile(String filename) { return new File(TMP_DIR, filename); } public static File dump...
676
github-java-corpus
2,012
package org.uispec4j.utils; public class Counter { private int count; public void increment() { count++; } public int getCount() { return count; } }
42
github-java-corpus
2,012
package org.uispec4j.utils; public class AssertionFailureNotDetectedError extends RuntimeException { public AssertionFailureNotDetectedError() { } }
33
github-java-corpus
2,012
package org.uispec4j.utils; import junit.framework.AssertionFailedError; import java.util.ArrayList; import java.util.Collections; import java.util.List; public class ArrayUtilsTest extends UnitTestCase { public void testToStringWithObjects() throws Exception { assertEquals("[3,true,Hello]", A...
619
github-java-corpus
2,012
package org.uispec4j; import junit.framework.AssertionFailedError; import org.uispec4j.interception.WindowHandler; import org.uispec4j.interception.WindowInterceptor; import org.uispec4j.utils.AssertionFailureNotDetectedError; import org.uispec4j.xml.EventLogger; import org.uispec4j.xml.XmlAssert; import javax.swing....
1,635
github-java-corpus
2,012
package org.uispec4j; import static org.uispec4j.DummySpinner.*; import org.uispec4j.finder.ComponentMatcher; import org.uispec4j.utils.UIComponentFactory; import org.uispec4j.xml.XmlAssert; import javax.swing.*; public class PanelTest extends UIComponentTestCase { public void testGetComponentTypeName() throws Ex...
905
github-java-corpus
2,012
package org.uispec4j; import junit.framework.AssertionFailedError; import org.uispec4j.utils.AssertionFailureNotDetectedError; import javax.swing.tree.TreePath; public class TreeExpansionTest extends TreeTestCase { public void testExpandAndCollapsePath() throws Exception { TreePath path = new TreePath(child1N...
283
github-java-corpus
2,012
package org.uispec4j; import junit.framework.AssertionFailedError; import org.uispec4j.utils.AssertionFailureNotDetectedError; import org.uispec4j.utils.DummyTreeCellRenderer; import org.uispec4j.utils.Functor; import javax.swing.tree.DefaultMutableTreeNode; import java.awt.*; public class TreeContentTest extends Tr...
2,102
github-java-corpus
2,012
package org.uispec4j.finder; import org.uispec4j.Button; import org.uispec4j.*; import org.uispec4j.Panel; import org.uispec4j.extension.CustomCountingButton; import org.uispec4j.extension.JCountingButton; import org.uispec4j.utils.ComponentUtils; import org.uispec4j.utils.UIComponentAnalyzer; import org.uispec4j.util...
6,374
github-java-corpus
2,012
package org.uispec4j.finder; import org.uispec4j.ComponentAmbiguityException; import org.uispec4j.ItemNotFoundException; import org.uispec4j.TestUtils; import javax.swing.*; import java.awt.*; public class PanelSwingComponentFinderTest extends PanelComponentFinderTestCase { private JButton button1; private JButt...
453
github-java-corpus
2,012
package org.uispec4j.finder; import org.uispec4j.Button; import org.uispec4j.TextBox; import javax.swing.*; import java.awt.*; public class PanelContainsComponentTest extends PanelComponentFinderTestCase { private JButton button; private static final ComponentMatcher CUSTOM_MATCHER = new ComponentMatcher() { ...
431
github-java-corpus
2,012
package org.uispec4j.finder; import org.uispec4j.ComponentAmbiguityException; import org.uispec4j.ItemNotFoundException; import org.uispec4j.TestUtils; import javax.swing.*; import java.awt.*; public class ComponentMatchersTest extends PanelComponentFinderTestCase { private JButton button1; private JButton butto...
1,054
github-java-corpus
2,012
package org.uispec4j.finder; import org.uispec4j.Button; import org.uispec4j.*; import javax.swing.*; import java.awt.*; public class PanelUIComponentFinderTest extends PanelComponentFinderTestCase { private JButton button; private static final ComponentMatcher CUSTOM_MATCHER = new ComponentMatcher() { publi...
1,004
github-java-corpus
2,012
package org.uispec4j.finder; import org.uispec4j.TestUtils; import static org.uispec4j.finder.ComponentMatchers.*; import javax.swing.*; import java.awt.*; public class CollectionComponentMatchersTest extends PanelComponentFinderTestCase { private JButton component1; private JButton component2; private JButton...
317
github-java-corpus
2,012
package org.uispec4j.finder; import org.uispec4j.Panel; import org.uispec4j.utils.UnitTestCase; import javax.swing.*; import java.awt.*; import java.lang.reflect.Constructor; import java.util.ArrayList; import java.util.List; public abstract class PanelComponentFinderTestCase extends UnitTestCase { protected JPane...
272
github-java-corpus
2,012
package org.uispec4j; import org.uispec4j.utils.DateUtils; import javax.swing.*; import java.util.Arrays; import java.util.Calendar; class DummySpinner { public static final String START_DATE = "1964.11.23 19:55"; public static final String END_DATE = "1984.11.23 19:55"; public static final String CURRENT_DATE...
366
github-java-corpus
2,012
package org.uispec4j.xml; import junit.framework.AssertionFailedError; import org.uispec4j.utils.AssertionFailureNotDetectedError; import org.uispec4j.utils.UnitTestCase; public class EventLoggerTest extends UnitTestCase { private EventLogger eventLogger = new EventLogger(); public void testEventWithoutArgs() th...
1,419
github-java-corpus
2,012
package org.uispec4j.xml; import org.uispec4j.utils.UnitTestCase; public class XmlEscapeTest extends UnitTestCase { public void testConvertToXmlEntity() throws Exception { assertEquals("sdfsdf&sdfsdf", XmlEscape.convertToXmlWithEntities("sdfsdf&sdfsdf")); assertEquals("sdfsdf<sdf>sdf", XmlEscape.c...
181
github-java-corpus
2,012
package org.uispec4j.xml; import org.uispec4j.utils.UnitTestCase; import java.io.StringReader; import java.io.StringWriter; public class XmlWriterTest extends UnitTestCase { private StringWriter out = new StringWriter(); public void testStartTag() throws Exception { XmlWriter.startTag(out, "Root") .ad...
232
github-java-corpus
2,012
package org.uispec4j.xml; import junit.framework.AssertionFailedError; import org.uispec4j.utils.AssertionFailureNotDetectedError; import org.uispec4j.utils.UnitTestCase; public class XmlAssertTest extends UnitTestCase { public void testNoDiff() throws Exception { String xml = "<root>" + " <ch...
1,219
github-java-corpus
2,012
package org.uispec4j; import org.uispec4j.utils.Functor; import org.uispec4j.utils.UIComponentFactory; import org.uispec4j.xml.XmlAssert; import javax.swing.*; public class TextBoxForLabelTest extends TextBoxComponentTestCase { private JLabel jLabel; protected void setUp() throws Exception { super.setUp(); ...
948
github-java-corpus
2,012
package org.uispec4j; import junit.framework.AssertionFailedError; import org.uispec4j.utils.AssertionFailureNotDetectedError; import org.uispec4j.utils.UIComponentFactory; import org.uispec4j.xml.EventLogger; import javax.swing.*; import java.awt.event.ActionEvent; public class MenuItemForJPopupMenuTest extends Men...
546
github-java-corpus
2,012
package org.uispec4j; import junit.framework.TestCase; import javax.swing.*; public class MouseTest extends TestCase { TextBox textBox = new TextBox(new JLabel()); final MouseLogger logger = new MouseLogger(textBox); public void testSimpleClickOnComponent() throws Exception { Mouse.click(textBox); lo...
192
github-java-corpus
2,012
package org.uispec4j; import org.uispec4j.utils.DummyTreeCellRenderer; import org.uispec4j.utils.UnitTestCase; import org.uispec4j.xml.EventLogger; import javax.swing.*; import javax.swing.tree.DefaultMutableTreeNode; import java.awt.*; public abstract class TreeTestCase extends UnitTestCase { protected JTree jTre...
583
github-java-corpus
2,012
package org.uispec4j; import static org.uispec4j.DummySpinner.listModel; import javax.swing.*; public class SpinnerTest extends SpinnerTestCase { protected SpinnerModel createSpinnerModel() throws Exception { return listModel("1", "2", "3"); } protected Spinner createSpinner(JSpinner jSpinner) { retu...
470
github-java-corpus
2,012
package org.uispec4j; import org.uispec4j.interception.WindowInterceptor; import org.uispec4j.utils.UnitTestCase; import org.uispec4j.utils.Utils; import org.uispec4j.xml.EventLogger; import javax.swing.*; import java.awt.event.ActionEvent; public class UISpecTestCaseTest extends UnitTestCase { public class MyTes...
880
github-java-corpus
2,012
package org.uispec4j; import org.uispec4j.utils.UIComponentFactory; import org.uispec4j.xml.XmlAssert; import javax.swing.*; public class CheckBoxTest extends ButtonTestCase { private CheckBox checkBox; private JCheckBox jCheckBox; protected void setUp() throws Exception { super.setUp(); jCheckBox = n...
264
github-java-corpus
2,012
package org.uispec4j; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.util.ArrayList; class DummyKeyListener implements KeyListener { private final java.util.List<String> events = new ArrayList<String>(); public void keyPressed(KeyEvent event) { events.add("keyPressed"); } ...
126
github-java-corpus
2,012
package org.uispec4j; import junit.framework.AssertionFailedError; import org.uispec4j.utils.ArrayUtils; import org.uispec4j.utils.AssertionFailureNotDetectedError; import org.uispec4j.utils.Functor; import javax.swing.*; import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.JTableHeader; import...
1,327
github-java-corpus
2,012
package samples.calculator; import java.math.BigDecimal; import java.text.DecimalFormat; import java.text.NumberFormat; import java.util.Locale; public class Calculator { private State state; private StringBuffer firstOperand = new StringBuffer(); private Operator operator; private StringBuffer secondOperand...
1,288
github-java-corpus
2,012
package samples.calculator; import samples.utils.GridBag; import samples.utils.SampleUtils; import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class CalculatorPanel extends JPanel { Calculator calculator = new Calculator(); JTextField textFie...
550
github-java-corpus
2,012
package samples.utils; import javax.swing.*; import java.awt.*; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; public class SampleUtils { public static void show(JComponent panel, String title) throws Exception { JFrame frame = createFrame(panel); frame.setTitle(title); show(fr...
281
github-java-corpus
2,012
package samples.utils; import java.awt.*; public class GridBag { private Container panel; private GridBagLayout layout; public GridBag(Container panel) { this.panel = panel; layout = new GridBagLayout(); panel.setLayout(layout); } public void add(Component component, int grid...
203
github-java-corpus
2,012
package samples.calculator; import static org.testng.Assert.*; import org.testng.annotations.Configuration; import org.testng.annotations.Test; import samples.utils.AssertionFailureNotDetectedError; public class CalculatorTest { private Calculator calculator; @Configuration(beforeTestMethod = true) protected v...
1,479
github-java-corpus
2,012
package samples.calculator.functests; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import org.uispec4j.Panel; import static org.uispec4j.assertion.UISpecAssert.assertTrue; /** * Stage 1 in the evolution of a tests suite: total duplication. */ public class CalculatorStage1Test { ...
583
github-java-corpus
2,012
package samples.calculator.functests; import org.uispec4j.UISpec4J; import org.uispec4j.interception.MainClassAdapter; import samples.calculator.CalculatorPanel; public class Adapter extends MainClassAdapter { static { UISpec4J.init(); } public Adapter() { super(CalculatorPanel.class); } }
79
github-java-corpus
2,012
package samples.calculator.functests; import org.testng.annotations.Test; import static org.uispec4j.assertion.UISpecAssert.assertTrue; /** * Stage 2 in the evolution of a tests suite: utility methods and/or classes. */ public class CalculatorStage2Test { private Calculator calculator = new Calculator(); @Test...
309
github-java-corpus
2,012
package samples.calculator.functests; import static org.testng.Assert.fail; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import static org.uispec4j.assertion.UISpecAssert.assertTrue; import java.io.BufferedReader; import java.io.InputStream...
427
github-java-corpus
2,012
package samples.utils; import org.testng.Assert; import java.util.*; public class ArrayUtils { public static String toString(Object[] objects) { StringBuffer buffer = new StringBuffer(); appendLine(buffer, objects, ","); return buffer.toString(); } public static String toVerticalString(Object[] a...
1,428
github-java-corpus
2,012
package samples.utils; import org.testng.Assert; import javax.swing.*; import java.util.Arrays; import java.util.List; public class Utils { public static final String LINE_SEPARATOR = System.getProperty("line.separator"); /** * Compare two objects in the case where both can be null */ public static bool...
691
github-java-corpus
2,012
package samples.utils; public interface Stringifier { String toString(Object obj); Stringifier NULL = new Stringifier() { public String toString(Object obj) { return obj.toString(); } }; }
43
github-java-corpus
2,012
package samples.utils; public interface Functor { void run() throws Exception; }
16
github-java-corpus
2,012
package samples.utils; public class AssertionFailureNotDetectedError extends RuntimeException { public AssertionFailureNotDetectedError() { } }
28
github-java-corpus
2,012
package samples.utils; import javax.swing.*; import java.awt.*; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; public class SampleUtils { public static void show(JComponent panel, String title) throws Exception { JFrame frame = createFrame(panel); frame.setTitle(title); show(fr...
281
github-java-corpus
2,012
package samples.utils; import java.awt.*; public class GridBag { private Container panel; private GridBagLayout layout; public GridBag(Container panel) { this.panel = panel; layout = new GridBagLayout(); panel.setLayout(layout); } public void add(Component component, int grid...
203
github-java-corpus
2,012
package samples.addressbook.main; import samples.addressbook.gui.MainWindow; import samples.addressbook.model.AddressBook; import samples.utils.SampleUtils; import java.util.Locale; public class Main { public static void main(String... args) throws Exception { Locale.setDefault(Locale.US); AddressBook book...
83
github-java-corpus
2,012
package samples.addressbook.model.exceptions; public class NameAlreadyInUseException extends Exception { }
18
github-java-corpus
2,012
package samples.addressbook.model; import samples.addressbook.model.events.EventHandler; import samples.addressbook.model.exceptions.NameAlreadyInUseException; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.List; public class AddressBook { private List contact...
540
github-java-corpus
2,012
package samples.addressbook.model; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class Contact { public static class Field { public static final Field FIRST_NAME = new Field("First name"); public static final Field LAST_NAME = new Field("Last name...
337
github-java-corpus
2,012
package samples.addressbook.model; import samples.addressbook.model.exceptions.NameAlreadyInUseException; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.List; public class Category { public static final String ROOT_NAME = "All"; private String name; priva...
445
github-java-corpus
2,012
package samples.addressbook.model.events; import samples.addressbook.model.Category; import samples.addressbook.model.Contact; import java.util.ArrayList; import java.util.Iterator; import java.util.List; public class EventHandler { private List bookResetListeners = new ArrayList(); private List contactCreationL...
599
github-java-corpus
2,012
package samples.addressbook.model.events; import samples.addressbook.model.Contact; public interface ContactCreationListener { void contactCreated(Contact contact); }
28
github-java-corpus
2,012
package samples.addressbook.model.events; import org.uispec4j.xml.EventLogger; import samples.addressbook.model.AddressBook; import samples.addressbook.model.Category; public class DummyCategoryListener extends EventLogger implements CategoryCreationListener { public static DummyCategoryListener register(Addre...
119
github-java-corpus
2,012
package samples.addressbook.model.events; public interface BookResetListener { void bookReset(); }
19
github-java-corpus
2,012
package samples.addressbook.model.events; import samples.addressbook.model.Contact; public interface ContactDeletionListener { void contactDeleted(Contact contact); }
29
github-java-corpus
2,012
package samples.addressbook.model.events; import samples.addressbook.model.Category; public interface CategoryCreationListener { void categoryCreated(Category category); }
28
github-java-corpus
2,012
package samples.addressbook.model.events; import org.uispec4j.xml.EventLogger; import samples.addressbook.model.AddressBook; public class DummyBookListener extends EventLogger implements BookResetListener { public static DummyBookListener register(AddressBook book) { DummyBookListener listener = new DummyBo...
99