Search in sources :

Example 11 with BuildConfigurationSet

use of org.jboss.pnc.model.BuildConfigurationSet in project pnc by project-ncl.

the class GroupConfigurationProviderImpl method addConfiguration.

@Override
public void addConfiguration(String id, String configId) throws DTOValidationException {
    BuildConfigurationSet buildConfigSet = repository.queryById(Integer.valueOf(id));
    BuildConfiguration buildConfig = buildConfigurationRepository.queryById(Integer.valueOf(configId));
    ValidationBuilder.validateObject(buildConfigSet, WhenUpdating.class).validateCondition(buildConfigSet != null, "No build configuration set exists with id: " + id).validateCondition(buildConfig != null, "No build configuration exists with id: " + configId);
    if (!buildConfigSet.getBuildConfigurations().contains(buildConfig)) {
        buildConfigSet.addBuildConfiguration(buildConfig);
        repository.save(buildConfigSet);
    }
}
Also used : BuildConfiguration(org.jboss.pnc.model.BuildConfiguration) BuildConfigurationSet(org.jboss.pnc.model.BuildConfigurationSet)

Example 12 with BuildConfigurationSet

use of org.jboss.pnc.model.BuildConfigurationSet in project pnc by project-ncl.

the class BuildTriggererImpl method loadAuditedsFromDB.

private Map<Integer, BuildConfigurationAudited> loadAuditedsFromDB(BuildConfigurationSet buildConfigurationSet, List<BuildConfigurationRevisionRef> buildConfigurationAuditedRests) throws InvalidEntityException {
    Map<Integer, BuildConfigurationAudited> buildConfigurationAuditedsMap = new HashMap<>();
    Set<IdRev> buildConfigurationAuditedRevs = nullableStreamOf(buildConfigurationAuditedRests).map(bcrRef -> new IdRev(Integer.valueOf(bcrRef.getId()), bcrRef.getRev())).collect(Collectors.toSet());
    if (!buildConfigurationAuditedRevs.isEmpty()) {
        Map<IdRev, BuildConfigurationAudited> buildConfigurationsAuditedMap = buildConfigurationAuditedRepository.queryById(buildConfigurationAuditedRevs);
        for (BuildConfigurationRevisionRef bc : buildConfigurationAuditedRests) {
            BuildConfigurationAudited buildConfigurationAudited = buildConfigurationsAuditedMap.get(new IdRev(Integer.valueOf(bc.getId()), bc.getRev()));
            Preconditions.checkArgument(buildConfigurationAudited != null, "Can't find Build Configuration with id=" + bc.getId() + ", rev=" + bc.getRev());
            buildConfigurationAudited = hibernateLazyInitializer.initializeBuildConfigurationAuditedBeforeTriggeringIt(buildConfigurationAudited);
            if (!buildConfigurationSet.getBuildConfigurations().contains(buildConfigurationAudited.getBuildConfiguration())) {
                throw new InvalidEntityException("BuildConfigurationSet " + buildConfigurationSet + " doesn't contain this BuildConfigurationAudited entity " + buildConfigurationAudited);
            }
            buildConfigurationAuditedsMap.put(buildConfigurationAudited.getId(), buildConfigurationAudited);
        }
    }
    return buildConfigurationAuditedsMap;
}
Also used : BuildOptions(org.jboss.pnc.spi.BuildOptions) BuildConfiguration(org.jboss.pnc.model.BuildConfiguration) BuildStatusNotifications(org.jboss.pnc.coordinator.notifications.buildTask.BuildStatusNotifications) HibernateLazyInitializer(org.jboss.pnc.facade.util.HibernateLazyInitializer) BuildConfigurationSetRepository(org.jboss.pnc.spi.datastore.repositories.BuildConfigurationSetRepository) LoggerFactory(org.slf4j.LoggerFactory) BuildConfigurationSet(org.jboss.pnc.model.BuildConfigurationSet) BuildConfigurationAuditedRepository(org.jboss.pnc.spi.datastore.repositories.BuildConfigurationAuditedRepository) BuildSetStatusNotifications(org.jboss.pnc.coordinator.notifications.buildSetTask.BuildSetStatusNotifications) HashMap(java.util.HashMap) BuildTask(org.jboss.pnc.spi.coordinator.BuildTask) OptionalInt(java.util.OptionalInt) BuildConfigurationAudited(org.jboss.pnc.model.BuildConfigurationAudited) BuildMapper(org.jboss.pnc.mapper.api.BuildMapper) Inject(javax.inject.Inject) UserService(org.jboss.pnc.facade.util.UserService) Map(java.util.Map) BuildSetTask(org.jboss.pnc.spi.coordinator.BuildSetTask) BuildTriggerer(org.jboss.pnc.facade.BuildTriggerer) BuildConfigurationRepository(org.jboss.pnc.spi.datastore.repositories.BuildConfigurationRepository) BuildConflictException(org.jboss.pnc.spi.exception.BuildConflictException) Stateless(javax.ejb.Stateless) Logger(org.slf4j.Logger) BuildTaskContext(org.jboss.pnc.common.logging.BuildTaskContext) BuildCoordinator(org.jboss.pnc.spi.coordinator.BuildCoordinator) Collection(java.util.Collection) Set(java.util.Set) Collectors(java.util.stream.Collectors) IdRev(org.jboss.pnc.model.IdRev) List(java.util.List) GenericSettingProvider(org.jboss.pnc.facade.providers.GenericSettingProvider) InvalidEntityException(org.jboss.pnc.facade.validation.InvalidEntityException) CoreException(org.jboss.pnc.spi.exception.CoreException) StreamHelper.nullableStreamOf(org.jboss.pnc.common.util.StreamHelper.nullableStreamOf) GroupBuildRequest(org.jboss.pnc.dto.requests.GroupBuildRequest) BuildConfigurationRevisionRef(org.jboss.pnc.dto.BuildConfigurationRevisionRef) Optional(java.util.Optional) Preconditions(com.google.common.base.Preconditions) Collections(java.util.Collections) BuildConfigurationAudited(org.jboss.pnc.model.BuildConfigurationAudited) HashMap(java.util.HashMap) BuildConfigurationRevisionRef(org.jboss.pnc.dto.BuildConfigurationRevisionRef) IdRev(org.jboss.pnc.model.IdRev) InvalidEntityException(org.jboss.pnc.facade.validation.InvalidEntityException)

