Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save open dia test #76

Open
wants to merge 57 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
9bbb9a6
Prepare for diagram constructing
artbez Nov 2, 2016
13eb1ef
Create Scene and Pallete services
artbez Nov 3, 2016
f88ade9
Add exist method to Scene
artbez Nov 3, 2016
218c5ff
Add remove and move methods
artbez Nov 3, 2016
3a55d67
Add logging
artbez Nov 4, 2016
d4e6d8b
Add addLink method
artbez Nov 4, 2016
00ccd70
Codacy
artbez Nov 4, 2016
69b61d0
Add PropertyEditor service
artbez Nov 4, 2016
ec6feba
Add possibility to move element to any point in the scene
artbez Nov 14, 2016
a026b52
Code refactor of SceneWindow
artbez Nov 15, 2016
8bc01b9
Merge branch 'master' into diagram-gui
artbez Nov 15, 2016
3fb78a3
Create testspace for tasting
artbez Nov 22, 2016
d44c095
Fix movement bug
artbez Nov 23, 2016
a55e457
Change namespace of nodes
artbez Nov 23, 2016
60a30c6
Fix bug with property checkbox
artbez Nov 24, 2016
aaaeb59
Add HeaderPanel
artbez Nov 30, 2016
bf95628
Some experiments with JSExecutor
artbez Dec 18, 2016
8e6c356
Add Block and Coordinate classes
artbez Jan 15, 2017
970860c
Add Link and change SelenideElement to links and blocks in scene service
artbez Jan 18, 2017
1ddddf8
Code refactor
artbez Feb 12, 2017
af4b4be
Fix focus
artbez Feb 14, 2017
0b62cb2
Fix clean scene
artbez Feb 18, 2017
70e67bf
Make SceneWindow steps calculated automatically
artbez Feb 18, 2017
64e8b53
Code refactor
artbez Feb 19, 2017
6124f7a
Code refactor
artbez Feb 19, 2017
7403a31
Add class PalleteElement + code refactor
artbez Feb 19, 2017
dc0b9c2
Code refactor
artbez Feb 19, 2017
56672d0
Code refactor
artbez Feb 19, 2017
de3d452
Merge remote-tracking branch 'remotes/origin/master' into diagram-gui
artbez Feb 19, 2017
ffdfc41
Add callTomcat.sh
artbez Feb 19, 2017
b17459c
Code refactor
artbez Feb 19, 2017
65f2482
Divide editor to editor/robots and editor/bpmn
artbez Feb 23, 2017
4723a4c
Add Page as an object
artbez Feb 24, 2017
16ef59c
Remove Scene, PropertyEditor and Pallete from beans
artbez Feb 24, 2017
49765e7
Code refactor
artbez Feb 24, 2017
447413f
Add Block and Link providers
artbez Feb 24, 2017
2441162
Add additional condition for remove
artbez Feb 26, 2017
e77cadb
Make focus works by JavaScriptExecutor
artbez Feb 26, 2017
a001a6d
Add webdriver's timeouts
artbez Feb 26, 2017
e0f2193
Fix bug with movement
artbez Mar 2, 2017
d2235ef
Remove unnecessary changes
artbez Mar 3, 2017
e94789c
Merge branch 'diagram-gui' into save-open-dia-test
artbez Mar 9, 2017
3a5ea63
Add titles in pages
artbez Mar 9, 2017
ce0fee8
Remove unnecessary modal call
artbez Mar 12, 2017
3f41d7b
Add save diagram test
artbez Mar 13, 2017
7108d8d
Add equals check for diagrams
artbez Mar 14, 2017
1d89f57
Fix bug with deleting folders and some code refactor
artbez Mar 19, 2017
b2250ac
Code refactor, java doc and style guide
artbez Mar 19, 2017
6e4cb49
Merge branch 'diagram-gui' into save-open-dia-test
artbez Mar 19, 2017
fc2fa52
Code refactor, java doc and style guide
artbez Mar 19, 2017
a5badfb
Merge branch 'master' into save-open-dia-test
artbez Mar 21, 2017
329cbea
Merge branch 'master' into diagram-gui
artbez Mar 21, 2017
bb65fb9
Merge branch 'master' into diagram-gui
artbez Mar 21, 2017
989fb6f
Code refactor
artbez Mar 21, 2017
2995bc2
Code refactor
artbez Apr 27, 2017
8176207
Merge branch 'diagram-gui' into save-open-dia-test
artbez Apr 27, 2017
184eaac
Code refactor
artbez Apr 27, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ before_install:
- sudo rm /dev/random
- sudo mknod /dev/random c 1 9
# for gui tests
- export DBUS_SESSION_BUS_ADDRESS=/dev/null
- export CHROME_BIN=/usr/bin/google-chrome
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
Expand All @@ -33,9 +34,9 @@ before_install:

