Esempio n. 1
0
 private void addIgnoredTests(List<TestClass> testClasses, Summary.Builder summaryBuilder) {
   for (TestClass testClass : testClasses) {
     for (TestMethod ignoredMethod : testClass.getIgnoredMethods()) {
       summaryBuilder.addIgnoredTest(testClass.getName() + ":" + ignoredMethod);
     }
   }
 }
    public boolean equals(Object o) {
      if (this == o) return true;
      if (!(o instanceof TestClass)) return false;

      TestClass obj = (TestClass) o;

      return ((this.field1 == obj.getField1()
              || (this.field1 != null && this.field1.equals(obj.getField1())))
          && (this.field2 == obj.getField2()
              || (this.field2 != null && this.field2.equals(obj.getField2())))
          && (this.field3 == obj.getField3()
              || (this.field3 != null && this.field3.equals(obj.getField3()))));
    }
Esempio n. 3
0
  /**
   * Test code.
   *
   * @param args First arg is the class name to create
   */
  public static void main(String[] args) {

    try {
      Class type = null;
      Object instance = null;
      if (args.length > 0) {
        type = Class.forName(args[0]);
        instance = type.newInstance();
      } else {
        type = TestClass.class;
        instance = new TestClass();
        ((TestClass) instance).setObject(new TestClass());
      }

      JFrame f = new JFrame(type.getName());
      DynamicCustomizer custom = new DynamicCustomizer(type);
      custom.setObject(instance);
      f.getContentPane().add(new JScrollPane(custom));
      f.pack();
      f.setVisible(true);
    } catch (Exception ex) {
      ex.printStackTrace();
    }
  }
 public static void test23() {
   TestClass tc = new TestClass("foo", "bar", new Integer(32));
   mc.set("foo", tc);
   assert tc.equals((TestClass) mc.get("foo"));
 }