Example 13 with BuildConfigurationSet

use of org.jboss.pnc.model.BuildConfigurationSet in project pnc by project-ncl.

the class ProductVersionRepositoryTest method shouldGetProductVersion.

@Test
@Transactional
public void shouldGetProductVersion() {
    // given
    Product pruduct = Product.Builder.newBuilder().abbreviation("mp").name("MyProduct").build();
    ProductVersion productVersion = ProductVersion.Builder.newBuilder().version("1.0").product(pruduct).build();
    BuildConfigurationSet buildConfigurationSet = BuildConfigurationSet.Builder.newBuilder().name("set1").build();
    Set<BuildConfigurationSet> buildConfigurationSets = new HashSet<>();
    buildConfigurationSets.add(buildConfigurationSet);
    BuildConfigurationSet buildConfigurationSetSaved = buildConfigurationSetRepository.save(buildConfigurationSet);
    productVersion.setBuildConfigurationSets(buildConfigurationSets);
    // when
    productRepository.save(pruduct);
    ProductVersion saved = productVersionRepository.save(productVersion);
    // then
    ProductVersion productVersionFromDb = productVersionRepository.queryById(productVersion.getId());
    Assert.assertNotNull(productVersionFromDb);
    Assert.assertEquals(productVersionFromDb.getVersion(), productVersion.getVersion());
    assertThat(productVersionFromDb.getBuildConfigurationSets()).containsExactly(buildConfigurationSetSaved);
}
Also used : BuildConfigurationSet(org.jboss.pnc.model.BuildConfigurationSet) Product(org.jboss.pnc.model.Product) ProductVersion(org.jboss.pnc.model.ProductVersion) HashSet(java.util.HashSet) Test(org.junit.Test) ContainerTest(org.jboss.pnc.test.category.ContainerTest) Transactional(org.jboss.arquillian.transaction.api.annotation.Transactional)

Example 14 with BuildConfigurationSet

use of org.jboss.pnc.model.BuildConfigurationSet in project pnc by project-ncl.

the class DatabaseDataInitializer method initiliazeProjectProductData.