install:
#install and run tests and run style checking
- mvn install -P travis
- mvn clean install -P travis
- cd ui-testing
- mvn install -DskipTests
- mvn clean install -DskipTests
- cd ..

script:
Expand Down Expand Up @@ -67,8 +68,7 @@ script:
- sleep 30

- cd ../ui-testing
- mvn test -P travis &
- sleep 30
- mvn test -P travis

notifications:
slack: qreal-web:sT5qgA4qZZ9eyLI0yy2Mp81E
47 changes: 47 additions & 0 deletions Travis/callTomcat.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash
iter=1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comments as in another review.

all=120
until [ "$(curl --silent --show-error --connect-timeout 1 -I http://localhost:"${1:-"8080"}"/auth | grep '302 Found')" != "" ];
do
if [ "$iter" -lt "$all" ]
then
echo "--- sleeping for 10 seconds"
sleep 10
let iter=$iter+1
else
echo "Server didn't return 302 found for long time"
exit 1
fi
done
echo "auth-service found"
iter=1
all=120
until [ "$(curl --silent --show-error --connect-timeout 1 -I http://localhost:"${2:-"8082"}"/dashboard | grep '302 Found')" != "" ];
do
if [ "$iter" -lt "$all" ]
then
echo "--- sleeping for 10 seconds"
sleep 10
let iter=$iter+1
else
echo "Server didn't return 302 found for long time"
exit 1
fi
done
echo "dashboard-service found"
iter=1
all=120
until [ "$(curl --silent --show-error --connect-timeout 1 -I http://localhost:"${3:-"8081"}"/editor | grep '302 Found')" != "" ];
do
if [ "$iter" -lt "$all" ]
then
echo "--- sleeping for 10 seconds"
sleep 10
let iter=$iter+1
else
echo "Server didn't return 302 found for long time"
exit 1
fi
done
echo "editor-service found"
exit 0
45 changes: 24 additions & 21 deletions Travis/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@

<module name="TreeWalker">

<module name="SeparatorWrap" />
<module name="SeparatorWrap">
<property name="tokens" value="COMMA"/>
</module>

<!-- Checks that the outer type name and the file name match. For example, the class Foo must be in a file named Foo.java -->
<module name="OuterTypeFilename"/>
Expand Down Expand Up @@ -68,9 +70,9 @@
<property name="allowEmptyTypes" value="true"/>
<property name="allowEmptyLoops" value="true"/>
<message key="ws.notFollowed"
value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/>
<message key="ws.notPreceded"
value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/>
<message key="ws.notPreceded"
value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
</module>
<!--Only one statement per line-->
<module name="OneStatementPerLine"/>
Expand All @@ -90,60 +92,60 @@
<module name="PackageName">
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
<message key="name.invalidPattern"
value="Package name ''{0}'' must match pattern ''{1}''."/>
value="Package name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="TypeName">
<message key="name.invalidPattern"
value="Type name ''{0}'' must match pattern ''{1}''."/>
value="Type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="MemberName">
<property name="format" value="^[a-z][a-zA-Z0-9]+$"/>
<message key="name.invalidPattern"
value="Member name ''{0}'' must match pattern ''{1}''."/>
value="Member name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="ParameterName">
<property name="format" value="^([a-z][a-zA-Z0-9]+)|[e]$"/>
<message key="name.invalidPattern"
value="Parameter name ''{0}'' must match pattern ''{1}''."/>
value="Parameter name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="LocalVariableName">
<property name="tokens" value="VARIABLE_DEF"/>
<property name="format" value="^([a-z][a-zA-Z0-9]+)|[e]$"/>
<property name="allowOneCharVarInForLoop" value="true"/>
<message key="name.invalidPattern"
value="Local variable name ''{0}'' must match pattern ''{1}''."/>
value="Local variable name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="ClassTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern"
value="Class type name ''{0}'' must match pattern ''{1}''."/>
value="Class type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="MethodTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern"
value="Method type name ''{0}'' must match pattern ''{1}''."/>
value="Method type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="InterfaceTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern"
value="Interface type name ''{0}'' must match pattern ''{1}''."/>
value="Interface type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="MethodName">
<property name="format" value="^[a-z][a-zA-Z0-9_]*$"/>
<message key="name.invalidPattern"
value="Method name ''{0}'' must match pattern ''{1}''."/>
value="Method name ''{0}'' must match pattern ''{1}''."/>
</module>

