/** * Creates the {@link HttpSecurityTypeBuilder} to create the expected * {@link HttpSecurityType}. * * @return {@link HttpSecurityTypeBuilder}. */ public static HttpSecurityTypeBuilder createHttpSecurityTypeBuilder() { // Obtain the managed object type builder ManagedObjectTypeBuilder moTypeBuilder = ManagedObjectLoaderUtil.createManagedObjectTypeBuilder(); // Return the HTTP security type builder return new HttpSecurityTypeBuilderImpl(moTypeBuilder); }
@Override public void run() { ManagedObjectLoaderUtil.validateManagedObjectType(builder.moTypeBuilder, HttpSecurityManagedObjectAdapterSource.class, propertyNameValues); } });
/** * Validate the type. */ public void testType_Default() { // Create the expected type ManagedObjectTypeBuilder type = ManagedObjectLoaderUtil.createManagedObjectTypeBuilder(); type.setObjectClass(EntityManager.class); type.addExtensionInterface(EntityManager.class); // Load the properties List<String> properties = new LinkedList<>(); this.loadJpaProperties((name, value) -> { properties.add(name); properties.add(value); }); // Validate type ManagedObjectLoaderUtil.validateManagedObjectType(type, this.getJpaManagedObjectSourceClass(), properties.toArray(new String[properties.size()])); }
/** * Validate the specification */ public void testSpecification() { // Determine if default JPA implementation Class<? extends JpaManagedObjectSource> jpaMosClass = this.getJpaManagedObjectSourceClass(); // Create the specification List<String> specification = new ArrayList<>(2); specification.add(JpaManagedObjectSource.PROPERTY_PERSISTENCE_UNIT); specification.add("Persistence Unit"); if (jpaMosClass == JpaManagedObjectSource.class) { specification.add(JpaManagedObjectSource.PROPERTY_PERSISTENCE_FACTORY); specification.add("Persistence Factory"); } // Validate the specification ManagedObjectLoaderUtil.validateSpecification(jpaMosClass, specification.toArray(new String[specification.size()])); }
/** * Validate the type. */ public void testType_Managed() { // Create the expected type ManagedObjectTypeBuilder type = ManagedObjectLoaderUtil.createManagedObjectTypeBuilder(); type.setObjectClass(EntityManager.class); type.addExtensionInterface(EntityManager.class); // Load the properties List<String> properties = new LinkedList<>(); this.loadJpaProperties((name, value) -> { properties.add(name); properties.add(value); }); // Indicate connection properties.add(JpaManagedObjectSource.PROPERTY_DEPENDENCY_TYPE); properties.add(DependencyType.managed.name()); // Validate type ManagedObjectLoaderUtil.validateManagedObjectType(type, this.getJpaManagedObjectSourceClass(), properties.toArray(new String[properties.size()])); }
ManagedObjectTypeBuilder type = ManagedObjectLoaderUtil.createManagedObjectTypeBuilder(); type.setObjectClass(expectedType); ManagedObjectLoaderUtil.validateManagedObjectType(type, managedObjectSourceClass, properties.toArray(new String[properties.size()]));
@Override public void run() { ManagedObjectLoaderUtil.validateManagedObjectType( builder.moTypeBuilder, HttpSecurityManagedObjectAdapterSource.class, propertyNameValues); } });
/** * Creates the {@link HttpSecurityTypeBuilder} to create the expected * {@link HttpSecurityType}. * * @return {@link HttpSecurityTypeBuilder}. */ public static HttpSecurityTypeBuilder createHttpSecurityTypeBuilder() { // Obtain the managed object type builder ManagedObjectTypeBuilder moTypeBuilder = ManagedObjectLoaderUtil .createManagedObjectTypeBuilder(); // Return the HTTP security type builder return new HttpSecurityTypeBuilderImpl(moTypeBuilder); }
/** * Validate the type. */ public void testType_Connection() { // Create the expected type ManagedObjectTypeBuilder type = ManagedObjectLoaderUtil.createManagedObjectTypeBuilder(); type.setObjectClass(EntityManager.class); type.addDependency("Connection", Connection.class, null, 0, null); type.addExtensionInterface(EntityManager.class); // Load the properties List<String> properties = new LinkedList<>(); this.loadJpaProperties((name, value) -> { properties.add(name); properties.add(value); }); // Indicate connection properties.add(JpaManagedObjectSource.PROPERTY_DEPENDENCY_TYPE); properties.add(DependencyType.connection.name()); // Validate type ManagedObjectLoaderUtil.validateManagedObjectType(type, this.getJpaManagedObjectSourceClass(), properties.toArray(new String[properties.size()])); }
/** * Validate the type. */ public void testType_DataSource() { // Create the expected type ManagedObjectTypeBuilder type = ManagedObjectLoaderUtil.createManagedObjectTypeBuilder(); type.setObjectClass(EntityManager.class); type.addDependency("DataSource", DataSource.class, null, 0, null); type.addExtensionInterface(EntityManager.class); // Load the properties List<String> properties = new LinkedList<>(); this.loadJpaProperties((name, value) -> { properties.add(name); properties.add(value); }); // Indicate connection properties.add(JpaManagedObjectSource.PROPERTY_DEPENDENCY_TYPE); properties.add(DependencyType.datasource.name()); // Validate type ManagedObjectLoaderUtil.validateManagedObjectType(type, this.getJpaManagedObjectSourceClass(), properties.toArray(new String[properties.size()])); }