Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit 7b419fb

Browse files
committed
代码整理
1 parent bec6248 commit 7b419fb

File tree

16 files changed

+266
-38
lines changed

16 files changed

+266
-38
lines changed

src/main/java/org/suren/autotest/web/framework/autoit3/AutoItCmd.java

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
1-
/**
2-
* http://surenpi.com
1+
/*
2+
* Copyright 2002-2007 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
315
*/
16+
417
package org.suren.autotest.web.framework.autoit3;
518

619
import java.io.File;
@@ -73,6 +86,11 @@ public void execFileChoose(String title, File file)
7386
title = autoItPro.getProperty("dialog.title");
7487
}
7588

89+
if(file == null || !file.isFile())
90+
{
91+
throw new RuntimeException(String.format("File is null or not a file [%s].", file));
92+
}
93+
7694
execFileChoose(title, file.getAbsolutePath());
7795
}
7896

@@ -102,15 +120,15 @@ public void execFileChoose(String title, String filePath)
102120

103121
logger.debug(String.format("prepare to exec autoit cmd [%s]", cmd));
104122

123+
Process process = Runtime.getRuntime().exec(cmd);
124+
105125
synchronized (this)
106126
{
107127
isRunning = true;
108128

109129
notifyAll();
110130
}
111131

112-
Process process = Runtime.getRuntime().exec(cmd);
113-
114132
process.waitFor();
115133
}
116134
catch (IOException | InterruptedException e)
@@ -128,7 +146,9 @@ public void execFileChoose(String title, String filePath)
128146
*/
129147
private boolean autoItNotExists()
130148
{
131-
return !(new File(autoitExe).isFile());
149+
File autoitExeFile = new File(autoitExe);
150+
151+
return !(autoitExeFile.isFile() && autoitExeFile.canExecute());
132152
}
133153

134154
/**

src/main/java/org/suren/autotest/web/framework/core/action/ClickAble.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
* Copyright 2002-2007 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package org.suren.autotest.web.framework.core.action;
218

319
import org.suren.autotest.web.framework.core.ui.Element;

src/main/java/org/suren/autotest/web/framework/core/suite/SuiteRunner.java

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
1-
/**
2-
* http://surenpi.com
1+
/*
2+
* Copyright 2002-2007 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
315
*/
16+
417
package org.suren.autotest.web.framework.core.suite;
518

619
import java.io.File;

src/main/java/org/suren/autotest/web/framework/core/ui/AbstractElement.java

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
1-
/**
2-
* Copyright © 1998-2016, Glodon Inc. All Rights Reserved.
3-
*/
1+
/*
2+
* Copyright 2002-2007 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
417
package org.suren.autotest.web.framework.core.ui;
518

619
import java.util.ArrayList;

src/main/java/org/suren/autotest/web/framework/core/ui/Button.java

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
1-
/**
2-
* Copyright © 1998-2016, Glodon Inc. All Rights Reserved.
3-
*/
1+
/*
2+
* Copyright 2002-2007 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
417
package org.suren.autotest.web.framework.core.ui;
518

619
import java.util.ArrayList;

src/main/java/org/suren/autotest/web/framework/core/ui/Element.java

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
1-
/**
2-
* Copyright © 1998-2016, Glodon Inc. All Rights Reserved.
3-
*/
1+
/*
2+
* Copyright 2002-2007 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
417
package org.suren.autotest.web.framework.core.ui;
518

619
import java.util.List;

src/main/java/org/suren/autotest/web/framework/core/ui/FileUpload.java

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
1-
/**
2-
* http://surenpi.com
1+
/*
2+
* Copyright 2002-2007 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
315
*/
16+
417
package org.suren.autotest.web.framework.core.ui;
518

619
import java.io.File;

src/main/java/org/suren/autotest/web/framework/core/ui/FindElement.java

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
1-
/**
2-
* Copyright © 1998-2016, Glodon Inc. All Rights Reserved.
3-
*/
1+
/*
2+
* Copyright 2002-2007 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
417
package org.suren.autotest.web.framework.core.ui;
518

619
/**

src/main/java/org/suren/autotest/web/framework/core/ui/Selector.java

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
1-
/**
2-
* Copyright © 1998-2016, Glodon Inc. All Rights Reserved.
3-
*/
1+
/*
2+
* Copyright 2002-2007 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
417
package org.suren.autotest.web.framework.core.ui;
518

619
import org.springframework.beans.factory.annotation.Autowired;

src/main/java/org/suren/autotest/web/framework/data/ExcelData.java

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
1-
/**
2-
* Copyright © 1998-2016, Glodon Inc. All Rights Reserved.
3-
*/
1+
/*
2+
* Copyright 2002-2007 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
417
package org.suren.autotest.web.framework.data;
518

619
import org.suren.autotest.web.framework.core.ui.Button;

0 commit comments

Comments
 (0)