// Path: javatests/com/google/gwt/testing/easygwtmock/client/BaseGwtTestCase.java
// public abstract class BaseGwtTestCase extends GWTTestCase {
// 
//   @Override
//   public String getModuleName() {
//     return "com.google.gwt.testing.easygwtmock.Easygwtmock";
//   }
// 
// }
// 
// Path: javatests/com/google/gwt/testing/easygwtmock/client/dummyclasses/ClassToMock.java
// public class ClassToMock {
//   
//   public String returnString() {
//     return "Hi";
//   }
//   
//   public int returnInt() {
//     return 0;
//   }
//   
//   public void noReturnValue() {
//   }
//   
//   public final String finalMethod() {
//     return "I am final";
//   }
//   
//   @Override
//   public final boolean equals(Object obj) {
//     return true;
//   }
// }
// 
// Path: javatests/com/google/gwt/testing/easygwtmock/client/dummyclasses/OneArgClassToMock.java
// public class OneArgClassToMock {
//   public final String arg;
// 
//   public OneArgClassToMock(String arg) {
//     this.arg = arg;
//   }
// 
//   // cannot be mocked
//   public final String makeMessage() {
//     return getGreeting() + " " + arg + "!";
//   }
// 
//   // can be mocked
//   public String getGreeting() {
//     return "Hello,";
//   }
// }


import com.google.gwt.core.client.GWT;
import com.google.gwt.testing.easygwtmock.client.BaseGwtTestCase;
import com.google.gwt.testing.easygwtmock.client.dummyclasses.ClassToMock;
import com.google.gwt.testing.easygwtmock.client.dummyclasses.OneArgClassToMock;
/*
 * Copyright 2011 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

package com.google.gwt.testing.easygwtmock.client;


/**
 * Can we mock classes?
 * 
 * @author Michael Goderbauer
 */
public class ClassMockingGwtTest extends BaseGwtTestCase {

  interface MyControl extends MocksControl {
    ClassToMock getMock();
    OneArgClassToMock getOneArgMock(String arg);
    ZeroArgSubClass getSubClassMock();
  }

  public static class ZeroArgSubClass extends OneArgClassToMock {
    public ZeroArgSubClass() {
      super("fixed");
    }
  }

  private MyControl ctrl;
// Path: javatests/com/google/gwt/testing/easygwtmock/client/BaseGwtTestCase.java
// public abstract class BaseGwtTestCase extends GWTTestCase {
// 
//   @Override
//   public String getModuleName() {
//     return "com.google.gwt.testing.easygwtmock.Easygwtmock";
//   }
// 
// }
// 
// Path: javatests/com/google/gwt/testing/easygwtmock/client/dummyclasses/ClassToMock.java
// public class ClassToMock {
//   
//   public String returnString() {
//     return "Hi";
//   }
//   
//   public int returnInt() {
//     return 0;
//   }
//   
//   public void noReturnValue() {
//   }
//   
//   public final String finalMethod() {
//     return "I am final";
//   }
//   
//   @Override
//   public final boolean equals(Object obj) {
//     return true;
//   }
// }
// 
// Path: javatests/com/google/gwt/testing/easygwtmock/client/dummyclasses/OneArgClassToMock.java
// public class OneArgClassToMock {
//   public final String arg;
// 
//   public OneArgClassToMock(String arg) {
//     this.arg = arg;
//   }
// 
//   // cannot be mocked
//   public final String makeMessage() {
//     return getGreeting() + " " + arg + "!";
//   }
// 
//   // can be mocked
//   public String getGreeting() {
//     return "Hello,";
//   }
// }


// Path: javatests/com/google/gwt/testing/easygwtmock/client/ClassMockingGwtTest.java
import com.google.gwt.core.client.GWT;
import com.google.gwt.testing.easygwtmock.client.BaseGwtTestCase;
import com.google.gwt.testing.easygwtmock.client.dummyclasses.ClassToMock;
import com.google.gwt.testing.easygwtmock.client.dummyclasses.OneArgClassToMock;

/*
 * Copyright 2011 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

package com.google.gwt.testing.easygwtmock.client;


/**
 * Can we mock classes?
 * 
 * @author Michael Goderbauer
 */
public class ClassMockingGwtTest extends BaseGwtTestCase {

  interface MyControl extends MocksControl {
    ClassToMock getMock();
    OneArgClassToMock getOneArgMock(String arg);
    ZeroArgSubClass getSubClassMock();
  }

  public static class ZeroArgSubClass extends OneArgClassToMock {
    public ZeroArgSubClass() {
      super("fixed");
    }
  }

  private MyControl ctrl;
  private ClassToMock mock; 