<!-- Whitespaces for < and > -->
<module name="GenericWhitespace">
<message key="ws.followed"
value="GenericWhitespace ''{0}'' is followed by whitespace."/>
<message key="ws.preceded"
value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
<message key="ws.illegalFollow"
value="GenericWhitespace ''{0}'' should followed by whitespace."/>
<message key="ws.notPreceded"
value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
value="GenericWhitespace ''{0}'' is followed by whitespace."/>
<message key="ws.preceded"
value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
<message key="ws.illegalFollow"
value="GenericWhitespace ''{0}'' should followed by whitespace."/>
<message key="ws.notPreceded"
value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
</module>

<module name="Indentation" />
Expand All @@ -170,7 +172,7 @@
<property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
</module>

<module name="JavadocMethod">
<module name="JavadocMethod">
<property name="scope" value="public"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingThrowsTags" value="true"/>
Expand All @@ -187,5 +189,6 @@

<!--Comments are indeneted at the same level as surrounding code-->
<module name="CommentsIndentation"/>

</module>
</module>
4 changes: 3 additions & 1 deletion Travis/pmd/pmd-ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@

<rule ref="rulesets/java/braces.xml"/>

<rule ref="rulesets/java/codesize.xml"/>
<rule ref="rulesets/java/codesize.xml">
<exclude name="TooManyMethods" />
</rule>

<rule ref="rulesets/java/empty.xml"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ public void deleteFolder(Long folderId) throws AbortedException {
DiagramDaoImpl.class.getName());
}
Folder folder = (Folder) session.get(Folder.class, folderId);
for (Folder child : folder.getChildrenFolders()) {
deleteFolder(child.getId());
}
folder.remove();
session.delete(folder);

logger.trace("deleteFolder() successfully deleted a folder with id {}", folderId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
@ToString(exclude = "parentFolders")
public class Folder implements Serializable {

private static final String ROOT_FOLDER = "root";

@Id
@Column(name = "folder_id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
Expand All @@ -35,10 +37,10 @@ public class Folder implements Serializable {
@Transient
private Long folderParentId;

@ManyToMany(cascade = CascadeType.REMOVE, fetch = FetchType.EAGER, mappedBy = "childrenFolders")
@ManyToMany(fetch = FetchType.EAGER, mappedBy = "childrenFolders")
private Set<Folder> parentFolders = new HashSet<>();

@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE }, fetch = FetchType.EAGER)
@JoinTable(name = "folders_folders", joinColumns = {@JoinColumn(name = "parent_id")},
inverseJoinColumns = {@JoinColumn(name = "child_id")})
private Set<Folder> childrenFolders = new HashSet<>();
Expand Down Expand Up @@ -95,7 +97,68 @@ public Folder(TFolder tFolder) {
diagrams = tFolder.getDiagrams().stream().map(Diagram::new).collect(Collectors.toSet());
}
}


public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}

public void setFolderName(String folderName) {
this.folderName = folderName;
}

public void remove() {
parentFolders.forEach(x -> x.removeChild(id));
parentFolders.clear();
}

public Set<Folder> getChildrenFolders() {
return childrenFolders;
}

public Set<String> getOwners() {
return owners;
}

public void setOwners(Set<String> owners) {
this.owners = owners;
}

public Long getFolderParentId() {
return folderParentId;
}

public void setFolderParentId(Long folderParentId) {
this.folderParentId = folderParentId;
}

public Set<Folder> getParentFolders() {
return parentFolders;
}

public void setParentFolders(Set<Folder> parentFolders) {
this.parentFolders = parentFolders;
}

public void setChildrenFolders(Set<Folder> childrenFolders) {
this.childrenFolders = childrenFolders;
}

public Set<Diagram> getDiagrams() {
return diagrams;
}

public void setDiagrams(Set<Diagram> diagrams) {
this.diagrams = diagrams;
}

public String getFolderName() {
return folderName;
}

/** Converter from Folder to Thrift TFolder.*/
public TFolder toTFolder(final String username) {
TFolder tFolder = new TFolder();
Expand Down Expand Up @@ -134,5 +197,9 @@ private void setFolderParentId(String username, TFolder tFolder) {
tFolder.setFolderParentId(folderParentId);
}
}

private void removeChild(long childId) {
childrenFolders.stream().filter(x -> x.id == childId).findFirst().ifPresent(x -> childrenFolders.remove(x));
}
}

Loading