sandbox


Лицензия

Лицензия

Категории

Категории

Сеть
Группа

Группа

net.avh4.util
Идентификатор

Идентификатор

sandbox
Последняя версия

Последняя версия

0.0.6
Дата

Дата

Тип

Тип

jar
Описание

Описание

sandbox
Ссылка на сайт

Ссылка на сайт

https://github.com/avh4/sandbox
Система контроля версий

Система контроля версий

https://github.com/avh4/sandbox

Скачать sandbox

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/net.avh4.util/sandbox/ -->
<dependency>
    <groupId>net.avh4.util</groupId>
    <artifactId>sandbox</artifactId>
    <version>0.0.6</version>
</dependency>
// https://jarcasting.com/artifacts/net.avh4.util/sandbox/
implementation 'net.avh4.util:sandbox:0.0.6'
// https://jarcasting.com/artifacts/net.avh4.util/sandbox/
implementation ("net.avh4.util:sandbox:0.0.6")
'net.avh4.util:sandbox:jar:0.0.6'
<dependency org="net.avh4.util" name="sandbox" rev="0.0.6">
  <artifact name="sandbox" type="jar" />
</dependency>
@Grapes(
@Grab(group='net.avh4.util', module='sandbox', version='0.0.6')
)
libraryDependencies += "net.avh4.util" % "sandbox" % "0.0.6"
[net.avh4.util/sandbox "0.0.6"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
commons-io : commons-io jar 2.0.1

test (4)

Идентификатор библиотеки Тип Версия
junit : junit-dep jar 4.8.2
org.mockito : mockito-core jar 1.8.5
org.hamcrest : hamcrest-integration jar 1.2.1
org.jbehave : jbehave-core jar 3.5

Модули Проекта

Данный проект не имеет модулей.

Build Status

Sandbox

Create and manage temporary folders to simplify integration testing

Usage

Add sandbox as a dependency (you probably only want it for tests). Maven dependency info:

    <dependency>
        <groupId>net.avh4.util</groupId>
        <artifactId>sandbox</artifactId>
        <version>0.0.6</version>
        <scope>test</scope>
    </dependency>

Any code that wants to play in the sandbox should have a root path that can be injected:

    public class MyService {
        private final File root;
        
        public MyService(File root) {
            this.root = root;
        }
        
        public void doSomething() {
            File configFile = new File(root, "config.xml");
            File fileToWrite = new File(root, "output.txt");
            ...
        }
    }

Create a sandbox and populate it with some files. This example copies test-config.xml from the classpath into config.xml in the sandbox.

    Sandbox sandbox = new Sandbox();
    sandbox.useResource("test-config.xml", "config.xml");

Test your code in the sandbox.

    MyService service = new MyService(sandbox.getRoot());
    assert(sandbox.newFile("output.txt").exists() == true);

Версии библиотеки

Версия
0.0.6
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1