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