Commit db2ac7a4 authored by Christos Tranoris's avatar Christos Tranoris
Browse files

create test case for CREATION rule

parent 4d535fa0
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -165,7 +165,7 @@ public class LCMRulesExecutor {
        
        ApplicationHome home = new ApplicationHome(LCMRulesExecutor.class);        
        File classesJar =  home.getSource();     
        if ( classesJar.exists()  ) {
        if ( classesJar != null && classesJar.exists()  ) {
            optionList.addAll(Arrays.asList("-classpath", classesJar.getAbsoluteFile().toString().replace("-exec", "") ));
        }
        logger.debug("classesJar =  "+ classesJar); 
@@ -213,7 +213,7 @@ public class LCMRulesExecutor {

        URL[] classpath = new URL[] { temp.toUri().toURL()  };
            
        if ( classesJar.exists()  ) {
        if ( classesJar != null && classesJar.exists()  ) {
        	classpath = new URL[] { temp.toUri().toURL(), classesJar.toURI().toURL()  };
        } 
        logger.debug("classpath =  "+ classpath.toString());
+4 −2
Original line number Diff line number Diff line
@@ -396,8 +396,10 @@ public abstract class LcmBaseExecutor {
		

		System.out.println("============================================================================= \n");
		System.out.println("The value length is apayload= \n" + apayload.length());
        System.out.println("The value is apayload= \n" + apayload);
        if (apayload!=null) {
          System.out.println("The value length is apayload= \n" + apayload.length());          
        }
		System.out.println("============================================================================= \n");

		if (baseurl != null) {
+1 −0
Original line number Diff line number Diff line
@@ -313,6 +313,7 @@ public class CreateReservedService implements JavaDelegate {
			        .value( new Any( initCharValues.get( c.getName() ), initCharValues.get( c.getName() ))) ;
                serviceToCreate.addServiceCharacteristicItem( helperCreateCharacteristicItem(c, orderCharacteristic ) );
                characteristicFound = true;
                continue;
			    
			  }
			}
+6 −4
Original line number Diff line number Diff line
@@ -181,7 +181,7 @@ public class ProcessOrderIntegrationTest {
		assertThat(spec).isInstanceOf(ServiceSpecification.class);

		assertThat(spec.getServiceSpecCharacteristic().size()  ).isEqualTo(11);
		assertThat(specCirros.getServiceSpecCharacteristic().size()  ).isEqualTo(10);
		assertThat(specCirros.getServiceSpecCharacteristic().size()  ).isEqualTo(12);
		assertThat(sorder.getOrderItem().stream().findFirst().get().getService().getServiceCharacteristic().size()  ).isEqualTo(2);

		assertThat(repositoryService.createProcessDefinitionQuery().count()).isEqualTo(15);
@@ -224,7 +224,7 @@ public class ProcessOrderIntegrationTest {
		assertThat( aservice  ).isNotNull();
		assertThat( aservice.getServiceCharacteristic().size()  ).isEqualTo(11);
		assertThat( aserviceCirros  ).isNotNull();
		assertThat( aserviceCirros.getServiceCharacteristic().size()  ).isEqualTo(10);
		assertThat( aserviceCirros.getServiceCharacteristic().size()  ).isEqualTo(12);

		assertThat(  aservice.getServiceCharacteristicByName("Quality Class").getValue().getValue() ).isEqualTo( "1" );
		assertThat(  aservice.getServiceCharacteristicByName("cirros_2vnf_ns::OSM_CONFIG").getValue().getValue() ).contains( "eeeeeeee-8219-4580-9697-bf4a8f0a08f9" );
@@ -232,6 +232,8 @@ public class ProcessOrderIntegrationTest {
		//check that the cirros_2vnf_ns::SSHKEY value from the service order has been passed properly to the related RFS service
		assertThat(  aserviceCirros.getServiceCharacteristicByName("OSM_CONFIG").getValue().getValue() ).contains( "eeeeeeee-8219-4580-9697-bf4a8f0a08f9" );
        assertThat(  aserviceCirros.getServiceCharacteristicByName("SSHKEY").getValue().getValue() ).isEqualTo( "MCKEYTESTINORDERExampleConcatSSHKEY_EnhancedByRule" );
        assertThat(  aserviceCirros.getServiceCharacteristicByName("AProgrammaticChar").getValue().getValue() ).isEqualTo( "AProgrammaticNSDIDValue" );
        assertThat(  aserviceCirros.getServiceCharacteristicByName("Another ProgrammaticChar").getValue().getValue() ).isEqualTo( "AnotherValue" );
        
		
		//we will further check LCM rules!
+24 −8
Original line number Diff line number Diff line
@@ -222,6 +222,11 @@ public class SCMocked {
			InputStream in = new FileInputStream( sspec );
			sspectext = IOUtils.toString(in, "UTF-8");
			return sspectext;			
		} else if ( id.equals("89e027b5-24a9-4db7-b422-a963c9feeb7a") ) {
          File sspec = new File( "src/test/resources/LcmCirrosRule1Test_CREATION.json" );
          InputStream in = new FileInputStream( sspec );
          sspectext = IOUtils.toString(in, "UTF-8");
          return sspectext;           
      }
		
		
@@ -241,12 +246,23 @@ public class SCMocked {
				
		String sspectext = null;

		if ( phaseName.equals("PRE_PROVISION") ) {
	        if ( specid.equals("f2b74f90-4140-4895-80d1-ef243398117b") ) {
	            File sspec = new File( "src/test/resources/LcmRuleListSpecTest.json" );
	            InputStream in = new FileInputStream( sspec );
	            sspectext = IOUtils.toString(in, "UTF-8");
	            return sspectext;       
	            
	        }		  
		} else if ( phaseName.equals("CREATION") ) {
          if ( specid.equals("f2b74f90-4140-4895-80d1-ef243398117b") ) {
              File sspec = new File( "src/test/resources/LcmRuleListSpecTest_CREATION.json" );
              InputStream in = new FileInputStream( sspec );
              sspectext = IOUtils.toString(in, "UTF-8");
              return sspectext;     

            
        }         
    }
		

Loading