Search in sources :

Example 1 with PropertySet

use of com.mysql.cj.conf.PropertySet in project JavaSegundasQuintas by ecteruel.

the class ZeroDateTimeToNullValueFactoryTest method testBasics.

@Test
public void testBasics() {
    PropertySet pset = new DefaultPropertySet();
    pset.<PropertyDefinitions.ZeroDatetimeBehavior>getEnumProperty(PropertyKey.zeroDateTimeBehavior).setValue(ZeroDatetimeBehavior.CONVERT_TO_NULL);
    LocalDateTimeValueFactory vf = new LocalDateTimeValueFactory(pset);
    assertNull(vf.createFromDate(new InternalDate()));
    assertEquals(LocalDateTime.of(2018, 1, 1, 0, 0, 0, 0), vf.createFromDate(new InternalDate(2018, 1, 1)));
    assertNotNull(vf.createFromTime(new InternalTime()));
    assertEquals(LocalDateTime.ofEpochSecond(0, 0, ZoneOffset.UTC), vf.createFromTime(new InternalTime()));
    assertThrows(DataReadException.class, "The value '-1:00:00' is an invalid TIME value. JDBC Time objects represent a wall-clock time and not a duration as MySQL treats them. If you are treating this type as a duration, consider retrieving this value as a string and dealing with it according to your requirements.", new Callable<Void>() {

        @Override
        public Void call() throws Exception {
            vf.createFromTime(new InternalTime(-1, 0, 0, 0, 0));
            return null;
        }
    });
    assertThrows(DataReadException.class, "The value '44:00:00' is an invalid TIME value. JDBC Time objects represent a wall-clock time and not a duration as MySQL treats them. If you are treating this type as a duration, consider retrieving this value as a string and dealing with it according to your requirements.", new Callable<Void>() {

        @Override
        public Void call() throws Exception {
            vf.createFromTime(new InternalTime(44, 0, 0, 0, 0));
            return null;
        }
    });
    assertEquals(LocalDateTime.of(1970, 1, 1, 1, 1, 1, 1), vf.createFromTime(new InternalTime(1, 1, 1, 1, 9)));
    assertNull(vf.createFromTimestamp(new InternalTimestamp(0, 0, 0, 0, 0, 0, 0, 0)));
    assertThrows(DataReadException.class, "Zero date value prohibited", new Callable<Void>() {

        @Override
        public Void call() throws Exception {
            vf.createFromTimestamp(new InternalTimestamp(0, 0, 0, 1, 1, 1, 1, 9));
            return null;
        }
    });
    assertThrows(DateTimeException.class, "Invalid value for MonthOfYear \\(valid values 1 - 12\\): 0", new Callable<Void>() {

        @Override
        public Void call() throws Exception {
            assertEquals(LocalDateTime.of(0, 0, 1, 1, 1, 1, 1), vf.createFromTimestamp(new InternalTimestamp(0, 0, 1, 1, 1, 1, 1, 9)));
            return null;
        }
    });
    assertThrows(DateTimeException.class, "Invalid value for DayOfMonth \\(valid values 1 - 28/31\\): 0", new Callable<Void>() {

        @Override
        public Void call() throws Exception {
            assertEquals(LocalDateTime.of(0, 1, 0, 1, 1, 1, 1), vf.createFromTimestamp(new InternalTimestamp(0, 1, 0, 1, 1, 1, 1, 9)));
            return null;
        }
    });
    assertEquals(LocalDateTime.of(0, 1, 1, 1, 1, 1, 1), vf.createFromTimestamp(new InternalTimestamp(0, 1, 1, 1, 1, 1, 1, 9)));
    assertThrows(DateTimeException.class, "Invalid value for MonthOfYear \\(valid values 1 - 12\\): 0", new Callable<Void>() {

        @Override
        public Void call() throws Exception {
            assertEquals(LocalDateTime.of(2018, 0, 0, 1, 1, 1, 1), vf.createFromTimestamp(new InternalTimestamp(2018, 0, 0, 1, 1, 1, 1, 9)));
            return null;
        }
    });
    assertThrows(DateTimeException.class, "Invalid value for MonthOfYear \\(valid values 1 - 12\\): 0", new Callable<Void>() {

        @Override
        public Void call() throws Exception {
            assertEquals(LocalDateTime.of(2018, 0, 1, 1, 1, 1, 1), vf.createFromTimestamp(new InternalTimestamp(2018, 0, 1, 1, 1, 1, 1, 9)));
            return null;
        }
    });
    assertThrows(DateTimeException.class, "Invalid value for DayOfMonth \\(valid values 1 - 28/31\\): 0", new Callable<Void>() {

        @Override
        public Void call() throws Exception {
            assertEquals(LocalDateTime.of(2018, 1, 0, 1, 1, 1, 1), vf.createFromTimestamp(new InternalTimestamp(2018, 1, 0, 1, 1, 1, 1, 9)));
            return null;
        }
    });
    assertEquals(LocalDateTime.of(2018, 1, 1, 1, 1, 1, 1), vf.createFromTimestamp(new InternalTimestamp(2018, 1, 1, 1, 1, 1, 1, 9)));
    assertEquals("java.time.LocalDateTime", vf.getTargetTypeName());
}
Also used : DefaultPropertySet(com.mysql.cj.conf.DefaultPropertySet) PropertyDefinitions(com.mysql.cj.conf.PropertyDefinitions) InternalDate(com.mysql.cj.protocol.InternalDate) PropertySet(com.mysql.cj.conf.PropertySet) DefaultPropertySet(com.mysql.cj.conf.DefaultPropertySet) InternalTime(com.mysql.cj.protocol.InternalTime) DataReadException(com.mysql.cj.exceptions.DataReadException) DateTimeException(java.time.DateTimeException) InternalTimestamp(com.mysql.cj.protocol.InternalTimestamp) Test(org.junit.jupiter.api.Test)

