diff --git a/main/test/integrationTests/homepage/AnotherDependency.java b/main/test/integrationTests/homepage/AnotherDependency.java deleted file mode 100644 index 965eeacd8..000000000 --- a/main/test/integrationTests/homepage/AnotherDependency.java +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) 2006-2011 Rogério Liesenfeld - * This file is subject to the terms of the MIT license (see LICENSE.txt). - */ -package integrationTests.homepage; - -public final class AnotherDependency -{ - public void complexOperation(int i, Object data) - { - } -} diff --git a/main/test/integrationTests/homepage/DependencyXyz.java b/main/test/integrationTests/homepage/DependencyXyz.java deleted file mode 100644 index 5129e534c..000000000 --- a/main/test/integrationTests/homepage/DependencyXyz.java +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright (c) 2006-2011 Rogério Liesenfeld - * This file is subject to the terms of the MIT license (see LICENSE.txt). - */ -package integrationTests.homepage; - -public final class DependencyXyz -{ - public int doSomething(String s) - { - return -1; - } -} diff --git a/main/test/integrationTests/homepage/JMockitExpectationsExampleTest.java b/main/test/integrationTests/homepage/JMockitExpectationsExampleTest.java deleted file mode 100644 index f8ec1c594..000000000 --- a/main/test/integrationTests/homepage/JMockitExpectationsExampleTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2006-2014 Rogério Liesenfeld - * This file is subject to the terms of the MIT license (see LICENSE.txt). - */ -package integrationTests.homepage; - -import org.junit.*; - -import mockit.*; - -import static org.junit.Assert.*; - -public final class JMockitExpectationsExampleTest -{ - // This is a mock field. A mocked instance is automatically created and assigned to it, for each test. - @Mocked DependencyXyz mock; - - @Test - public void testDoOperationAbc() - { - ServiceAbc sut = new ServiceAbc(); - - new Expectations() {{ - // Records an expectation for an specific instance method of the mocked type, - // which is expected to be executed on any instance of that type: - mock.doSomething("test"); result = 123; - }}; - - // In ServiceAbc#doOperationAbc(String s): "new DependencyXyz().doSomething(s);" - Object result = sut.doOperationAbc("test"); - - assertNotNull(result); - - // That all expectations recorded were actually executed in the replay phase is automatically - // verified at this point, through transparent integration with the JUnit/TestNG test runner. - } -} diff --git a/main/test/integrationTests/homepage/JMockitMockupsExampleTest.java b/main/test/integrationTests/homepage/JMockitMockupsExampleTest.java deleted file mode 100644 index 8c67b0122..000000000 --- a/main/test/integrationTests/homepage/JMockitMockupsExampleTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2006-2012 Rogério Liesenfeld - * This file is subject to the terms of the MIT license (see LICENSE.txt). - */ -package integrationTests.homepage; - -import org.junit.*; - -import mockit.*; - -import static org.junit.Assert.*; - -public final class JMockitMockupsExampleTest -{ - @Test - public void testDoOperationAbc() - { - // A "mock-up" class, defined and applied at the same time: - new MockUp() { - @Mock(invocations = 1) - int doSomething(String value) - { - assertEquals("test", value); - return 123; - } - }; - - // In ServiceAbc#doOperationAbc(String s): "new DependencyXyz().doSomething(s);" - Object result = new ServiceAbc().doOperationAbc("test"); - - assertNotNull(result); - } -} diff --git a/main/test/integrationTests/homepage/JMockitVerificationsExampleTest.java b/main/test/integrationTests/homepage/JMockitVerificationsExampleTest.java deleted file mode 100644 index c5174dc1c..000000000 --- a/main/test/integrationTests/homepage/JMockitVerificationsExampleTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2006-2014 Rogério Liesenfeld - * This file is subject to the terms of the MIT license (see LICENSE.txt). - */ -package integrationTests.homepage; - -import org.junit.*; - -import mockit.*; - -public final class JMockitVerificationsExampleTest -{ - @Test // notice the "mock parameters", whose values will be created automatically - public void testDoAnotherOperation(@Mocked final AnotherDependency anotherMock, @Mocked final DependencyXyz mock) - { - new Expectations() {{ - mock.doSomething("test"); result = 123; - }}; - - // In ServiceAbc#doAnotherOperationAbc(String s): "new DependencyXyz().doSomething(s);" - // and "new AnotherDependency().complexOperation(1, obj);". - new ServiceAbc().doAnotherOperation("test"); - - new Verifications() {{ - anotherMock.complexOperation(anyInt, null); - }}; - } -} diff --git a/main/test/integrationTests/homepage/ServiceAbc.java b/main/test/integrationTests/homepage/ServiceAbc.java deleted file mode 100644 index fa82c5db9..000000000 --- a/main/test/integrationTests/homepage/ServiceAbc.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2006-2011 Rogério Liesenfeld - * This file is subject to the terms of the MIT license (see LICENSE.txt). - */ -package integrationTests.homepage; - -public final class ServiceAbc -{ - private final DependencyXyz xyz = new DependencyXyz(); - - public Object doOperationAbc(String s) - { - xyz.doSomething(s); - return ""; - } - - public void doAnotherOperation(String s) - { - xyz.doSomething(s); - new AnotherDependency().complexOperation(1, new Object()); - } -} diff --git a/main/test/mockit/ExpectationsForConstructorsTest.java b/main/test/mockit/ExpectationsForConstructorsTest.java index fa9ec9362..aef5217a4 100644 --- a/main/test/mockit/ExpectationsForConstructorsTest.java +++ b/main/test/mockit/ExpectationsForConstructorsTest.java @@ -95,7 +95,7 @@ public void mockClassHierarchyWhereFirstConstructorInBaseClassIsPrivate(@Mocked } @SuppressWarnings({"UnnecessaryFullyQualifiedName", "UnusedParameters"}) - static class D extends integrationTests.serviceA.ServiceA { D(String s) {} } + static class D extends otherTests.serviceA.ServiceA { D(String s) {} } @Test public void mockClassHierarchyWhereFirstConstructorInBaseClassOnAnotherPackageIsPackagePrivate(@Mocked D mock) diff --git a/main/test/integrationTests/CustomClassLoadingWithTestNG.java b/main/test/otherTests/CustomClassLoadingWithTestNG.java similarity index 97% rename from main/test/integrationTests/CustomClassLoadingWithTestNG.java rename to main/test/otherTests/CustomClassLoadingWithTestNG.java index 8b4cfd79a..1688e8bb7 100644 --- a/main/test/integrationTests/CustomClassLoadingWithTestNG.java +++ b/main/test/otherTests/CustomClassLoadingWithTestNG.java @@ -1,8 +1,8 @@ /* - * Copyright (c) 2006-2014 Rogério Liesenfeld + * Copyright (c) 2006-2015 Rogério Liesenfeld * This file is subject to the terms of the MIT license (see LICENSE.txt). */ -package integrationTests; +package otherTests; import java.lang.reflect.*; import java.net.*; diff --git a/main/test/integrationTests/SubclassTest.java b/main/test/otherTests/SubclassTest.java similarity index 98% rename from main/test/integrationTests/SubclassTest.java rename to main/test/otherTests/SubclassTest.java index 35ef5426d..cc036e15d 100644 --- a/main/test/integrationTests/SubclassTest.java +++ b/main/test/otherTests/SubclassTest.java @@ -2,7 +2,7 @@ * Copyright (c) 2006-2015 Rogério Liesenfeld * This file is subject to the terms of the MIT license (see LICENSE.txt). */ -package integrationTests; +package otherTests; import static org.junit.Assert.*; import org.junit.*; diff --git a/main/test/integrationTests/multicast/Client.java b/main/test/otherTests/multicast/Client.java similarity index 54% rename from main/test/integrationTests/multicast/Client.java rename to main/test/otherTests/multicast/Client.java index 85f5866b7..d68084c53 100644 --- a/main/test/integrationTests/multicast/Client.java +++ b/main/test/otherTests/multicast/Client.java @@ -1,8 +1,4 @@ -/* - * Copyright (c) 2006-2011 Rogério Liesenfeld - * This file is subject to the terms of the MIT license (see LICENSE.txt). - */ -package integrationTests.multicast; +package otherTests.multicast; public final class Client { diff --git a/main/test/integrationTests/multicast/Message.java b/main/test/otherTests/multicast/Message.java similarity index 96% rename from main/test/integrationTests/multicast/Message.java rename to main/test/otherTests/multicast/Message.java index e33430396..221c02bdf 100644 --- a/main/test/integrationTests/multicast/Message.java +++ b/main/test/otherTests/multicast/Message.java @@ -1,8 +1,8 @@ /* - * Copyright (c) 2006-2014 Rogério Liesenfeld + * Copyright (c) 2006-2015 Rogério Liesenfeld * This file is subject to the terms of the MIT license (see LICENSE.txt). */ -package integrationTests.multicast; +package otherTests.multicast; import java.io.*; import java.net.*; diff --git a/main/test/integrationTests/multicast/MessageTest.java b/main/test/otherTests/multicast/MessageTest.java similarity index 98% rename from main/test/integrationTests/multicast/MessageTest.java rename to main/test/otherTests/multicast/MessageTest.java index 2d8affd0b..a375d0f4e 100644 --- a/main/test/integrationTests/multicast/MessageTest.java +++ b/main/test/otherTests/multicast/MessageTest.java @@ -1,8 +1,8 @@ /* - * Copyright (c) 2006-2014 Rogério Liesenfeld + * Copyright (c) 2006-2015 Rogério Liesenfeld * This file is subject to the terms of the MIT license (see LICENSE.txt). */ -package integrationTests.multicast; +package otherTests.multicast; import java.io.*; import java.net.*; diff --git a/main/test/integrationTests/multicast/StatusListener.java b/main/test/otherTests/multicast/StatusListener.java similarity index 50% rename from main/test/integrationTests/multicast/StatusListener.java rename to main/test/otherTests/multicast/StatusListener.java index e103bfcd7..0dcd421db 100644 --- a/main/test/integrationTests/multicast/StatusListener.java +++ b/main/test/otherTests/multicast/StatusListener.java @@ -1,8 +1,4 @@ -/* - * Copyright (c) 2006-2011 Rogério Liesenfeld - * This file is subject to the terms of the MIT license (see LICENSE.txt). - */ -package integrationTests.multicast; +package otherTests.multicast; public interface StatusListener { diff --git a/main/test/integrationTests/serviceA/ServiceA.java b/main/test/otherTests/serviceA/ServiceA.java similarity index 81% rename from main/test/integrationTests/serviceA/ServiceA.java rename to main/test/otherTests/serviceA/ServiceA.java index 2ba171bc0..950954d83 100644 --- a/main/test/integrationTests/serviceA/ServiceA.java +++ b/main/test/otherTests/serviceA/ServiceA.java @@ -1,12 +1,8 @@ -/* - * Copyright (c) 2006-2013 Rogério Liesenfeld - * This file is subject to the terms of the MIT license (see LICENSE.txt). - */ -package integrationTests.serviceA; +package otherTests.serviceA; import java.util.*; -import integrationTests.serviceB.*; +import otherTests.serviceB.*; public class ServiceA { diff --git a/main/test/integrationTests/serviceA/ServiceATest.java b/main/test/otherTests/serviceA/ServiceATest.java similarity index 97% rename from main/test/integrationTests/serviceA/ServiceATest.java rename to main/test/otherTests/serviceA/ServiceATest.java index d12a8e7d8..c3944cb92 100644 --- a/main/test/integrationTests/serviceA/ServiceATest.java +++ b/main/test/otherTests/serviceA/ServiceATest.java @@ -1,8 +1,8 @@ /* - * Copyright (c) 2006-2014 Rogério Liesenfeld + * Copyright (c) 2006-2015 Rogério Liesenfeld * This file is subject to the terms of the MIT license (see LICENSE.txt). */ -package integrationTests.serviceA; +package otherTests.serviceA; import java.util.*; import static java.util.Arrays.*; @@ -12,7 +12,7 @@ import mockit.*; -import integrationTests.serviceB.*; +import otherTests.serviceB.*; public final class ServiceATest { diff --git a/main/test/integrationTests/serviceB/ServiceB.java b/main/test/otherTests/serviceB/ServiceB.java similarity index 84% rename from main/test/integrationTests/serviceB/ServiceB.java rename to main/test/otherTests/serviceB/ServiceB.java index 37c09041f..39d4b42fc 100644 --- a/main/test/integrationTests/serviceB/ServiceB.java +++ b/main/test/otherTests/serviceB/ServiceB.java @@ -1,8 +1,4 @@ -/* - * Copyright (c) 2006-2011 Rogério Liesenfeld - * This file is subject to the terms of the MIT license (see LICENSE.txt). - */ -package integrationTests.serviceB; +package otherTests.serviceB; public final class ServiceB { diff --git a/main/test/integrationTests/textFile/TextFile.java b/main/test/otherTests/textFile/TextFile.java similarity index 95% rename from main/test/integrationTests/textFile/TextFile.java rename to main/test/otherTests/textFile/TextFile.java index 503579b26..ea7e44f7b 100644 --- a/main/test/integrationTests/textFile/TextFile.java +++ b/main/test/otherTests/textFile/TextFile.java @@ -1,8 +1,8 @@ /* - * Copyright (c) 2006-2011 Rogério Liesenfeld + * Copyright (c) 2006-2015 Rogério Liesenfeld * This file is subject to the terms of the MIT license (see LICENSE.txt). */ -package integrationTests.textFile; +package otherTests.textFile; import java.io.*; import java.util.*; @@ -109,11 +109,13 @@ static final class DefaultTextReader implements TextReader reader = new FileReader(fileName); } + @Override public long skip(long n) throws IOException { return reader.skip(n); } + @Override public String readLine() throws IOException { StringBuilder buf = new StringBuilder(); @@ -131,6 +133,7 @@ public String readLine() throws IOException return buf.toString(); } + @Override public void close() throws IOException { reader.close(); diff --git a/main/test/integrationTests/textFile/TextFileUsingExpectationsTest.java b/main/test/otherTests/textFile/TextFileUsingExpectationsTest.java similarity index 95% rename from main/test/integrationTests/textFile/TextFileUsingExpectationsTest.java rename to main/test/otherTests/textFile/TextFileUsingExpectationsTest.java index f1a90e7e4..e6a957dd7 100644 --- a/main/test/integrationTests/textFile/TextFileUsingExpectationsTest.java +++ b/main/test/otherTests/textFile/TextFileUsingExpectationsTest.java @@ -1,18 +1,18 @@ /* - * Copyright (c) 2006-2014 Rogério Liesenfeld + * Copyright (c) 2006-2015 Rogério Liesenfeld * This file is subject to the terms of the MIT license (see LICENSE.txt). */ -package integrationTests.textFile; +package otherTests.textFile; import java.io.*; import java.util.*; import org.junit.*; +import static org.junit.Assert.*; import mockit.*; -import integrationTests.textFile.TextFile.*; -import static org.junit.Assert.*; +import otherTests.textFile.TextFile.*; public final class TextFileUsingExpectationsTest { diff --git a/main/test/integrationTests/textFile/TextFileUsingMockUpsTest.java b/main/test/otherTests/textFile/TextFileUsingMockUpsTest.java similarity index 95% rename from main/test/integrationTests/textFile/TextFileUsingMockUpsTest.java rename to main/test/otherTests/textFile/TextFileUsingMockUpsTest.java index 3e35d24f9..12eee2432 100644 --- a/main/test/integrationTests/textFile/TextFileUsingMockUpsTest.java +++ b/main/test/otherTests/textFile/TextFileUsingMockUpsTest.java @@ -1,18 +1,18 @@ /* - * Copyright (c) 2006-2013 Rogério Liesenfeld + * Copyright (c) 2006-2015 Rogério Liesenfeld * This file is subject to the terms of the MIT license (see LICENSE.txt). */ -package integrationTests.textFile; +package otherTests.textFile; import java.io.*; import java.util.*; import org.junit.*; +import static org.junit.Assert.*; import mockit.*; -import integrationTests.textFile.TextFile.*; -import static org.junit.Assert.*; +import otherTests.textFile.TextFile.*; public final class TextFileUsingMockUpsTest { diff --git a/main/test/integrationTests/textFile/TextFileUsingVerificationsTest.java b/main/test/otherTests/textFile/TextFileUsingVerificationsTest.java similarity index 94% rename from main/test/integrationTests/textFile/TextFileUsingVerificationsTest.java rename to main/test/otherTests/textFile/TextFileUsingVerificationsTest.java index 912e2da56..e8fb41869 100644 --- a/main/test/integrationTests/textFile/TextFileUsingVerificationsTest.java +++ b/main/test/otherTests/textFile/TextFileUsingVerificationsTest.java @@ -1,18 +1,18 @@ /* - * Copyright (c) 2006-2014 Rogério Liesenfeld + * Copyright (c) 2006-2015 Rogério Liesenfeld * This file is subject to the terms of the MIT license (see LICENSE.txt). */ -package integrationTests.textFile; +package otherTests.textFile; import java.io.*; import java.util.*; import org.junit.*; +import static org.junit.Assert.*; import mockit.*; -import integrationTests.textFile.TextFile.*; -import static org.junit.Assert.*; +import otherTests.textFile.TextFile.*; public final class TextFileUsingVerificationsTest {