2 * Copyright (C) 2007-2012 Argeo GmbH
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 package org
.argeo
.slc
.core
.execution
;
20 public class FileExecutionResourcesSpringTest
extends
21 AbstractExecutionFlowTestCase
{
22 private String basePath
= FileExecutionResources
.DEFAULT_EXECUTION_RESOURCES_TMP_PATH
;
24 public void testSimple() throws Exception
{
25 File file
= getFile("subdir/writeTo");
27 assertFalse(file
.exists());
28 configureAndExecuteSlcFlow("executionResources.xml",
29 "executionResources.simple");
30 assertTrue(file
.exists());
36 public void testPlaceholderPass() throws Exception
{
37 File file
= getFile("subdir/60");
39 assertFalse(file
.exists());
40 configureAndExecuteSlcFlow("executionResources.xml",
41 "executionResources.placeholderPass");
42 assertTrue(file
.exists());
49 * Test that it generate the wrong file because of issue when using
50 * execution placeholder in contructor-arg
52 public void testPlaceholderFail() throws Exception
{
53 File file
= getFile("subdir/@{var}");
55 assertFalse(file
.exists());
56 configureAndExecuteSlcFlow("executionResources.xml",
57 "executionResources.placeholderFail");
58 assertTrue(file
.exists());
64 protected File
getFile(String relativePath
) {
65 return new File(basePath
+ File
.separator
66 + relativePath
.replace('/', File
.separatorChar
));