Example 2 with PropertySet

use of com.mysql.cj.conf.PropertySet in project ABC by RuiPinto96274.

the class InternalXBaseTestCase method createTestSession.

public MysqlxSession createTestSession() {
    PropertySet pset = new DefaultPropertySet();
    pset.initializeProperties(this.testProperties);
    MysqlxSession session = new MysqlxSession(this.testHostInfo, pset);
    return session;
}
Also used : DefaultPropertySet(com.mysql.cj.conf.DefaultPropertySet) PropertySet(com.mysql.cj.conf.PropertySet) DefaultPropertySet(com.mysql.cj.conf.DefaultPropertySet) MysqlxSession(com.mysql.cj.MysqlxSession)

Example 3 with PropertySet

use of com.mysql.cj.conf.PropertySet in project ABC by RuiPinto96274.

the class ClientImpl method newPooledXProtocol.

private PooledXProtocol newPooledXProtocol(HostInfo hi) {
    PooledXProtocol tryProt;
    PropertySet pset = new DefaultPropertySet();
    pset.initializeProperties(hi.exposeAsProperties());
    tryProt = new PooledXProtocol(hi, pset);
    tryProt.addListener(this);
    tryProt.connect(hi.getUser(), hi.getPassword(), hi.getDatabase());
    return tryProt;
}
Also used : DefaultPropertySet(com.mysql.cj.conf.DefaultPropertySet) PropertySet(com.mysql.cj.conf.PropertySet) DefaultPropertySet(com.mysql.cj.conf.DefaultPropertySet)

Example 4 with PropertySet

use of com.mysql.cj.conf.PropertySet in project JavaSegundasQuintas by ecteruel.

the class SessionImpl method getUri.

