-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(battery): Split up the override property from the executable to …
…add support for source file executables. Split the name and resource folder so resources can be shared between tests.
- Loading branch information
1 parent
5a92ffb
commit 1da692b
Showing
7 changed files
with
85 additions
and
50 deletions.
There are no files selected for viewing
28 changes: 17 additions & 11 deletions
28
src/test/java/com/synopsys/integration/detect/battery/BatteryExecutable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,25 @@ | ||
package com.synopsys.integration.detect.battery; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.util.concurrent.atomic.AtomicInteger; | ||
|
||
import com.synopsys.integration.detect.configuration.DetectProperty; | ||
|
||
import freemarker.template.TemplateException; | ||
|
||
public abstract class BatteryExecutable { | ||
public final DetectProperty detectProperty; | ||
public class BatteryExecutable { | ||
public DetectProperty detectProperty = null; | ||
public String windowsSourceFileName = null; | ||
public String linuxSourceFileName = null; | ||
public BatteryExecutableCreator creator = null; | ||
|
||
protected BatteryExecutable(final DetectProperty detectProperty) { | ||
this.detectProperty = detectProperty; | ||
public static BatteryExecutable sourceFileExecutable(final String windowsSourceFileName, final String linuxSourceFileName, final BatteryExecutableCreator creator) { | ||
final BatteryExecutable executable = new BatteryExecutable(); | ||
executable.creator = creator; | ||
executable.linuxSourceFileName = linuxSourceFileName; | ||
executable.windowsSourceFileName = windowsSourceFileName; | ||
return executable; | ||
} | ||
|
||
public abstract File createExecutable(final int id, final File mockDirectory, AtomicInteger commandCount) throws IOException, TemplateException; | ||
public static BatteryExecutable propertyOverrideExecutable(final DetectProperty detectProperty, final BatteryExecutableCreator creator) { | ||
final BatteryExecutable executable = new BatteryExecutable(); | ||
executable.creator = creator; | ||
executable.detectProperty = detectProperty; | ||
return executable; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/test/java/com/synopsys/integration/detect/battery/BatteryExecutableCreator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.synopsys.integration.detect.battery; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.util.concurrent.atomic.AtomicInteger; | ||
|
||
import freemarker.template.TemplateException; | ||
|
||
public abstract class BatteryExecutableCreator { | ||
public abstract File createExecutable(final int id, final File mockDirectory, AtomicInteger commandCount) throws IOException, TemplateException; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters