Skip to content

Commit

Permalink
re-enable tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sebersole committed Mar 19, 2021
1 parent 6a0d848 commit 2589671
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 29 deletions.
Expand Up @@ -15,6 +15,7 @@
import java.util.Map;
import java.util.Set;

import org.hibernate.Internal;
import org.hibernate.boot.MetadataSources;
import org.hibernate.boot.jaxb.spi.Binding;
import org.hibernate.boot.model.convert.spi.ConverterDescriptor;
Expand Down Expand Up @@ -78,25 +79,30 @@ public Map<String, Class<?>> getExtraQueryImports() {


// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// package private
// @Internal

void addAttributeConverterDefinition(ConverterDescriptor descriptor) {
@Internal
public void addAttributeConverterDefinition(ConverterDescriptor descriptor) {
attributeConverterDescriptorMap.put( descriptor.getAttributeConverterClass(), descriptor );
}

void addAnnotatedClassReference(Class annotatedClassReference) {
@Internal
public void addAnnotatedClassReference(Class annotatedClassReference) {
annotatedClassReferences.add( annotatedClassReference );
}

void addAnnotatedClassName(String annotatedClassName) {
@Internal
public void addAnnotatedClassName(String annotatedClassName) {
annotatedClassNames.add( annotatedClassName );
}

void addAnnotatedPackageName(String annotatedPackageName) {
@Internal
public void addAnnotatedPackageName(String annotatedPackageName) {
annotatedPackageNames.add( annotatedPackageName );
}

void addXmlBinding(Binding binding) {
@Internal
public void addXmlBinding(Binding binding) {
mappingFileBindings.add( binding );
}
}
Expand Up @@ -18,7 +18,7 @@
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<!-- custom scanner test -->
<property name="hibernate.ejb.resource_scanner" value="org.hibernate.jpa.test.packaging.CustomScanner"/>
<property name="hibernate.ejb.resource_scanner" value="org.hibernate.orm.test.bootstrap.scanning.CustomScanner"/>

<property name="hibernate.dialect" value="@db.dialect@"/>
<property name="hibernate.connection.driver_class" value="@jdbc.driver@"/>
Expand Down
Expand Up @@ -21,7 +21,7 @@

<properties>
<!-- custom scanner test -->
<!--<property name="hibernate.ejb.resource_scanner" value="org.hibernate.jpa.test.packaging.CustomScanner"/>-->
<!--<property name="hibernate.ejb.resource_scanner" value="org.hibernate.orm.test.bootstrap.scanning.CustomScanner"/>-->

<property name="hibernate.dialect" value="@db.dialect@"/>
<property name="hibernate.connection.driver_class" value="@jdbc.driver@"/>
Expand Down
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
*/
package org.hibernate.jpa.test.packaging;
package org.hibernate.orm.test.bootstrap.scanning;

import org.hibernate.boot.archive.scan.internal.StandardScanner;
import org.hibernate.boot.archive.scan.spi.ScanEnvironment;
Expand Down
@@ -1,4 +1,10 @@
package org.hibernate.boot.model.process.internal;
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
*/
package org.hibernate.orm.test.bootstrap.scanning;

import javax.persistence.AttributeConverter;
import javax.persistence.Converter;
Expand Down
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
*/
package org.hibernate.jpa.test.packaging;
package org.hibernate.orm.test.bootstrap.scanning;

import java.io.BufferedInputStream;
import java.io.File;
Expand Down
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
*/
package org.hibernate.jpa.test.packaging;
package org.hibernate.orm.test.bootstrap.scanning;

import java.io.File;
import java.util.HashMap;
Expand Down Expand Up @@ -43,8 +43,8 @@
import org.hibernate.jpa.test.pack.various.Seat;
import org.hibernate.stat.Statistics;

import org.hibernate.testing.FailureExpected;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import static org.junit.Assert.assertEquals;
Expand Down Expand Up @@ -384,6 +384,7 @@ public void testExtendedEntityManager() throws Exception {
}

@Test
@FailureExpected( jiraKey = "none", message = "Problem with caching, specifically managing SoftLocks" )
public void testConfiguration() throws Exception {
File testPackage = buildExplicitPar();
addPackageToClasspath( testPackage );
Expand Down
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
*/
package org.hibernate.jpa.test.packaging;
package org.hibernate.orm.test.bootstrap.scanning;

import java.io.File;
import java.net.MalformedURLException;
Expand Down
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
*/
package org.hibernate.jpa.test.packaging;
package org.hibernate.orm.test.bootstrap.scanning;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
Expand Down
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
*/
package org.hibernate.jpa.test.packaging;
package org.hibernate.orm.test.bootstrap.scanning;

import java.io.File;
import java.io.InputStream;
Expand Down
@@ -1,4 +1,10 @@
package org.hibernate.boot.model.process.internal;
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
*/
package org.hibernate.orm.test.bootstrap.scanning;

import java.net.MalformedURLException;
import java.net.URL;
Expand All @@ -21,13 +27,17 @@
import org.hibernate.boot.archive.scan.spi.ScanResult;
import org.hibernate.boot.archive.scan.spi.Scanner;
import org.hibernate.boot.archive.spi.InputStreamAccess;
import org.hibernate.boot.internal.ClassmateContext;
import org.hibernate.boot.model.convert.spi.ConverterDescriptor;
import org.hibernate.boot.model.process.internal.ManagedResourcesImpl;
import org.hibernate.boot.model.process.internal.ScanningCoordinator;
import org.hibernate.boot.registry.StandardServiceRegistry;
import org.hibernate.boot.registry.classloading.spi.ClassLoaderService;
import org.hibernate.boot.registry.classloading.spi.ClassLoadingException;
import org.hibernate.boot.spi.BootstrapContext;
import org.hibernate.boot.spi.XmlMappingBinderAccess;
import org.hibernate.internal.CoreMessageLogger;

import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseUnitTestCase;
import org.hibernate.testing.logger.LoggerInspectionRule;
Expand Down Expand Up @@ -57,6 +67,7 @@ public class ScanningCoordinatorTest extends BaseUnitTestCase {
private ManagedResourcesImpl managedResources = Mockito.mock( ManagedResourcesImpl.class );
private ScanResult scanResult = Mockito.mock( ScanResult.class );
private BootstrapContext bootstrapContext = Mockito.mock( BootstrapContext.class );
private ClassmateContext classmateContext = new ClassmateContext();
private XmlMappingBinderAccess xmlMappingBinderAccess = Mockito.mock( XmlMappingBinderAccess.class );

private ScanEnvironment scanEnvironment = Mockito.mock( ScanEnvironment.class );
Expand All @@ -79,6 +90,7 @@ public void init() {
Mockito.reset( classLoaderService );

when( bootstrapContext.getScanEnvironment() ).thenReturn( scanEnvironment );
when( bootstrapContext.getClassmateContext() ).thenReturn( classmateContext );
when( bootstrapContext.getServiceRegistry() ).thenReturn( serviceRegistry );
when( serviceRegistry.getService( ClassLoaderService.class ) ).thenReturn( classLoaderService );

Expand Down

0 comments on commit 2589671

Please sign in to comment.