public String getUri() {
    PropertySet pset = this.session.getPropertySet();
    StringBuilder sb = new StringBuilder(ConnectionUrl.Type.XDEVAPI_SESSION.getScheme());
    sb.append("//").append(this.session.getProcessHost()).append(":").append(this.session.getPort()).append("/").append(this.defaultSchemaName).append("?");
    boolean isFirstParam = true;
    for (PropertyKey propKey : PropertyDefinitions.PROPERTY_KEY_TO_PROPERTY_DEFINITION.keySet()) {
        RuntimeProperty<?> propToGet = pset.getProperty(propKey);
        if (propToGet.isExplicitlySet()) {
            String propValue = propToGet.getStringValue();
            Object defaultValue = propToGet.getPropertyDefinition().getDefaultValue();
            if (defaultValue == null && !StringUtils.isNullOrEmpty(propValue) || defaultValue != null && propValue == null || defaultValue != null && propValue != null && !propValue.equals(defaultValue.toString())) {
                if (isFirstParam) {
                    isFirstParam = false;
                } else {
                    sb.append("&");
                }
                sb.append(propKey.getKeyName());
                sb.append("=");
                sb.append(propValue);
            }
        // TODO custom properties?
        }
    }
    return sb.toString();
}
Also used : PropertySet(com.mysql.cj.conf.PropertySet) DefaultPropertySet(com.mysql.cj.conf.DefaultPropertySet) PropertyKey(com.mysql.cj.conf.PropertyKey)

Example 5 with PropertySet

use of com.mysql.cj.conf.PropertySet in project JavaSegundasQuintas by ecteruel.

the class SecureSessionTest method testXdevapiSslConnectionOptions.

/**
 * Tests that given SSL/TLS related session properties values are processed as expected.
 *
 * @throws Exception
 */
