Skip to content

Commit a4bdf50

Browse files
Merge pull request #121 from SpineEventEngine/appliers-return-new-state
Use state builder in event appliers
2 parents f3b095b + c51947a commit a4bdf50

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+751
-799
lines changed

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 7 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ buildscript {
1010

1111
dependencies {
1212
compile group: 'io.grpc', name: 'grpc-all', version: '0.13.1'
13+
testCompile project (path: ":testutil", configuration: 'testArtifacts')
1314
}
1415

1516
apply plugin: 'org.spine3.tools.protolookup';

client/src/test/java/org/spine3/test/TestCommandFactory.java renamed to client/src/main/java/org/spine3/client/test/TestCommandFactory.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@
1818
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1919
*/
2020

21-
package org.spine3.test;
21+
package org.spine3.client.test;
2222

2323
import com.google.protobuf.Message;
2424
import com.google.protobuf.Timestamp;
25+
import org.spine3.Internal;
2526
import org.spine3.base.Command;
2627
import org.spine3.base.CommandContext;
2728
import org.spine3.base.UserId;
@@ -35,6 +36,7 @@
3536
*
3637
* @author Alexaner Yevsyukov
3738
*/
39+
@Internal
3840
public class TestCommandFactory extends CommandFactory {
3941

4042
public static TestCommandFactory newInstance(String actor, ZoneOffset zoneOffset) {

client/src/main/java/org/spine3/protobuf/MessageField.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
import static com.google.common.base.Throwables.propagate;
3434

3535
/**
36-
* Utility class for working with message fields.
36+
* Abstract base for classes working with message fields.
3737
*
3838
* @author Mikhail Mikhaylov
3939
* @author Alexander Yevsyukov
@@ -59,6 +59,11 @@ public abstract class MessageField {
5959
*/
6060
private static final Map<Class<? extends Message>, Method> accessors = Maps.newConcurrentMap();
6161

62+
/**
63+
* Creates an instance for the field with the passed number.
64+
*
65+
* @param index the zero-based index of the field
66+
*/
6267
protected MessageField(int index) {
6368
this.index = index;
6469
}

client/src/main/java/org/spine3/validate/Validate.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@
2727

2828
import javax.annotation.Nullable;
2929

30-
import static com.google.common.base.Preconditions.checkArgument;
31-
import static com.google.common.base.Preconditions.checkNotNull;
32-
import static com.google.common.base.Preconditions.checkState;
30+
import static com.google.common.base.Preconditions.*;
3331

3432
/**
3533
* This class provides general validation routines.

client/src/test/java/org/spine3/base/CommandsShould.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
import com.google.protobuf.Message;
2929
import com.google.protobuf.StringValue;
3030
import org.junit.Test;
31+
import org.spine3.client.test.TestCommandFactory;
3132
import org.spine3.test.RunTest;
32-
import org.spine3.test.TestCommandFactory;
3333
import org.spine3.type.TypeName;
3434

3535
import java.util.ArrayList;

client/src/test/java/org/spine3/test/Tests.java

Lines changed: 0 additions & 87 deletions
This file was deleted.

client/src/test/java/org/spine3/test/package-info.java

Lines changed: 0 additions & 30 deletions
This file was deleted.

client/src/test/java/org/spine3/type/TypeNameShould.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
import org.junit.Test;
2929
import org.spine3.base.Command;
3030
import org.spine3.client.CommandFactory;
31+
import org.spine3.client.test.TestCommandFactory;
3132
import org.spine3.test.RunTest;
32-
import org.spine3.test.TestCommandFactory;
3333

3434
import static org.junit.Assert.*;
3535

client/src/test/proto/spine/test/commands.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ option java_package="org.spine3.test";
2525
option java_multiple_files = true;
2626
option java_outer_classname = "TestCommands";
2727

28+
// A test command to run a test by the method name.
2829
message RunTest {
2930
string method_name = 1;
3031
}

0 commit comments

Comments
 (0)