SdxL2Manager implements SdxL2Service { @Override public void createSdxL2(String sdxl2) { checkNotNull(sdxl2, "sdxl2 name cannot be null"); checkState(!sdxl2.contains(","), "sdxl2 names cannot contain commas"); checkState(!sdxl2.contains("|"), "sdxl2 names cannot contain pipe"); checkState(!sdxl2.contains("-"), "sdxl2 names cannot contain dash"); checkState(!sdxl2.contains(":"), "sdxl2 names cannot contain colon"); try { this.sdxL2Store.putSdxL2(sdxl2); } catch (SdxL2Exception e) { log.info(e.getMessage()); } }  @Modified void modified(ComponentContext context); @Override void createSdxL2(String sdxl2); @Override void deleteSdxL2(String sdxl2); @Override Set<String> getSdxL2s(); @Override void addSdxL2ConnectionPoint(String sdxl2, SdxL2ConnectionPoint sdxl2cp); @Override Set<String> getSdxL2ConnectionPoints(Optional<String> sdxl2); @Override void removeSdxL2ConnectionPoint(String sdxl2cp); @Override void addVC(String sdxl2, String sdxl2cplhs, String sdxl2cprhs); @Override void removeVC(String vc); @Override SdxL2ConnectionPoint getSdxL2ConnectionPoint(String sdxl2cp); @Override Set<String> getVirtualCircuits(Optional<String> sdxl2); @Override VirtualCircuit getVirtualCircuit(String sdxl2vc); @Override SdxL2State getIntentState(Key intentKey); @Override SdxL2State getEdgePortState(ConnectPoint edgeport); @Override void cleanSdxL2(); void cleanup();  }
@Test public void testCreateSdxL2s() { manager.createSdxL2(SDXL2); manager.createSdxL2(SDXL2_2); manager.createSdxL2(SDXL2); }
@Test public void testSdxL2NameChecks() { String sdxL2 = ""; String sdxL2Aux = "test3,4"; exceptionSdxL2Name.expect(NullPointerException.class); exceptionSdxL2Name.expectMessage("name cannot be null"); manager.createSdxL2(null); manager.createSdxL2(sdxL2); exceptionSdxL2Name.expect(IllegalStateException.class); exceptionSdxL2Name.expectMessage("names cannot contain commas"); manager.createSdxL2(sdxL2Aux); }