|
|
6e9424 |
From f6eb583525c7f777bde16182c57a47345fd53cb0 Mon Sep 17 00:00:00 2001
|
|
|
6e9424 |
From: Marian Koncek <mkoncek@redhat.com>
|
|
|
6e9424 |
Date: Thu, 5 Sep 2019 15:21:04 +0200
|
|
|
6e9424 |
Subject: [PATCH] Remove dependency on powermock
|
|
|
6e9424 |
|
|
|
6e9424 |
---
|
|
|
6e9424 |
.../StringSearchModelInterpolatorTest.java | 66 -------------------
|
|
|
6e9424 |
1 file changed, 66 deletions(-)
|
|
|
6e9424 |
|
|
|
6e9424 |
diff --git a/maven-model-builder/src/test/java/org/apache/maven/model/interpolation/StringSearchModelInterpolatorTest.java b/maven-model-builder/src/test/java/org/apache/maven/model/interpolation/StringSearchModelInterpolatorTest.java
|
|
|
6e9424 |
index 45800d6..fbf3b23 100644
|
|
|
6e9424 |
--- a/maven-model-builder/src/test/java/org/apache/maven/model/interpolation/StringSearchModelInterpolatorTest.java
|
|
|
6e9424 |
+++ b/maven-model-builder/src/test/java/org/apache/maven/model/interpolation/StringSearchModelInterpolatorTest.java
|
|
|
6e9424 |
@@ -36,8 +36,6 @@ import java.util.concurrent.FutureTask;
|
|
|
6e9424 |
import static org.hamcrest.CoreMatchers.anyOf;
|
|
|
6e9424 |
import static org.hamcrest.CoreMatchers.is;
|
|
|
6e9424 |
import static org.junit.Assert.assertThat;
|
|
|
6e9424 |
-import static org.powermock.reflect.Whitebox.getField;
|
|
|
6e9424 |
-import static org.powermock.reflect.Whitebox.getInternalState;
|
|
|
6e9424 |
|
|
|
6e9424 |
/**
|
|
|
6e9424 |
* @author jdcasey
|
|
|
6e9424 |
@@ -374,70 +372,6 @@ public class StringSearchModelInterpolatorTest
|
|
|
6e9424 |
) ) );
|
|
|
6e9424 |
}
|
|
|
6e9424 |
|
|
|
6e9424 |
- public void testNotInterpolateObjectWithFile()
|
|
|
6e9424 |
- throws Exception
|
|
|
6e9424 |
- {
|
|
|
6e9424 |
- Model model = new Model();
|
|
|
6e9424 |
-
|
|
|
6e9424 |
- File baseDir = new File( System.getProperty( "user.dir" ) );
|
|
|
6e9424 |
-
|
|
|
6e9424 |
- Properties p = new Properties();
|
|
|
6e9424 |
-
|
|
|
6e9424 |
- ObjectWithNotInterpolatedFile obj = new ObjectWithNotInterpolatedFile( baseDir );
|
|
|
6e9424 |
-
|
|
|
6e9424 |
- StringSearchModelInterpolator interpolator = (StringSearchModelInterpolator) createInterpolator();
|
|
|
6e9424 |
-
|
|
|
6e9424 |
- ModelBuildingRequest config = createModelBuildingRequest( p );
|
|
|
6e9424 |
-
|
|
|
6e9424 |
- SimpleProblemCollector collector = new SimpleProblemCollector();
|
|
|
6e9424 |
- interpolator.interpolateObject( obj, model, new File( "." ), config, collector );
|
|
|
6e9424 |
- assertProblemFree( collector );
|
|
|
6e9424 |
-
|
|
|
6e9424 |
- //noinspection unchecked
|
|
|
6e9424 |
- Map<Class<?>, ?> cache =
|
|
|
6e9424 |
- (Map<Class<?>, ?>) getField( StringSearchModelInterpolator.class, "CACHED_ENTRIES" )
|
|
|
6e9424 |
- .get( null );
|
|
|
6e9424 |
-
|
|
|
6e9424 |
- Object objCacheItem = cache.get( Object.class );
|
|
|
6e9424 |
- Object fileCacheItem = cache.get( File.class );
|
|
|
6e9424 |
-
|
|
|
6e9424 |
- assertNotNull( objCacheItem );
|
|
|
6e9424 |
- assertNotNull( fileCacheItem );
|
|
|
6e9424 |
-
|
|
|
6e9424 |
- assertThat( ( (Object[]) getInternalState( objCacheItem, "fields" ) ).length, is( 0 ) );
|
|
|
6e9424 |
- assertThat( ( (Object[]) getInternalState( fileCacheItem, "fields" ) ).length, is( 0 ) );
|
|
|
6e9424 |
- }
|
|
|
6e9424 |
-
|
|
|
6e9424 |
- public void testNotInterpolateFile()
|
|
|
6e9424 |
- throws Exception
|
|
|
6e9424 |
- {
|
|
|
6e9424 |
- Model model = new Model();
|
|
|
6e9424 |
-
|
|
|
6e9424 |
- File baseDir = new File( System.getProperty( "user.dir" ) );
|
|
|
6e9424 |
-
|
|
|
6e9424 |
- Properties p = new Properties();
|
|
|
6e9424 |
-
|
|
|
6e9424 |
- StringSearchModelInterpolator interpolator = (StringSearchModelInterpolator) createInterpolator();
|
|
|
6e9424 |
-
|
|
|
6e9424 |
- ModelBuildingRequest config = createModelBuildingRequest( p );
|
|
|
6e9424 |
-
|
|
|
6e9424 |
- SimpleProblemCollector collector = new SimpleProblemCollector();
|
|
|
6e9424 |
- interpolator.interpolateObject( baseDir, model, new File( "." ), config, collector );
|
|
|
6e9424 |
- assertProblemFree( collector );
|
|
|
6e9424 |
-
|
|
|
6e9424 |
- //noinspection unchecked
|
|
|
6e9424 |
- Map<Class<?>, ?> cache =
|
|
|
6e9424 |
- (Map<Class<?>, ?>) getField( StringSearchModelInterpolator.class, "CACHED_ENTRIES" )
|
|
|
6e9424 |
- .get( null );
|
|
|
6e9424 |
-
|
|
|
6e9424 |
- Object fileCacheItem = cache.get( File.class );
|
|
|
6e9424 |
-
|
|
|
6e9424 |
- assertNotNull( fileCacheItem );
|
|
|
6e9424 |
-
|
|
|
6e9424 |
- assertThat( ( (Object[]) getInternalState( fileCacheItem, "fields" ) ).length, is( 0 ) );
|
|
|
6e9424 |
- }
|
|
|
6e9424 |
-
|
|
|
6e9424 |
-
|
|
|
6e9424 |
public void testConcurrentInterpolation()
|
|
|
6e9424 |
throws Exception
|
|
|
6e9424 |
{
|
|
|
6e9424 |
--
|
|
|
6e9424 |
2.24.1
|
|
|
6e9424 |
|