@Test
public void testXdevapiSslConnectionOptions() throws Exception {
    assumeTrue(supportsTestCertificates(this.session), "This test requires the server configured with SSL certificates from ConnectorJ/src/test/config/ssl-test-certs");
    Session testSess;
    PropertySet propSet;
    /*
         * Check defaults.
         */
    testSess = this.fact.getSession(this.sslFreeBaseUrl);
    propSet = ((SessionImpl) testSess).getSession().getPropertySet();
    // X DevAPI options.
    assertEquals(XdevapiSslMode.REQUIRED, propSet.getProperty(PropertyKey.xdevapiSslMode).getValue());
    assertNull(propSet.getProperty(PropertyKey.xdevapiSslTrustStoreUrl).getValue());
    assertEquals("JKS", propSet.getProperty(PropertyKey.xdevapiSslTrustStoreType).getValue());
    assertNull(propSet.getProperty(PropertyKey.xdevapiSslTrustStorePassword).getValue());
    assertTrue(propSet.getBooleanProperty(PropertyKey.xdevapiFallbackToSystemTrustStore).getValue());
    assertNull(propSet.getProperty(PropertyKey.xdevapiSslKeyStoreUrl).getValue());
    assertEquals("JKS", propSet.getProperty(PropertyKey.xdevapiSslKeyStoreType).getValue());
    assertNull(propSet.getProperty(PropertyKey.xdevapiSslKeyStorePassword).getValue());
    assertTrue(propSet.getBooleanProperty(PropertyKey.xdevapiFallbackToSystemKeyStore).getValue());
    // Global (JDBC) options.
    assertEquals(SslMode.REQUIRED, propSet.getProperty(PropertyKey.sslMode).getValue());
    assertNull(propSet.getProperty(PropertyKey.trustCertificateKeyStoreUrl).getValue());
    assertEquals("JKS", propSet.getProperty(PropertyKey.trustCertificateKeyStoreType).getValue());
    assertNull(propSet.getProperty(PropertyKey.trustCertificateKeyStorePassword).getValue());
    assertTrue(propSet.getBooleanProperty(PropertyKey.fallbackToSystemTrustStore).getValue());
    assertNull(propSet.getProperty(PropertyKey.clientCertificateKeyStoreUrl).getValue());
    assertEquals("JKS", propSet.getProperty(PropertyKey.clientCertificateKeyStoreType).getValue());
    assertNull(propSet.getProperty(PropertyKey.clientCertificateKeyStorePassword).getValue());
    assertTrue(propSet.getBooleanProperty(PropertyKey.fallbackToSystemKeyStore).getValue());
    testSess.close();
    /*
         * Check SSL properties set globally (JDBC)
         */
    Properties props = new Properties(this.sslFreeTestProperties);
    // Set global SSL connection properties.
    props.setProperty(PropertyKey.sslMode.getKeyName(), SslMode.VERIFY_CA.toString());
    props.setProperty(PropertyKey.trustCertificateKeyStoreUrl.getKeyName(), "file:src/test/config/ssl-test-certs/ca-truststore");
    props.setProperty(PropertyKey.trustCertificateKeyStoreType.getKeyName(), "JKS");
    props.setProperty(PropertyKey.trustCertificateKeyStorePassword.getKeyName(), "password");
    props.setProperty(PropertyKey.fallbackToSystemTrustStore.getKeyName(), "false");
    props.setProperty(PropertyKey.clientCertificateKeyStoreUrl.getKeyName(), "file:src/test/config/ssl-test-certs/client-keystore");
    props.setProperty(PropertyKey.clientCertificateKeyStoreType.getKeyName(), "JKS");
    props.setProperty(PropertyKey.clientCertificateKeyStorePassword.getKeyName(), "password");
    props.setProperty(PropertyKey.fallbackToSystemKeyStore.getKeyName(), "false");
    testSess = this.fact.getSession(props);
    propSet = ((SessionImpl) testSess).getSession().getPropertySet();
    // X DevAPI options keep defaults.
    assertEquals(XdevapiSslMode.REQUIRED, propSet.getProperty(PropertyKey.xdevapiSslMode).getValue());
    assertNull(propSet.getProperty(PropertyKey.xdevapiSslTrustStoreUrl).getValue());
    assertEquals("JKS", propSet.getProperty(PropertyKey.xdevapiSslTrustStoreType).getValue());
    assertNull(propSet.getProperty(PropertyKey.xdevapiSslTrustStorePassword).getValue());
    assertTrue(propSet.getBooleanProperty(PropertyKey.xdevapiFallbackToSystemTrustStore).getValue());
    assertNull(propSet.getProperty(PropertyKey.xdevapiSslKeyStoreUrl).getValue());
    assertEquals("JKS", propSet.getProperty(PropertyKey.xdevapiSslKeyStoreType).getValue());
    assertNull(propSet.getProperty(PropertyKey.xdevapiSslKeyStorePassword).getValue());
    assertTrue(propSet.getBooleanProperty(PropertyKey.xdevapiFallbackToSystemKeyStore).getValue());
    // Global (JDBC) were set.
    assertEquals(SslMode.VERIFY_CA, propSet.getProperty(PropertyKey.sslMode).getValue());
    assertEquals("file:src/test/config/ssl-test-certs/ca-truststore", propSet.getProperty(PropertyKey.trustCertificateKeyStoreUrl).getValue());
    assertEquals("JKS", propSet.getProperty(PropertyKey.trustCertificateKeyStoreType).getValue());
    assertEquals("password", propSet.getProperty(PropertyKey.trustCertificateKeyStorePassword).getValue());
    assertFalse(propSet.getBooleanProperty(PropertyKey.fallbackToSystemTrustStore).getValue());
    assertEquals("file:src/test/config/ssl-test-certs/client-keystore", propSet.getProperty(PropertyKey.clientCertificateKeyStoreUrl).getValue());
    assertEquals("JKS", propSet.getProperty(PropertyKey.clientCertificateKeyStoreType).getValue());
    assertEquals("password", propSet.getProperty(PropertyKey.clientCertificateKeyStorePassword).getValue());
    assertFalse(propSet.getBooleanProperty(PropertyKey.fallbackToSystemKeyStore).getValue());
    testSess.close();
    props.setProperty(PropertyKey.fallbackToSystemTrustStore.getKeyName(), "true");
    props.setProperty(PropertyKey.fallbackToSystemKeyStore.getKeyName(), "true");
    testSess = this.fact.getSession(props);
    propSet = ((SessionImpl) testSess).getSession().getPropertySet();
    // X DevAPI options keep defaults.
    assertEquals(XdevapiSslMode.REQUIRED, propSet.getProperty(PropertyKey.xdevapiSslMode).getValue());
    assertNull(propSet.getProperty(PropertyKey.xdevapiSslTrustStoreUrl).getValue());
    assertEquals("JKS", propSet.getProperty(PropertyKey.xdevapiSslTrustStoreType).getValue());
    assertNull(propSet.getProperty(PropertyKey.xdevapiSslTrustStorePassword).getValue());
    assertTrue(propSet.getBooleanProperty(PropertyKey.xdevapiFallbackToSystemTrustStore).getValue());
    assertNull(propSet.getProperty(PropertyKey.xdevapiSslKeyStoreUrl).getValue());
    assertEquals("JKS", propSet.getProperty(PropertyKey.xdevapiSslKeyStoreType).getValue());
    assertNull(propSet.getProperty(PropertyKey.xdevapiSslKeyStorePassword).getValue());
    assertTrue(propSet.getBooleanProperty(PropertyKey.xdevapiFallbackToSystemKeyStore).getValue());
    // Global (JDBC) options were set.
    assertEquals(SslMode.VERIFY_CA, propSet.getProperty(PropertyKey.sslMode).getValue());
    assertEquals("file:src/test/config/ssl-test-certs/ca-truststore", propSet.getProperty(PropertyKey.trustCertificateKeyStoreUrl).getValue());
    assertEquals("JKS", propSet.getProperty(PropertyKey.trustCertificateKeyStoreType).getValue());
    assertEquals("password", propSet.getProperty(PropertyKey.trustCertificateKeyStorePassword).getValue());
    assertTrue(propSet.getBooleanProperty(PropertyKey.fallbackToSystemTrustStore).getValue());
    assertEquals("file:src/test/config/ssl-test-certs/client-keystore", propSet.getProperty(PropertyKey.clientCertificateKeyStoreUrl).getValue());
    assertEquals("JKS", propSet.getProperty(PropertyKey.clientCertificateKeyStoreType).getValue());
    assertEquals("password", propSet.getProperty(PropertyKey.clientCertificateKeyStorePassword).getValue());
    assertTrue(propSet.getBooleanProperty(PropertyKey.fallbackToSystemKeyStore).getValue());
    testSess.close();
    /*
         * Check SSL properties set locally on the X DevAPI.
         */
    props = new Properties(this.sslFreeTestProperties);
    // Set global SSL connection properties.
    props.setProperty(PropertyKey.sslMode.getKeyName(), SslMode.DISABLED.toString());
    props.setProperty(PropertyKey.trustCertificateKeyStoreUrl.getKeyName(), "trust-cert-keystore-url");
    props.setProperty(PropertyKey.trustCertificateKeyStoreType.getKeyName(), "trust-cert-keystore-type");
    props.setProperty(PropertyKey.trustCertificateKeyStorePassword.getKeyName(), "trust-cert-keystore-pwd");
    props.setProperty(PropertyKey.fallbackToSystemTrustStore.getKeyName(), "false");
    props.setProperty(PropertyKey.clientCertificateKeyStoreUrl.getKeyName(), "client-cert-keystore-url");
    props.setProperty(PropertyKey.clientCertificateKeyStoreType.getKeyName(), "client-cert-keystore-type");
    props.setProperty(PropertyKey.clientCertificateKeyStorePassword.getKeyName(), "client-cert-keystore-pwd");
    props.setProperty(PropertyKey.fallbackToSystemKeyStore.getKeyName(), "false");
    // Set X DevAPI local connection properties.
    props.setProperty(PropertyKey.xdevapiSslMode.getKeyName(), XdevapiSslMode.VERIFY_CA.toString());
    props.setProperty(PropertyKey.xdevapiSslTrustStoreUrl.getKeyName(), "file:src/test/config/ssl-test-certs/ca-truststore");
    props.setProperty(PropertyKey.xdevapiSslTrustStoreType.getKeyName(), "JKS");
    props.setProperty(PropertyKey.xdevapiSslTrustStorePassword.getKeyName(), "password");
    props.setProperty(PropertyKey.xdevapiFallbackToSystemTrustStore.getKeyName(), "false");
    props.setProperty(PropertyKey.xdevapiSslKeyStoreUrl.getKeyName(), "file:src/test/config/ssl-test-certs/client-keystore");
    props.setProperty(PropertyKey.xdevapiSslKeyStoreType.getKeyName(), "JKS");
    props.setProperty(PropertyKey.xdevapiSslKeyStorePassword.getKeyName(), "password");
    props.setProperty(PropertyKey.xdevapiFallbackToSystemKeyStore.getKeyName(), "false");
    testSess = this.fact.getSession(props);
    propSet = ((SessionImpl) testSess).getSession().getPropertySet();
    // X DevAPI options were set.
    assertEquals(XdevapiSslMode.VERIFY_CA, propSet.getProperty(PropertyKey.xdevapiSslMode).getValue());
    assertEquals("file:src/test/config/ssl-test-certs/ca-truststore", propSet.getProperty(PropertyKey.xdevapiSslTrustStoreUrl).getValue());
    assertEquals("JKS", propSet.getProperty(PropertyKey.xdevapiSslTrustStoreType).getValue());
    assertEquals("password", propSet.getProperty(PropertyKey.xdevapiSslTrustStorePassword).getValue());
    assertFalse(propSet.getBooleanProperty(PropertyKey.xdevapiFallbackToSystemTrustStore).getValue());
    assertEquals("file:src/test/config/ssl-test-certs/client-keystore", propSet.getProperty(PropertyKey.xdevapiSslKeyStoreUrl).getValue());
    assertEquals("JKS", propSet.getProperty(PropertyKey.xdevapiSslKeyStoreType).getValue());
    assertEquals("password", propSet.getProperty(PropertyKey.xdevapiSslKeyStorePassword).getValue());
    assertFalse(propSet.getBooleanProperty(PropertyKey.xdevapiFallbackToSystemKeyStore).getValue());
    // Global (JDBC) options were overridden.
    assertEquals(SslMode.VERIFY_CA, propSet.getProperty(PropertyKey.sslMode).getValue());
    assertEquals("file:src/test/config/ssl-test-certs/ca-truststore", propSet.getProperty(PropertyKey.trustCertificateKeyStoreUrl).getValue());
    assertEquals("JKS", propSet.getProperty(PropertyKey.trustCertificateKeyStoreType).getValue());
    assertEquals("password", propSet.getProperty(PropertyKey.trustCertificateKeyStorePassword).getValue());
    assertFalse(propSet.getBooleanProperty(PropertyKey.fallbackToSystemTrustStore).getValue());
    assertEquals("file:src/test/config/ssl-test-certs/client-keystore", propSet.getProperty(PropertyKey.clientCertificateKeyStoreUrl).getValue());
    assertEquals("JKS", propSet.getProperty(PropertyKey.clientCertificateKeyStoreType).getValue());
    assertEquals("password", propSet.getProperty(PropertyKey.clientCertificateKeyStorePassword).getValue());
    assertFalse(propSet.getBooleanProperty(PropertyKey.fallbackToSystemKeyStore).getValue());
    testSess.close();
    props.setProperty(PropertyKey.xdevapiFallbackToSystemTrustStore.getKeyName(), "true");
    props.setProperty(PropertyKey.xdevapiFallbackToSystemKeyStore.getKeyName(), "true");
    testSess = this.fact.getSession(props);
    propSet = ((SessionImpl) testSess).getSession().getPropertySet();
    // X DevAPI options were set.
    assertEquals(XdevapiSslMode.VERIFY_CA, propSet.getProperty(PropertyKey.xdevapiSslMode).getValue());
    assertEquals("file:src/test/config/ssl-test-certs/ca-truststore", propSet.getProperty(PropertyKey.xdevapiSslTrustStoreUrl).getValue());
    assertEquals("JKS", propSet.getProperty(PropertyKey.xdevapiSslTrustStoreType).getValue());
    assertEquals("password", propSet.getProperty(PropertyKey.xdevapiSslTrustStorePassword).getValue());
    assertTrue(propSet.getBooleanProperty(PropertyKey.xdevapiFallbackToSystemTrustStore).getValue());
    assertEquals("file:src/test/config/ssl-test-certs/client-keystore", propSet.getProperty(PropertyKey.xdevapiSslKeyStoreUrl).getValue());
    assertEquals("JKS", propSet.getProperty(PropertyKey.xdevapiSslKeyStoreType).getValue());
    assertEquals("password", propSet.getProperty(PropertyKey.xdevapiSslKeyStorePassword).getValue());
    assertTrue(propSet.getBooleanProperty(PropertyKey.xdevapiFallbackToSystemKeyStore).getValue());
    // Global (JDBC) options were overridden.
    assertEquals(SslMode.VERIFY_CA, propSet.getProperty(PropertyKey.sslMode).getValue());
    assertEquals("file:src/test/config/ssl-test-certs/ca-truststore", propSet.getProperty(PropertyKey.trustCertificateKeyStoreUrl).getValue());
    assertEquals("JKS", propSet.getProperty(PropertyKey.trustCertificateKeyStoreType).getValue());
    assertEquals("password", propSet.getProperty(PropertyKey.trustCertificateKeyStorePassword).getValue());
    assertTrue(propSet.getBooleanProperty(PropertyKey.fallbackToSystemTrustStore).getValue());
    assertEquals("file:src/test/config/ssl-test-certs/client-keystore", propSet.getProperty(PropertyKey.clientCertificateKeyStoreUrl).getValue());
    assertEquals("JKS", propSet.getProperty(PropertyKey.clientCertificateKeyStoreType).getValue());
    assertEquals("password", propSet.getProperty(PropertyKey.clientCertificateKeyStorePassword).getValue());
    assertTrue(propSet.getBooleanProperty(PropertyKey.fallbackToSystemKeyStore).getValue());
    testSess.close();
}
Also used : PropertySet(com.mysql.cj.conf.PropertySet) SessionImpl(com.mysql.cj.xdevapi.SessionImpl) Properties(java.util.Properties) CoreSession(com.mysql.cj.CoreSession) Session(com.mysql.cj.xdevapi.Session) Test(org.junit.jupiter.api.Test)