@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public void initiliazeProjectProductData() {
    BuildEnvironment environment1Unsaved = BuildEnvironment.Builder.newBuilder().name("Demo Environment 1").description("Basic Java and Maven Environment").attribute("JDK", "1.7.0").attribute("OS", "Linux").systemImageId("12345678").systemImageRepositoryUrl("my.registry/newcastle").systemImageType(SystemImageType.DOCKER_IMAGE).deprecated(false).build();
    BuildEnvironment environment1 = environmentRepository.save(environment1Unsaved);
    BuildEnvironment environment2Unsaved = BuildEnvironment.Builder.newBuilder().name("Demo Environment 2").description("Basic Java and Maven Environment").attribute("JDK", "1.7.0").attribute("OS", "Linux").systemImageId("12345679").systemImageRepositoryUrl("my.registry/newcastle").systemImageType(SystemImageType.DOCKER_IMAGE).deprecated(true).build();
    BuildEnvironment environment2 = environmentRepository.save(environment2Unsaved);
    /*
         * All the bi-directional mapping settings are managed inside the Builders
         */
    // Example product and product version
    Product product = Product.Builder.newBuilder().name(PNC_PRODUCT_NAME).abbreviation("PNC").description("Example Product for Project Newcastle Demo").build();
    product = productRepository.save(product);
    // Example product version, release, and milestone of the product
    ProductVersion productVersion1 = ProductVersion.Builder.newBuilder().version(PNC_PRODUCT_VERSION_1).product(product).generateBrewTagPrefix(product.getAbbreviation(), PNC_PRODUCT_VERSION_1, systemConfig.getBrewTagPattern()).build();
    productVersion1 = productVersionRepository.save(productVersion1);
    ProductVersion productVersion2 = ProductVersion.Builder.newBuilder().version(PNC_PRODUCT_VERSION_2).product(product).generateBrewTagPrefix(product.getAbbreviation(), PNC_PRODUCT_VERSION_2, systemConfig.getBrewTagPattern()).build();
    productVersion2 = productVersionRepository.save(productVersion2);
    demoProductMilestone1 = ProductMilestone.Builder.newBuilder().version(PNC_PRODUCT_MILESTONE1).startingDate(ONE_WEEK_BEFORE_TODAY).plannedEndDate(TODAY).productVersion(productVersion1).build();
    demoProductMilestone1 = productMilestoneRepository.save(demoProductMilestone1);
    ProductMilestone demoProductMilestone2 = ProductMilestone.Builder.newBuilder().version(PNC_PRODUCT_MILESTONE2).startingDate(TODAY).plannedEndDate(ONE_WEEK_AFTER_TODAY).productVersion(productVersion1).build();
    demoProductMilestone2 = productMilestoneRepository.save(demoProductMilestone2);
    Instant t0 = TODAY.toInstant();
    Instant successTime = t0.plus(10, ChronoUnit.MINUTES);
    ProductMilestone demoProductMilestone3 = ProductMilestone.Builder.newBuilder().version(PNC_PRODUCT_MILESTONE3).startingDate(TODAY).plannedEndDate(ONE_WEEK_AFTER_TODAY).endDate(ONE_WEEK_AFTER_TODAY).productVersion(productVersion1).build();
    demoProductMilestone3 = productMilestoneRepository.save(demoProductMilestone3);
    ProductMilestone demoProductMilestone4 = ProductMilestone.Builder.newBuilder().version(PNC_PRODUCT_MILESTONE4).startingDate(TODAY).plannedEndDate(ONE_WEEK_AFTER_TODAY).endDate(ONE_WEEK_AFTER_TODAY).productVersion(productVersion1).build();
    demoProductMilestone4 = productMilestoneRepository.save(demoProductMilestone4);
    ProductMilestoneRelease milestoneRelease1 = new ProductMilestoneRelease();
    milestoneRelease1.setId(Sequence.nextId());
    milestoneRelease1.setMilestone(demoProductMilestone3);
    // first store with latter starting date to test sort function
    milestoneRelease1.setStartingDate(Date.from(t0.plus(2, ChronoUnit.MINUTES)));
    milestoneRelease1.setStatus(MilestoneCloseStatus.SYSTEM_ERROR);
    productMilestoneReleaseRepository.save(milestoneRelease1);
    ProductMilestoneRelease milestoneRelease2 = new ProductMilestoneRelease();
    milestoneRelease2.setId(Sequence.nextId());
    milestoneRelease2.setMilestone(demoProductMilestone3);
    milestoneRelease2.setStartingDate(Date.from(t0));
    milestoneRelease2.setStatus(MilestoneCloseStatus.FAILED);
    productMilestoneReleaseRepository.save(milestoneRelease2);
    ProductMilestoneRelease milestoneRelease3 = new ProductMilestoneRelease();
    milestoneRelease3.setId(Sequence.nextId());
    milestoneRelease3.setMilestone(demoProductMilestone3);
    milestoneRelease3.setStartingDate(Date.from(successTime));
    milestoneRelease3.setStatus(MilestoneCloseStatus.SUCCEEDED);
    productMilestoneReleaseRepository.save(milestoneRelease3);
    ProductRelease productRelease = ProductRelease.Builder.newBuilder().version(PNC_PRODUCT_RELEASE).productMilestone(demoProductMilestone1).supportLevel(SupportLevel.EARLYACCESS).build();
    productRelease = productReleaseRepository.save(productRelease);
    productVersion1.setCurrentProductMilestone(demoProductMilestone3);
    productVersion1 = productVersionRepository.save(productVersion1);
    // Example projects
    Project project1 = Project.Builder.newBuilder().name(PNC_PROJECT_1_NAME).description("Example Project for Newcastle Demo").projectUrl("https://github.com/project-ncl/pnc").build();
    Project project2 = Project.Builder.newBuilder().name("Causeway").description("Causeway - Koji integration").projectUrl("https://github.com/project-ncl/causeway").build();
    Project project3 = Project.Builder.newBuilder().name("Pnc Build Agent").description("Pnc Build Agent - remote client to execute commands.").projectUrl("https://github.com/project-ncl/pnc-build-agent").build();
    Project project4 = Project.Builder.newBuilder().name("Dependency Analysis").description("Dependency Analysis - Analise project dependencies.").projectUrl("https://github.com/project-ncl/dependency-analysis").build();
    Project project5 = Project.Builder.newBuilder().name("termd").description("Remote shell.").projectUrl("https://github.com/project-ncl/termd").build();
    projectRepository.save(project1);
    projectRepository.save(project2);
    projectRepository.save(project3);
    projectRepository.save(project4);
    projectRepository.save(project5);
    RepositoryConfiguration repositoryConfiguration1 = createRepositoryConfiguration(demoDataConfig.getInternalRepo(0), "https://github.com/project-ncl/pnc.git");
    RepositoryConfiguration repositoryConfiguration2 = createRepositoryConfiguration(demoDataConfig.getInternalRepo(1), null);
    RepositoryConfiguration repositoryConfiguration3 = createRepositoryConfiguration(demoDataConfig.getInternalRepo(2), null);
    RepositoryConfiguration repositoryConfiguration4 = createRepositoryConfiguration(demoDataConfig.getInternalRepo(3), null);
    RepositoryConfiguration repositoryConfiguration5 = createRepositoryConfiguration(demoDataConfig.getInternalRepo(4), null);
    repositoryConfigurationRepository.save(repositoryConfiguration1);
    repositoryConfigurationRepository.save(repositoryConfiguration2);
    repositoryConfigurationRepository.save(repositoryConfiguration3);
    repositoryConfigurationRepository.save(repositoryConfiguration4);
    repositoryConfigurationRepository.save(repositoryConfiguration5);
    // Example build configurations
    Map<String, String> genericParameters = new HashMap<>();
    genericParameters.put("KEY", "VALUE");
    buildConfiguration1 = BuildConfiguration.Builder.newBuilder().id(sequenceHandlerRepository.getNextID(BuildConfiguration.SEQUENCE_NAME).intValue()).name(PNC_PROJECT_BUILD_CFG_ID).project(project1).description("Test build config for project newcastle").buildType(BuildType.MVN).buildEnvironment(environment1).buildScript("mvn deploy -DskipTests=true").repositoryConfiguration(repositoryConfiguration1).productVersion(productVersion1).scmRevision("*/v0.2").genericParameters(genericParameters).build();
    buildConfiguration1 = buildConfigurationRepository.save(buildConfiguration1);
    buildConfiguration2 = BuildConfiguration.Builder.newBuilder().id(sequenceHandlerRepository.getNextID(BuildConfiguration.SEQUENCE_NAME).intValue()).name("termd").project(project2).buildType(BuildType.MVN).description("Test configueration for Termd.").buildEnvironment(environment1).buildScript("mvn deploy -DskipTests=true").productVersion(productVersion1).repositoryConfiguration(repositoryConfiguration2).scmRevision("master").build();
    buildConfiguration2 = buildConfigurationRepository.save(buildConfiguration2);
    BuildConfiguration buildConfiguration3 = BuildConfiguration.Builder.newBuilder().id(sequenceHandlerRepository.getNextID(BuildConfiguration.SEQUENCE_NAME).intValue()).name("pnc-build-agent-0.4").project(project3).description("Test config for Pnc Build Agent.").buildType(BuildType.MVN).buildEnvironment(environment1).buildScript("mvn deploy -DskipTests=true").productVersion(productVersion2).repositoryConfiguration(repositoryConfiguration3).dependency(buildConfiguration2).build();
    buildConfiguration3 = buildConfigurationRepository.save(buildConfiguration3);
    BuildConfiguration buildConfiguration4 = BuildConfiguration.Builder.newBuilder().id(sequenceHandlerRepository.getNextID(BuildConfiguration.SEQUENCE_NAME).intValue()).name("dependency-analysis-1.3").project(project4).description("Test config for Dependency Analysis.").buildType(BuildType.MVN).buildEnvironment(environment1).buildScript("mvn deploy -DskipTests=true").repositoryConfiguration(repositoryConfiguration4).dependency(buildConfiguration1).build();
    buildConfiguration4 = buildConfigurationRepository.save(buildConfiguration4);
    BuildConfiguration buildConfiguration5 = BuildConfiguration.Builder.newBuilder().id(sequenceHandlerRepository.getNextID(BuildConfiguration.SEQUENCE_NAME).intValue()).name("maven-plugin-test").project(project5).description("Test build for Plugins with external downloads").buildType(BuildType.MVN).buildEnvironment(environment1).buildScript("mvn clean deploy").repositoryConfiguration(repositoryConfiguration5).build();
    buildConfiguration5 = buildConfigurationRepository.save(buildConfiguration5);
    // Build config set containing the three example build configs
    buildConfigurationSet1 = BuildConfigurationSet.Builder.newBuilder().name("Example-Build-Group-1").buildConfiguration(buildConfiguration1).buildConfiguration(buildConfiguration2).buildConfiguration(buildConfiguration3).productVersion(productVersion1).build();
    BuildConfigurationSet buildConfigurationSet2 = BuildConfigurationSet.Builder.newBuilder().name("Fabric-Build-Group").buildConfiguration(buildConfiguration4).productVersion(productVersion1).build();
    demoUser = User.Builder.newBuilder().username("demo-user").firstName("Demo First Name").lastName("Demo Last Name").email("demo-user@pnc.com").build();
    pncAdminUser = User.Builder.newBuilder().username("pnc-admin").firstName("pnc-admin").lastName("pnc-admin").email("pnc-admin@pnc.com").build();
    buildConfigurationSetRepository.save(buildConfigurationSet1);
    buildConfigurationSetRepository.save(buildConfigurationSet2);
    demoUser = userRepository.save(demoUser);
    pncAdminUser = userRepository.save(pncAdminUser);
}
Also used : ProductMilestone(org.jboss.pnc.model.ProductMilestone) HashMap(java.util.HashMap) Instant(java.time.Instant) Product(org.jboss.pnc.model.Product) ProductVersion(org.jboss.pnc.model.ProductVersion) BuildConfiguration(org.jboss.pnc.model.BuildConfiguration) Project(org.jboss.pnc.model.Project) BuildConfigurationSet(org.jboss.pnc.model.BuildConfigurationSet) BuildEnvironment(org.jboss.pnc.model.BuildEnvironment) ProductRelease(org.jboss.pnc.model.ProductRelease) RepositoryConfiguration(org.jboss.pnc.model.RepositoryConfiguration) ProductMilestoneRelease(org.jboss.pnc.model.ProductMilestoneRelease) TransactionAttribute(javax.ejb.TransactionAttribute)

