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