View Javadoc

1   /**
2    * Copyright 2008 WebPhotos
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package net.sf.webphotos.netbeans;
17  
18  import junit.framework.Test;
19  import org.junit.Ignore;
20  import org.netbeans.jellytools.JellyTestCase;
21  import org.netbeans.jellytools.TopComponentOperator;
22  import org.netbeans.jellytools.actions.Action;
23  import org.netbeans.jemmy.operators.JButtonOperator;
24  import org.netbeans.junit.NbModuleSuite;
25  import org.netbeans.junit.NbModuleSuite.Configuration;
26  
27  /**
28   *
29   * @author Guilherme
30   */
31  @Ignore
32  public class WebPhotosTest extends JellyTestCase {
33  
34      /**
35       * Constructor required by JUnit
36       */
37      public WebPhotosTest(String name) {
38          super(name);
39      }
40  
41      /**
42       * Creates suite from particular test cases. You can define order of test
43       * cases here.
44       */
45      public static Test suite() {
46          Configuration testConfig = NbModuleSuite.createConfiguration(WebPhotosTest.class);
47          testConfig = testConfig.addTest("testNewProjectButton", "testNewProjectAction");
48          testConfig = testConfig.clusters(".*").enableModules(".*");
49          return testConfig.suite();
50      }
51  
52      /**
53       * Called before every test case.
54       */
55      @Override
56      public void setUp() {
57          System.out.println("########  " + getName() + "  #######");
58      }
59  
60      /**
61       * Test brush size setting.
62       */
63      public void testNewProjectAction() {
64          new Action("File|New Project", null).perform();
65      }
66  
67      /**
68       * Test new button.
69       */
70      public void testNewProjectButton() {
71          new JButtonOperator(new TopComponentOperator("Image"), "New Project").push();
72      }
73  }