Example 15 with BuildConfigurationSet

use of org.jboss.pnc.model.BuildConfigurationSet in project pnc by project-ncl.

the class DatabaseDataInitializer method verifyData.

public void verifyData() {
    // Check number of entities in DB
    Preconditions.checkState(projectRepository.count() > 0, "Expecting number of Projects > 0");
    Preconditions.checkState(productRepository.count() > 0, "Expecting number of Products > 0");
    Preconditions.checkState(buildConfigurationRepository.count() > 0, "Expecting number of BuildConfigurations > 0");
    Preconditions.checkState(productVersionRepository.count() > 0, "Expecting number of ProductVersions > 0");
    Preconditions.checkState(buildConfigurationSetRepository.count() > 0, "Expecting number of BuildRepositorySets > 0");
    Preconditions.checkState(artifactRepository.count() > 0, "Expecting number of Artifacts > 0");
    BuildConfiguration buildConfigurationDB = buildConfigurationRepository.queryAll().get(0);
    // Check that BuildConfiguration and BuildConfigurationSet have a ProductVersion associated
    BuildConfigurationSet buildConfigurationSet = buildConfigurationDB.getBuildConfigurationSets().iterator().next();
    Preconditions.checkState(buildConfigurationSet.getProductVersion() != null, "Product version of buildConfiguration must be not null");
    BuildConfigurationSet buildConfigurationSetDB = buildConfigurationSetRepository.queryAll().get(0);
    Preconditions.checkState(buildConfigurationSetDB.getProductVersion() != null, "Product version of buildConfigurationSet must be not null");
    // Check that mapping between Product and Build Configuration via BuildConfigurationSet is correct
    Preconditions.checkState(buildConfigurationSetDB.getProductVersion().getProduct().getName().equals(PNC_PRODUCT_NAME), "Product mapped to Project must be " + PNC_PRODUCT_NAME);
    Preconditions.checkState(buildConfigurationSetDB.getProductVersion().getVersion().equals(PNC_PRODUCT_VERSION_1), "Product version mapped to Project must be " + PNC_PRODUCT_VERSION_1);
    // Check that BuildConfiguration and BuildConfigurationSet have a ProductVersion associated
    Preconditions.checkState(buildConfigurationSet.getProductVersion().getVersion().equals(PNC_PRODUCT_VERSION_1), "Product version mapped to BuildConfiguration must be " + PNC_PRODUCT_VERSION_1);
    Preconditions.checkState(buildConfigurationSet.getProductVersion().getProduct().getName().equals(PNC_PRODUCT_NAME), "Product mapped to BuildConfiguration must be " + PNC_PRODUCT_NAME);
    // Check data of BuildConfiguration
    Preconditions.checkState(buildConfigurationDB.getProject().getName().equals(PNC_PROJECT_1_NAME), "Project mapped to BuildConfiguration must be " + PNC_PROJECT_1_NAME);
}
Also used : BuildConfiguration(org.jboss.pnc.model.BuildConfiguration) BuildConfigurationSet(org.jboss.pnc.model.BuildConfigurationSet)