Aggregations

PropertySet (com.mysql.cj.conf.PropertySet)26 DefaultPropertySet (com.mysql.cj.conf.DefaultPropertySet)20 Test (org.junit.jupiter.api.Test)9 Properties (java.util.Properties)6 CoreSession (com.mysql.cj.CoreSession)3 MysqlxSession (com.mysql.cj.MysqlxSession)3 PropertyDefinitions (com.mysql.cj.conf.PropertyDefinitions)3 SslMode (com.mysql.cj.conf.PropertyDefinitions.SslMode)3 PropertyKey (com.mysql.cj.conf.PropertyKey)3 DataConversionException (com.mysql.cj.exceptions.DataConversionException)3 DataReadException (com.mysql.cj.exceptions.DataReadException)3 InternalDate (com.mysql.cj.protocol.InternalDate)3 InternalTime (com.mysql.cj.protocol.InternalTime)3 InternalTimestamp (com.mysql.cj.protocol.InternalTimestamp)3 XProtocol (com.mysql.cj.protocol.x.XProtocol)3 Session (com.mysql.cj.xdevapi.Session)3 SessionImpl (com.mysql.cj.xdevapi.SessionImpl)3 DateTimeException (java.time.DateTimeException)3 SSLSocket (javax.net.ssl.SSLSocket)3 SSLSocketFactory (javax.net.ssl.SSLSocketFactory)3