Skip to content

Commit 0fd2c4a

Browse files
Add CommandTest class
1 parent bdf2621 commit 0fd2c4a

File tree

2 files changed

+49
-1
lines changed

2 files changed

+49
-1
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ allprojects {
5454
apply plugin: 'idea'
5555

5656
group = 'org.spine3'
57-
version = '0.5.17-SNAPSHOT'
57+
version = '0.5.18-SNAPSHOT'
5858
}
5959

6060
ext {
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* Copyright 2016, TeamDev Ltd. All rights reserved.
3+
*
4+
* Redistribution and use in source and/or binary forms, with or without
5+
* modification, must retain the above copyright notice and the following
6+
* disclaimer.
7+
*
8+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
9+
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
10+
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
11+
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
12+
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
13+
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
14+
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
15+
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
16+
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
17+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
18+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19+
*/
20+
21+
package org.spine3.test;
22+
23+
import com.google.protobuf.Message;
24+
import org.spine3.base.Command;
25+
26+
/**
27+
* An abstract base for nested tests of aggregate specifications.
28+
*
29+
* @author Alexander Yevsyukov
30+
*/
31+
@SuppressWarnings({"ProtectedField" /* we want easier access from test suites */,
32+
"unused", "AbstractClassNeverImplemented" /* is supposed to be used from outside */})
33+
34+
public abstract class CommandTest<C extends Message> {
35+
36+
protected final TestCommandFactory commandFactory = TestCommandFactory.newInstance(getClass());
37+
38+
protected C commandMessage;
39+
40+
protected Command command;
41+
42+
protected abstract C createCommandMessage();
43+
44+
protected void createCommand() {
45+
commandMessage = createCommandMessage();
46+
command = commandFactory.create(commandMessage);
47+
}
48+
}

0 commit comments

Comments
 (0)