Aggregations

BuildConfigurationSet (org.jboss.pnc.model.BuildConfigurationSet)29 BuildSetTask (org.jboss.pnc.spi.coordinator.BuildSetTask)11 Test (org.junit.Test)11 BuildConfiguration (org.jboss.pnc.model.BuildConfiguration)8 BuildOptions (org.jboss.pnc.spi.BuildOptions)8 BuildSetStatus (org.jboss.pnc.spi.BuildSetStatus)5 BuildTask (org.jboss.pnc.spi.coordinator.BuildTask)5 CoreException (org.jboss.pnc.spi.exception.CoreException)5 Inject (javax.inject.Inject)4 BuildConfigSetRecord (org.jboss.pnc.model.BuildConfigSetRecord)4 BuildCoordinator (org.jboss.pnc.spi.coordinator.BuildCoordinator)4 Logger (org.slf4j.Logger)4 LoggerFactory (org.slf4j.LoggerFactory)4 HashSet (java.util.HashSet)3 List (java.util.List)3 Set (java.util.Set)3 Consumer (java.util.function.Consumer)3 BuildStatus (org.jboss.pnc.enums.BuildStatus)3 BuildSetStatusChangedEvent (org.jboss.pnc.spi.events.BuildSetStatusChangedEvent)3 ArrayList (java.util.ArrayList)2